From 58597139fa0fb9e9be60deebee3df1663aa2cfaf Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 10 Feb 2022 13:07:01 +0100 Subject: [PATCH] docs: Improve markdownlint configuration (#11104) ## Description Closes: #9404 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://github.com/cosmos/cosmos-sdk/blob/master/docs/building-modules) - [ ] included the necessary unit and integration [tests](https://github.com/cosmos/cosmos-sdk/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable) --- .markdownlint.json | 14 +- .markdownlintignore | 2 +- CHANGELOG.md | 2138 +++++++++-------- CODING_GUIDELINES.md | 108 +- CONTRIBUTING.md | 125 +- RELEASE_PROCESS.md | 80 +- SECURITY.md | 44 +- contrib/githooks/README.md | 4 +- contrib/images/simd-dlv/README.md | 3 + contrib/rosetta/README.md | 12 +- cosmovisor/CHANGELOG.md | 28 +- cosmovisor/README.md | 138 +- cosmovisor/RELEASE_NOTES.md | 6 +- crypto/bcrypt_readme.md | 6 +- .../secp256k1/internal/secp256k1/README.md | 4 +- doc/proto-docs.md | 14 +- docs/DOCS_README.md | 40 +- docs/DOC_WRITING_GUIDELINES.md | 14 +- docs/README.md | 28 +- docs/architecture/PROCESS.md | 22 +- docs/architecture/README.md | 76 +- docs/architecture/adr-002-docs-structure.md | 56 +- .../adr-003-dynamic-capability-store.md | 16 +- .../adr-004-split-denomination-keys.md | 28 +- .../adr-006-secret-store-replacement.md | 18 +- .../adr-007-specialization-groups.md | 38 +- docs/architecture/adr-008-dCERT-group.md | 54 +- docs/architecture/adr-009-evidence-module.md | 28 +- .../adr-010-modular-antehandler.md | 12 +- .../adr-011-generalize-genesis-accounts.md | 14 +- docs/architecture/adr-012-state-accessors.md | 24 +- docs/architecture/adr-013-metrics.md | 4 +- .../adr-014-proportional-slashing.md | 22 +- ...dr-016-validator-consensus-key-rotation.md | 94 +- .../adr-017-historical-header-module.md | 14 +- .../adr-018-extendable-voting-period.md | 16 +- .../adr-019-protobuf-state-encoding.md | 56 +- .../adr-020-protobuf-transaction-encoding.md | 108 +- .../adr-021-protobuf-query-encoding.md | 2 +- .../adr-022-custom-panic-handling.md | 20 +- docs/architecture/adr-023-protobuf-naming.md | 12 +- docs/architecture/adr-024-coin-metadata.md | 12 +- ...27-deterministic-protobuf-serialization.md | 56 +- .../adr-028-public-key-addresses.md | 98 +- docs/architecture/adr-029-fee-grant-module.md | 14 +- docs/architecture/adr-030-authz-module.md | 22 +- docs/architecture/adr-031-msg-service.md | 28 +- docs/architecture/adr-032-typed-events.md | 20 +- .../adr-033-protobuf-inter-module-comm.md | 34 +- docs/architecture/adr-034-account-rekeying.md | 4 +- .../adr-035-rosetta-api-support.md | 16 +- .../adr-036-arbitrary-signature.md | 42 +- docs/architecture/adr-037-gov-split-vote.md | 22 +- docs/architecture/adr-038-state-listening.md | 12 +- docs/architecture/adr-039-epoched-staking.md | 36 +- ...r-040-storage-and-smt-state-commitments.md | 77 +- .../adr-041-in-place-store-migrations.md | 36 +- docs/architecture/adr-042-group-module.md | 42 +- docs/architecture/adr-043-nft-module.md | 87 +- .../adr-044-protobuf-updates-guidelines.md | 42 +- .../adr-045-check-delivertx-middlewares.md | 40 +- docs/architecture/adr-046-module-params.md | 22 +- docs/architecture/adr-template.md | 4 +- docs/basics/accounts.md | 52 +- docs/basics/app-anatomy.md | 96 +- docs/basics/gas-fees.md | 38 +- docs/basics/query-lifecycle.md | 26 +- docs/basics/tx-lifecycle.md | 26 +- docs/building-modules/beginblock-endblock.md | 12 +- docs/building-modules/errors.md | 4 +- docs/building-modules/genesis.md | 14 +- docs/building-modules/intro.md | 20 +- docs/building-modules/invariants.md | 10 +- docs/building-modules/keeper.md | 12 +- docs/building-modules/messages-and-queries.md | 42 +- docs/building-modules/module-interfaces.md | 66 +- docs/building-modules/module-manager.md | 98 +- docs/building-modules/msg-services.md | 30 +- docs/building-modules/query-services.md | 16 +- docs/building-modules/simulator.md | 13 +- docs/building-modules/structure.md | 44 +- docs/building-modules/upgrade.md | 8 +- docs/core/baseapp.md | 112 +- docs/core/cli.md | 62 +- docs/core/context.md | 32 +- docs/core/encoding.md | 54 +- docs/core/events.md | 28 +- docs/core/grpc_rest.md | 38 +- docs/core/node.md | 28 +- docs/core/ocap.md | 2 +- docs/core/proto-docs.md | 1 + docs/core/runtx_middleware.md | 4 +- docs/core/simulation.md | 32 +- docs/core/store.md | 70 +- docs/core/transactions.md | 44 +- docs/core/upgrade.md | 4 +- docs/ibc/custom.md | 4 +- docs/ibc/integration.md | 14 +- docs/ibc/overview.md | 48 +- docs/ibc/relayer.md | 10 +- docs/ibc/upgrades/README.md | 2 +- docs/ibc/upgrades/quick-guide.md | 6 +- docs/intro/overview.md | 18 +- docs/intro/sdk-app-architecture.md | 14 +- docs/intro/sdk-design.md | 10 +- docs/intro/why-app-specific.md | 36 +- docs/migrations/chain-upgrade-guide-044.md | 40 +- docs/run-node/interact-node.md | 10 +- docs/run-node/keyring.md | 10 +- docs/run-node/rosetta.md | 4 +- docs/run-node/run-node.md | 8 +- docs/run-node/run-testnet.md | 6 +- docs/run-node/txs.md | 24 +- docs/spec/README.md | 4 +- docs/spec/SPEC-SPEC.md | 34 +- docs/spec/_ics/README.md | 2 +- docs/spec/addresses/README.md | 2 +- docs/spec/circuit-breaker/01_concepts.md | 6 +- docs/spec/reserve-pool/TODO.md | 2 +- docs/using-the-sdk/README.md | 4 +- errors/CHANGELOG.md | 1 + proto/README.md | 2 +- proto/buf.md | 4 +- scripts/README.md | 6 +- server/README.md | 4 +- simapp/README.md | 2 +- store/README.md | 2 +- store/streaming/file/README.md | 4 +- types/address/README.md | 2 +- x/README.md | 30 +- x/auth/README.md | 2 +- x/auth/spec/02_state.md | 2 +- x/auth/spec/03_antehandlers.md | 26 +- x/auth/spec/05_vesting.md | 134 +- x/auth/spec/README.md | 34 +- x/authz/README.md | 2 +- x/authz/spec/01_concepts.md | 18 +- x/authz/spec/02_state.md | 4 +- x/authz/spec/03_messages.md | 24 +- x/authz/spec/README.md | 18 +- x/bank/README.md | 2 +- x/bank/atlas/atlas-v0.39.1.md | 12 +- x/bank/spec/01_state.md | 8 +- x/bank/spec/03_messages.md | 16 +- x/bank/spec/06_client.md | 74 +- x/bank/spec/README.md | 34 +- x/capability/README.md | 2 +- x/capability/spec/01_concepts.md | 2 +- x/crisis/README.md | 2 +- x/crisis/spec/01_state.md | 2 +- x/crisis/spec/02_messages.md | 6 +- x/crisis/spec/README.md | 8 +- x/distribution/README.md | 2 +- x/distribution/spec/02_state.md | 8 +- x/distribution/spec/03_begin_block.md | 10 +- x/distribution/spec/04_messages.md | 6 +- x/distribution/spec/05_hooks.md | 30 +- x/distribution/spec/08_client.md | 92 +- x/distribution/spec/README.md | 40 +- x/epoching/README.md | 2 +- x/epoching/spec/01_state.md | 8 +- x/epoching/spec/03_to_improve.md | 6 +- x/evidence/README.md | 2 +- x/evidence/spec/06_begin_block.md | 8 +- x/feegrant/README.md | 2 +- x/feegrant/spec/01_concepts.md | 38 +- x/feegrant/spec/02_state.md | 6 +- x/feegrant/spec/03_messages.md | 4 +- x/feegrant/spec/04_events.md | 36 +- x/feegrant/spec/05_client.md | 38 +- x/feegrant/spec/README.md | 32 +- x/gov/README.md | 2 +- x/gov/spec/01_concepts.md | 34 +- x/gov/spec/02_state.md | 20 +- x/gov/spec/03_messages.md | 36 +- x/gov/spec/04_events.md | 4 +- x/gov/spec/README.md | 42 +- x/group/internal/orm/spec/01_table.md | 18 +- .../internal/orm/spec/02_secondary_index.md | 8 +- .../orm/spec/03_iterator_pagination.md | 8 +- x/group/internal/orm/spec/README.md | 12 +- x/group/spec/01_concepts.md | 2 +- x/group/spec/03_messages.md | 50 +- x/group/spec/04_events.md | 2 +- x/group/spec/README.md | 68 +- x/mint/README.md | 2 +- x/mint/spec/01_concepts.md | 10 +- x/mint/spec/02_state.md | 8 +- x/mint/spec/03_begin_block.md | 6 +- x/mint/spec/06_client.md | 54 +- x/mint/spec/README.md | 18 +- x/params/README.md | 2 +- x/params/spec/README.md | 6 +- x/slashing/README.md | 2 +- x/slashing/spec/02_state.md | 8 +- x/slashing/spec/03_messages.md | 2 +- x/slashing/spec/05_hooks.md | 8 +- x/slashing/spec/06_events.md | 10 +- x/slashing/spec/07_tombstone.md | 4 +- x/slashing/spec/09_client.md | 68 +- x/slashing/spec/README.md | 32 +- x/staking/README.md | 2 +- x/staking/spec/01_state.md | 62 +- x/staking/spec/02_state_transitions.md | 90 +- x/staking/spec/03_messages.md | 112 +- x/staking/spec/05_end_block.md | 18 +- x/staking/spec/06_hooks.md | 32 +- x/staking/spec/07_events.md | 4 +- x/staking/spec/README.md | 44 +- x/upgrade/README.md | 2 +- x/upgrade/spec/02_state.md | 8 +- x/upgrade/spec/README.md | 6 +- 212 files changed, 3793 insertions(+), 3756 deletions(-) diff --git a/.markdownlint.json b/.markdownlint.json index 2c48f4d57978..6306b80bad9c 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -1,17 +1,11 @@ { "default": true, - "MD001": false, - "MD004": false, + "MD004": {"style": "asterisk"}, "MD007": { "indent": 4 }, "MD013": false, "MD024": { "siblings_only": true }, "MD025": false, - "MD026": { "punctuation": ".,;:" }, - "MD029": false, "MD033": false, - "MD034": false, - "MD036": false, - "MD040": false, - "MD041": false, - "no-hard-tabs": false -} + "no-hard-tabs": false, + "whitespace": false +} \ No newline at end of file diff --git a/.markdownlintignore b/.markdownlintignore index 23912b75847e..cf1db6077fd5 100644 --- a/.markdownlintignore +++ b/.markdownlintignore @@ -1,2 +1,2 @@ -CHANGELOG.md docs/node_modules +/README.md \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bd0a3cd8954..e35ec3340df8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,26 +63,27 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (gov) [\#11036](https://github.com/cosmos/cosmos-sdk/pull/11036) Add in-place migrations for 0.43->0.46. Add a `migrate v0.46` CLI command for v0.43->0.46 JSON genesis migration. ### API Breaking Changes + * [\#10950](https://github.com/cosmos/cosmos-sdk/pull/10950) Add `envPrefix` parameter to `cmd.Execute`. * (x/mint) [\#10441](https://github.com/cosmos/cosmos-sdk/pull/10441) The `NewAppModule` function now accepts an inflation calculation function as an argument. * [\#10295](https://github.com/cosmos/cosmos-sdk/pull/10295) Remove store type aliases from /types * [\#9695](https://github.com/cosmos/cosmos-sdk/pull/9695) Migrate keys from `Info` -> `Record` - * Add new `codec.Codec` argument in: - * `keyring.NewInMemory` - * `keyring.New` - * Rename: - * `SavePubKey` to `SaveOfflineKey`. - * `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively. Move them into `legacy_info.go`. - * `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`. - * Return: + * Add new `codec.Codec` argument in: + * `keyring.NewInMemory` + * `keyring.New` + * Rename: + * `SavePubKey` to `SaveOfflineKey`. + * `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively. Move them into `legacy_info.go`. + * `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`. + * Return: *`keyring.Record, error` in `SaveOfflineKey`, `SaveLedgerKey`, `SaveMultiSig`, `Key` and `KeyByAddress`. *`keyring.Record` instead of `Info` in `NewMnemonic` and `List`. - * Remove `algo` argument from : - * `SaveOfflineKey` - * Take `keyring.Record` instead of `Info` as first argument in: - * `MkConsKeyOutput` - * `MkValKeyOutput` - * `MkAccKeyOutput` + * Remove `algo` argument from : + * `SaveOfflineKey` + * Take `keyring.Record` instead of `Info` as first argument in: + * `MkConsKeyOutput` + * `MkValKeyOutput` + * `MkAccKeyOutput` * [\#10022](https://github.com/cosmos/cosmos-sdk/pull/10022) `AuthKeeper` interface in `x/auth` now includes a function `HasAccount`. * [\#9759](https://github.com/cosmos/cosmos-sdk/pull/9759) `NewAccountKeeeper` in `x/auth` now takes an additional `bech32Prefix` argument that represents `sdk.Bech32MainPrefix`. * [\#9628](https://github.com/cosmos/cosmos-sdk/pull/9628) Rename `x/{mod}/legacy` to `x/{mod}/migrations`. @@ -102,14 +103,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#9576](https://github.com/cosmos/cosmos-sdk/pull/9576) Add debug error message to `sdkerrors.QueryResult` when enabled * [\#9650](https://github.com/cosmos/cosmos-sdk/pull/9650) Removed deprecated message handler implementation from the SDK modules. * [\#10248](https://github.com/cosmos/cosmos-sdk/pull/10248) Remove unused `KeyPowerReduction` variable from x/staking types. -* (x/bank) [\#9832] (https://github.com/cosmos/cosmos-sdk/pull/9832) `AddressFromBalancesStore` renamed to `AddressAndDenomFromBalancesStore`. +* (x/bank) [\#9832](https://github.com/cosmos/cosmos-sdk/pull/9832) `AddressFromBalancesStore` renamed to `AddressAndDenomFromBalancesStore`. * (tests) [\#9938](https://github.com/cosmos/cosmos-sdk/pull/9938) `simapp.Setup` accepts additional `testing.T` argument. * (baseapp) [\#9920](https://github.com/cosmos/cosmos-sdk/pull/9920) BaseApp `{Check,Deliver,Simulate}Tx` methods are now replaced by a middleware stack. - * Replace the Antehandler interface with the `tx.Handler` and `tx.Middleware` interfaces. - * Replace `baseapp.SetAnteHandler` with `baseapp.SetTxHandler`. - * Move Msg routers from BaseApp to middlewares. - * Move Baseapp panic recovery into a middleware. - * Rename simulation helper methods `baseapp.{Check,Deliver}` to `baseapp.Sim{Check,Deliver}**`. + * Replace the Antehandler interface with the `tx.Handler` and `tx.Middleware` interfaces. + * Replace `baseapp.SetAnteHandler` with `baseapp.SetTxHandler`. + * Move Msg routers from BaseApp to middlewares. + * Move Baseapp panic recovery into a middleware. + * Rename simulation helper methods `baseapp.{Check,Deliver}` to `baseapp.Sim{Check,Deliver}**`. * (x/gov) [\#10373](https://github.com/cosmos/cosmos-sdk/pull/10373) Removed gov `keeper.{MustMarshal, MustUnmarshal}`. * [\#10348](https://github.com/cosmos/cosmos-sdk/pull/10348) StdSignBytes takes a new argument of type `*tx.Tip` for signing over tips using LEGACY_AMINO_JSON. * [\#10208](https://github.com/cosmos/cosmos-sdk/pull/10208) The `x/auth/signing.Tx` interface now also includes a new `GetTip() *tx.Tip` method for verifying tipped transactions. The `x/auth/types` expected BankKeeper interface now expects the `SendCoins` method too. @@ -123,6 +124,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/authz) [\#10447](https://github.com/cosmos/cosmos-sdk/pull/10447) authz `NewGrant` takes a new argument: block time, to correctly validate expire time. ### Client Breaking Changes + * [\#11089](https://github.com/cosmos/cosmos-sdk/pull/11089]) interacting with the node through `grpc.Dial` requires clients to pass a codec refer to [doc](docs/run-node/interact-node.md). * [\#9594](https://github.com/cosmos/cosmos-sdk/pull/9594) Remove legacy REST API. Please see the [REST Endpoints Migration guide](https://docs.cosmos.network/master/migrations/rest.html) to migrate to the new REST endpoints. * [\#9995](https://github.com/cosmos/cosmos-sdk/pull/9995) Increased gas cost for creating proposals. @@ -138,6 +140,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [\#10684](https://github.com/cosmos/cosmos-sdk/pull/10684) Rename `edit-validator` command's `--moniker` flag to `--new-moniker` ### Improvements + * [\#11089](https://github.com/cosmos/cosmos-sdk/pull/11089]) Now cosmos-sdk consumers can upgrade gRPC to its newest versions. * [\#10439](https://github.com/cosmos/cosmos-sdk/pull/10439) Check error for `RegisterQueryHandlerClient` in all modules `RegisterGRPCGatewayRoutes`. * [\#9780](https://github.com/cosmos/cosmos-sdk/pull/9780) Remove gogoproto `moretags` YAML annotations and add `sigs.k8s.io/yaml` for YAML marshalling. @@ -172,7 +175,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/genutil) [\#9638](https://github.com/cosmos/cosmos-sdk/pull/9638) Added missing validator key save when recovering from mnemonic * [\#9762](https://github.com/cosmos/cosmos-sdk/pull/9762) The init command uses the chain-id from the client config if --chain-id is not provided * [\#9854](https://github.com/cosmos/cosmos-sdk/pull/9854) Fixed the `make proto-gen` to get dynamic container name based on project name for the cosmos based sdks. -+ [\#9980](https://github.com/cosmos/cosmos-sdk/pull/9980) Returning the error when the invalid argument is passed to bank query total supply cli. +* [\#9980](https://github.com/cosmos/cosmos-sdk/pull/9980) Returning the error when the invalid argument is passed to bank query total supply cli. * (server) [#10016](https://github.com/cosmos/cosmos-sdk/issues/10016) Fix marshaling of index-events into server config file. * [\#10184](https://github.com/cosmos/cosmos-sdk/pull/10184) Fixed CLI tx commands to no longer explicitly require the chain-id flag as this value can come from a user config. * [\#10239](https://github.com/cosmos/cosmos-sdk/pull/10239) Fixed x/bank/044 migrateDenomMetadata. @@ -195,8 +198,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/auth)[\#9596](https://github.com/cosmos/cosmos-sdk/pull/9596) Enable creating periodic vesting accounts with a transactions instead of requiring them to be created in genesis. * (x/bank) [\#9611](https://github.com/cosmos/cosmos-sdk/pull/9611) Introduce a new index to act as a reverse index between a denomination and address allowing to query for token holders of a specific denomination. `DenomOwners` is updated to use the new reverse index. -* (x/bank) [\#9832] (https://github.com/cosmos/cosmos-sdk/pull/9832) Account balance is stored as `sdk.Int` rather than `sdk.Coin`. -* (x/bank) [\#9890] (https://github.com/cosmos/cosmos-sdk/pull/9890) Remove duplicate denom from denom metadata key. +* (x/bank) [\#9832](https://github.com/cosmos/cosmos-sdk/pull/9832) Account balance is stored as `sdk.Int` rather than `sdk.Coin`. +* (x/bank) [\#9890](https://github.com/cosmos/cosmos-sdk/pull/9890) Remove duplicate denom from denom metadata key. * (x/upgrade) [\#10189](https://github.com/cosmos/cosmos-sdk/issues/10189) Removed potential sources of non-determinism in upgrades * [\#10422](https://github.com/cosmos/cosmos-sdk/pull/10422) and [\#10529](https://github.com/cosmos/cosmos-sdk/pull/10529) Add `MinCommissionRate` param to `x/staking` module. * [#10763](https://github.com/cosmos/cosmos-sdk/pull/10763) modify the fields in `TallyParams` to use `string` instead of `bytes` @@ -376,14 +379,14 @@ Security Release. No breaking changes related to 0.44.x. * (crypto/ed25519) [\#8690] Adopt zip1215 ed2559 verification rules. * [\#8849](https://github.com/cosmos/cosmos-sdk/pull/8849) Upgrade module no longer supports time based upgrades. * [\#7477](https://github.com/cosmos/cosmos-sdk/pull/7477) Changed Bech32 Public Key serialization in the client facing functionality (CLI, MsgServer, QueryServer): - * updated the keyring display structure (it uses protobuf JSON serialization) - the output is more verbose. - * Renamed `MarshalAny` and `UnmarshalAny` to `MarshalInterface` and `UnmarshalInterface` respectively. These functions must take an interface as parameter (not a concrete type nor `Any` object). Underneath they use `Any` wrapping for correct protobuf serialization. - * CLI: removed `--text` flag from `show-node-id` command; the text format for public keys is not used any more - instead we use ProtoJSON. + * updated the keyring display structure (it uses protobuf JSON serialization) - the output is more verbose. + * Renamed `MarshalAny` and `UnmarshalAny` to `MarshalInterface` and `UnmarshalInterface` respectively. These functions must take an interface as parameter (not a concrete type nor `Any` object). Underneath they use `Any` wrapping for correct protobuf serialization. + * CLI: removed `--text` flag from `show-node-id` command; the text format for public keys is not used any more - instead we use ProtoJSON. * (store) [\#8790](https://github.com/cosmos/cosmos-sdk/pull/8790) Reduce gas costs by 10x for transient store operations. * [\#9139](https://github.com/cosmos/cosmos-sdk/pull/9139) Querying events: - * via `ServiceMsg` TypeURLs (e.g. `message.action='/cosmos.bank.v1beta1.Msg/Send'`) does not work anymore, - * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. - * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). + * via `ServiceMsg` TypeURLs (e.g. `message.action='/cosmos.bank.v1beta1.Msg/Send'`) does not work anymore, + * via legacy `msg.Type()` (e.g. `message.action='send'`) is being deprecated, new `Msg`s won't emit these events. + * Please use concrete `Msg` TypeURLs instead (e.g. `message.action='/cosmos.bank.v1beta1.MsgSend'`). * [\#9859](https://github.com/cosmos/cosmos-sdk/pull/9859) The `default` pruning strategy now keeps the last 362880 blocks instead of 100. 362880 equates to roughly enough blocks to cover the entire unbonding period assuming a 21 day unbonding period and 5s block time. * [\#9785](https://github.com/cosmos/cosmos-sdk/issues/9785) Missing coin denomination in logs @@ -406,11 +409,11 @@ Security Release. No breaking changes related to 0.44.x. * (baseapp) [\7487](https://github.com/cosmos/cosmos-sdk/pull/8897) BaseApp's fields appVersion and version were swapped to match Tendermint's fields. * [\#8682](https://github.com/cosmos/cosmos-sdk/pull/8682) `ante.NewAnteHandler` updated to receive all positional params as `ante.HandlerOptions` struct. If required fields aren't set, throws error accordingly. * (x/staking/types) [\#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support: - * `ValidatorI` interface update: `GetConsPubKey` renamed to `TmConsPubKey` (this is to clarify the return type: consensus public key must be a tendermint key); `TmConsPubKey`, `GetConsAddr` methods return error. - * `Validator` updated according to the `ValidatorI` changes described above. - * `ToTmValidator` function: added `error` to return values. - * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. - * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. + * `ValidatorI` interface update: `GetConsPubKey` renamed to `TmConsPubKey` (this is to clarify the return type: consensus public key must be a tendermint key); `TmConsPubKey`, `GetConsAddr` methods return error. + * `Validator` updated according to the `ValidatorI` changes described above. + * `ToTmValidator` function: added `error` to return values. + * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. + * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. * (client) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) `client/tx.PrepareFactory` has been converted to a private function, as it's only used internally. * (auth/tx) [\#8926](https://github.com/cosmos/cosmos-sdk/pull/8926) The `ProtoTxProvider` interface used as a workaround for transaction simulation has been removed. * (x/bank) [\#8798](https://github.com/cosmos/cosmos-sdk/pull/8798) `GetTotalSupply` is removed in favour of `GetPaginatedTotalSupply` @@ -418,15 +421,15 @@ Security Release. No breaking changes related to 0.44.x. * (x/bank/types) [\#9061](https://github.com/cosmos/cosmos-sdk/pull/9061) `AddressFromBalancesStore` now returns an error for invalid key instead of panic. * (x/auth) [\#9144](https://github.com/cosmos/cosmos-sdk/pull/9144) The `NewTxTimeoutHeightDecorator` antehandler has been converted from a struct to a function. * (codec) [\#9226](https://github.com/cosmos/cosmos-sdk/pull/9226) Rename codec interfaces and methods, to follow a general Go interfaces: - * `codec.Marshaler` → `codec.Codec` (this defines objects which serialize other objects) - * `codec.BinaryMarshaler` → `codec.BinaryCodec` - * `codec.JSONMarshaler` → `codec.JSONCodec` - * Removed `BinaryBare` suffix from `BinaryCodec` methods (`MarshalBinaryBare`, `UnmarshalBinaryBare`, ...) - * Removed `Binary` infix from `BinaryCodec` methods (`MarshalBinaryLengthPrefixed`, `UnmarshalBinaryLengthPrefixed`, ...) + * `codec.Marshaler` → `codec.Codec` (this defines objects which serialize other objects) + * `codec.BinaryMarshaler` → `codec.BinaryCodec` + * `codec.JSONMarshaler` → `codec.JSONCodec` + * Removed `BinaryBare` suffix from `BinaryCodec` methods (`MarshalBinaryBare`, `UnmarshalBinaryBare`, ...) + * Removed `Binary` infix from `BinaryCodec` methods (`MarshalBinaryLengthPrefixed`, `UnmarshalBinaryLengthPrefixed`, ...) * [\#9139](https://github.com/cosmos/cosmos-sdk/pull/9139) `ServiceMsg` TypeURLs (e.g. `/cosmos.bank.v1beta1.Msg/Send`) have been removed, as they don't comply to the Probobuf `Any` spec. Please use `Msg` type TypeURLs (e.g. `/cosmos.bank.v1beta1.MsgSend`). This has multiple consequences: - * The `sdk.ServiceMsg` struct has been removed. - * `sdk.Msg` now only contains `ValidateBasic` and `GetSigners` methods. The remaining methods `GetSignBytes`, `Route` and `Type` are moved to `legacytx.LegacyMsg`. - * The `RegisterCustomTypeURL` function and the `cosmos.base.v1beta1.ServiceMsg` interface have been removed from the interface registry. + * The `sdk.ServiceMsg` struct has been removed. + * `sdk.Msg` now only contains `ValidateBasic` and `GetSigners` methods. The remaining methods `GetSignBytes`, `Route` and `Type` are moved to `legacytx.LegacyMsg`. + * The `RegisterCustomTypeURL` function and the `cosmos.base.v1beta1.ServiceMsg` interface have been removed from the interface registry. * (codec) [\#9251](https://github.com/cosmos/cosmos-sdk/pull/9251) Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec` as per #9226. * (x/bank) [\#9271](https://github.com/cosmos/cosmos-sdk/pull/9271) SendEnabledCoin(s) renamed to IsSendEnabledCoin(s) to better reflect its functionality. * (x/bank) [\#9550](https://github.com/cosmos/cosmos-sdk/pull/9550) `server.InterceptConfigsPreRunHandler` now takes 2 additional arguments: customAppConfigTemplate and customAppConfig. If you don't need to customize these, simply put `""` and `nil`. @@ -680,7 +683,7 @@ he Cosmos Hub) should not use this release or any release in the v0.41.x series. * [\#8680](https://github.com/cosmos/cosmos-sdk/issues/8680) Fix missing timestamp in GetTxsEvent response [\#8732](https://github.com/cosmos/cosmos-sdk/pull/8732). * [\#8681](https://github.com/cosmos/cosmos-sdk/issues/8681) Fix missing error message when calling GetTxsEvent [\#8732](https://github.com/cosmos/cosmos-sdk/pull/8732) * (server) [\#8641](https://github.com/cosmos/cosmos-sdk/pull/8641) Fix Tendermint and application configuration reading from file -* (client/keys) [\#8639] (https://github.com/cosmos/cosmos-sdk/pull/8639) Fix keys migrate for mulitisig, offline, and ledger keys. The migrate command now takes a positional old_home_dir argument. +* (client/keys) [\#8639](https://github.com/cosmos/cosmos-sdk/pull/8639) Fix keys migrate for mulitisig, offline, and ledger keys. The migrate command now takes a positional old_home_dir argument. ### Improvements @@ -744,9 +747,9 @@ he Cosmos Hub) should not use this release or any release in the v0.41.x series. * [\#8280](https://github.com/cosmos/cosmos-sdk/pull/8280) fix GET /upgrade/current query * (x/auth) [\#8287](https://github.com/cosmos/cosmos-sdk/pull/8287) Fix `tx sign --signature-only` to return correct sequence value in signature. * (build) [\8300](https://github.com/cosmos/cosmos-sdk/pull/8300), [\8301](https://github.com/cosmos/cosmos-sdk/pull/8301) Fix reproducible builds -* (types/errors) [\#8355][https://github.com/cosmos/cosmos-sdk/pull/8355] Fix errorWrap `Is` method. +* (types/errors) [\#8355](https://github.com/cosmos/cosmos-sdk/pull/8355) Fix errorWrap `Is` method. * (x/ibc) [\#8341](https://github.com/cosmos/cosmos-sdk/pull/8341) Fix query latest consensus state. -* (proto) [\#8350][https://github.com/cosmos/cosmos-sdk/pull/8350], [\#8361](https://github.com/cosmos/cosmos-sdk/pull/8361) Update gogo proto deps with v1.3.2 security fixes +* (proto) [\#8350](https://github.com/cosmos/cosmos-sdk/pull/8350), [\#8361](https://github.com/cosmos/cosmos-sdk/pull/8361) Update gogo proto deps with v1.3.2 security fixes * (x/ibc) [\#8359](https://github.com/cosmos/cosmos-sdk/pull/8359) Add missing UnpackInterfaces functions to IBC Query Responses. Fixes 'cannot unpack Any' error for IBC types. * (x/bank) [\#8317](https://github.com/cosmos/cosmos-sdk/pull/8317) Fix panic when querying for a not found client denomination metadata. @@ -759,380 +762,381 @@ sure you are aware of any relevant breaking changes. ### Client Breaking Changes -* __CLI__ - * (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) remove `keys update` command. - * (x/auth) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `tx sign` command now returns an error when signing is attempted with offline/multisig keys. - * (x/auth) [\#6108](https://github.com/cosmos/cosmos-sdk/pull/6108) `tx sign` command's `--validate-signatures` flag is migrated into a `tx validate-signatures` standalone command. - * (x/auth) [#7788](https://github.com/cosmos/cosmos-sdk/pull/7788) Remove `tx auth` subcommands, all auth subcommands exist as `tx ` - * (x/genutil) [\#6651](https://github.com/cosmos/cosmos-sdk/pull/6651) The `gentx` command has been improved. No longer are `--from` and `--name` flags required. Instead, a single argument, `name`, is required which refers to the key pair in the Keyring. In addition, an optional +* **CLI** + * (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) remove `keys update` command. + * (x/auth) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `tx sign` command now returns an error when signing is attempted with offline/multisig keys. + * (x/auth) [\#6108](https://github.com/cosmos/cosmos-sdk/pull/6108) `tx sign` command's `--validate-signatures` flag is migrated into a `tx validate-signatures` standalone command. + * (x/auth) [#7788](https://github.com/cosmos/cosmos-sdk/pull/7788) Remove `tx auth` subcommands, all auth subcommands exist as `tx ` + * (x/genutil) [\#6651](https://github.com/cosmos/cosmos-sdk/pull/6651) The `gentx` command has been improved. No longer are `--from` and `--name` flags required. Instead, a single argument, `name`, is required which refers to the key pair in the Keyring. In addition, an optional `--moniker` flag can be provided to override the moniker found in `config.toml`. - * (x/upgrade) [#7697](https://github.com/cosmos/cosmos-sdk/pull/7697) Rename flag name "--time" to "--upgrade-time", "--info" to "--upgrade-info", to keep it consistent with help message. -* __REST / Queriers__ - * (api) [\#6426](https://github.com/cosmos/cosmos-sdk/pull/6426) The ability to start an out-of-process API REST server has now been removed. Instead, the API server is now started in-process along with the application and Tendermint. Configuration options have been added to `app.toml` to enable/disable the API server along with additional HTTP server options. - * (client) [\#7246](https://github.com/cosmos/cosmos-sdk/pull/7246) The rest server endpoint `/swagger-ui/` is replaced by `/swagger/`, and contains swagger documentation for gRPC Gateway routes in addition to legacy REST routes. Swagger API is exposed only if set in `app.toml`. - * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`. - * (x/bank) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) The `/bank/balances/{address}` endpoint now returns all account balances or a single balance by denom when the `denom` query parameter is present. - * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove CLI and REST handlers for querying `x/evidence` parameters. - * (x/gov) [#6295](https://github.com/cosmos/cosmos-sdk/pull/6295) Fix typo in querying governance params. -* __General__ - * (baseapp) [\#6384](https://github.com/cosmos/cosmos-sdk/pull/6384) The `Result.Data` is now a Protocol Buffer encoded binary blob of type `TxData`. The `TxData` contains `Data` which contains a list of Protocol Buffer encoded message data and the corresponding message type. - * (client) [\#5783](https://github.com/cosmos/cosmos-sdk/issues/5783) Unify all coins representations on JSON client requests for governance proposals. - * (crypto) [\#7419](https://github.com/cosmos/cosmos-sdk/pull/7419) The SDK doesn't use Tendermint's `crypto.PubKey` + * (x/upgrade) [#7697](https://github.com/cosmos/cosmos-sdk/pull/7697) Rename flag name "--time" to "--upgrade-time", "--info" to "--upgrade-info", to keep it consistent with help message. +* **REST / Queriers** + * (api) [\#6426](https://github.com/cosmos/cosmos-sdk/pull/6426) The ability to start an out-of-process API REST server has now been removed. Instead, the API server is now started in-process along with the application and Tendermint. Configuration options have been added to `app.toml` to enable/disable the API server along with additional HTTP server options. + * (client) [\#7246](https://github.com/cosmos/cosmos-sdk/pull/7246) The rest server endpoint `/swagger-ui/` is replaced by `/swagger/`, and contains swagger documentation for gRPC Gateway routes in addition to legacy REST routes. Swagger API is exposed only if set in `app.toml`. + * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) The `x/auth` querier route has changed from `"acc"` to `"auth"`. + * (x/bank) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) The `/bank/balances/{address}` endpoint now returns all account balances or a single balance by denom when the `denom` query parameter is present. + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove CLI and REST handlers for querying `x/evidence` parameters. + * (x/gov) [#6295](https://github.com/cosmos/cosmos-sdk/pull/6295) Fix typo in querying governance params. +* **General** + * (baseapp) [\#6384](https://github.com/cosmos/cosmos-sdk/pull/6384) The `Result.Data` is now a Protocol Buffer encoded binary blob of type `TxData`. The `TxData` contains `Data` which contains a list of Protocol Buffer encoded message data and the corresponding message type. + * (client) [\#5783](https://github.com/cosmos/cosmos-sdk/issues/5783) Unify all coins representations on JSON client requests for governance proposals. + * (crypto) [\#7419](https://github.com/cosmos/cosmos-sdk/pull/7419) The SDK doesn't use Tendermint's `crypto.PubKey` interface anymore, and uses instead it's own `PubKey` interface, defined in `crypto/types`. Replace all instances of `crypto.PubKey` by `cryptotypes.Pubkey`. - * (store/rootmulti) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) Proofs of empty stores are no longer supported. - * (store/types) [\#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes(). - * (x/auth) [\#6054](https://github.com/cosmos/cosmos-sdk/pull/6054) Remove custom JSON marshaling for base accounts as multsigs cannot be bech32 decoded. - * (x/auth/vesting) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) Custom JSON marshaling of vesting accounts was removed. Vesting accounts are now marshaled using their default proto or amino JSON representation. - * (x/bank) [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) In x/bank errors, JSON strings coerced to valid UTF-8 bytes at JSON marshalling time + * (store/rootmulti) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) Proofs of empty stores are no longer supported. + * (store/types) [\#5730](https://github.com/cosmos/cosmos-sdk/pull/5730) store.types.Cp() is removed in favour of types.CopyBytes(). + * (x/auth) [\#6054](https://github.com/cosmos/cosmos-sdk/pull/6054) Remove custom JSON marshaling for base accounts as multsigs cannot be bech32 decoded. + * (x/auth/vesting) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) Custom JSON marshaling of vesting accounts was removed. Vesting accounts are now marshaled using their default proto or amino JSON representation. + * (x/bank) [\#5785](https://github.com/cosmos/cosmos-sdk/issues/5785) In x/bank errors, JSON strings coerced to valid UTF-8 bytes at JSON marshalling time are now replaced by human-readable expressions. This change can potentially break compatibility with all those client side tools that parse log messages. - * (x/evidence) [\#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field for + * (x/evidence) [\#7538](https://github.com/cosmos/cosmos-sdk/pull/7538) The ABCI's `Result.Data` field for `MsgSubmitEvidence` responses does not contain the raw evidence's hash, but the protobuf encoded `MsgSubmitEvidenceResponse` struct. - * (x/gov) [\#7533](https://github.com/cosmos/cosmos-sdk/pull/7533) The ABCI's `Result.Data` field for + * (x/gov) [\#7533](https://github.com/cosmos/cosmos-sdk/pull/7533) The ABCI's `Result.Data` field for `MsgSubmitProposal` responses does not contain a raw binary encoding of the `proposalID`, but the protobuf encoded `MsgSubmitSubmitProposalResponse` struct. - * (x/gov) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) `ProposalStatus` and `VoteOption` are now JSON serialized using its protobuf name, so expect names like `PROPOSAL_STATUS_DEPOSIT_PERIOD` as opposed to `DepositPeriod`. - * (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead + * (x/gov) [\#6859](https://github.com/cosmos/cosmos-sdk/pull/6859) `ProposalStatus` and `VoteOption` are now JSON serialized using its protobuf name, so expect names like `PROPOSAL_STATUS_DEPOSIT_PERIOD` as opposed to `DepositPeriod`. + * (x/staking) [\#7499](https://github.com/cosmos/cosmos-sdk/pull/7499) `BondStatus` is now a protobuf `enum` instead of an `int32`, and JSON serialized using its protobuf name, so expect names like `BOND_STATUS_UNBONDING` as opposed to `Unbonding`. - * (x/staking) [\#7556](https://github.com/cosmos/cosmos-sdk/pull/7556) The ABCI's `Result.Data` field for + * (x/staking) [\#7556](https://github.com/cosmos/cosmos-sdk/pull/7556) The ABCI's `Result.Data` field for `MsgBeginRedelegate` and `MsgUndelegate` responses does not contain custom binary marshaled `completionTime`, but the protobuf encoded `MsgBeginRedelegateResponse` and `MsgUndelegateResponse` structs respectively ### API Breaking Changes -* __Baseapp / Client__ - * (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) [\#7584](https://github.com/cosmos/cosmos-sdk/pull/7584) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. - * (baseapp) [\#5865](https://github.com/cosmos/cosmos-sdk/pull/5865) The `SimulationResponse` returned from tx simulation is now JSON encoded instead of Amino binary. - * (client) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CLIContext` is renamed to `Context`. `Context` and all related methods have been moved from package context to client. - * (client) [\#6525](https://github.com/cosmos/cosmos-sdk/pull/6525) Removed support for `indent` in JSON responses. Clients should consider piping to an external tool such as `jq`. - * (client) [\#8107](https://github.com/cosmos/cosmos-sdk/pull/8107) Renamed `PrintOutput` and `PrintOutputLegacy` +* **Baseapp / Client** + * (AppModule) [\#7518](https://github.com/cosmos/cosmos-sdk/pull/7518) [\#7584](https://github.com/cosmos/cosmos-sdk/pull/7584) Rename `AppModule.RegisterQueryServices` to `AppModule.RegisterServices`, as this method now registers multiple services (the gRPC query service and the protobuf Msg service). A `Configurator` struct is used to hold the different services. + * (baseapp) [\#5865](https://github.com/cosmos/cosmos-sdk/pull/5865) The `SimulationResponse` returned from tx simulation is now JSON encoded instead of Amino binary. + * (client) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CLIContext` is renamed to `Context`. `Context` and all related methods have been moved from package context to client. + * (client) [\#6525](https://github.com/cosmos/cosmos-sdk/pull/6525) Removed support for `indent` in JSON responses. Clients should consider piping to an external tool such as `jq`. + * (client) [\#8107](https://github.com/cosmos/cosmos-sdk/pull/8107) Renamed `PrintOutput` and `PrintOutputLegacy` methods of the `context.Client` object to `PrintProto` and `PrintObjectLegacy`. - * (client/flags) [\#6632](https://github.com/cosmos/cosmos-sdk/pull/6632) Remove NewCompletionCmd(), the function is now available in tendermint. - * (client/input) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions. - * (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) Rename `NewKeyBaseFromDir()` -> `NewLegacyKeyBaseFromDir()`. - * (client/keys) [\#5820](https://github.com/cosmos/cosmos-sdk/pull/5820/) Removed method CloseDB from Keybase interface. - * (client/rpc) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `client` package and subdirs reorganization. - * (client/lcd) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CliCtx` of struct `RestServer` in package client/lcd has been renamed to `ClientCtx`. - * (codec) [\#6330](https://github.com/cosmos/cosmos-sdk/pull/6330) `codec.RegisterCrypto` has been moved to the `crypto/codec` package and the global `codec.Cdc` Amino instance has been deprecated and moved to the `codec/legacy_global` package. - * (codec) [\#8080](https://github.com/cosmos/cosmos-sdk/pull/8080) Updated the `codec.Marshaler` interface - * Moved `MarshalAny` and `UnmarshalAny` helper functions to `codec.Marshaler` and renamed to `MarshalInterface` and + * (client/flags) [\#6632](https://github.com/cosmos/cosmos-sdk/pull/6632) Remove NewCompletionCmd(), the function is now available in tendermint. + * (client/input) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) Removal of unnecessary `GetCheckPassword`, `PrintPrefixed` functions. + * (client/keys) [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) Rename `NewKeyBaseFromDir()` -> `NewLegacyKeyBaseFromDir()`. + * (client/keys) [\#5820](https://github.com/cosmos/cosmos-sdk/pull/5820/) Removed method CloseDB from Keybase interface. + * (client/rpc) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `client` package and subdirs reorganization. + * (client/lcd) [\#6290](https://github.com/cosmos/cosmos-sdk/pull/6290) `CliCtx` of struct `RestServer` in package client/lcd has been renamed to `ClientCtx`. + * (codec) [\#6330](https://github.com/cosmos/cosmos-sdk/pull/6330) `codec.RegisterCrypto` has been moved to the `crypto/codec` package and the global `codec.Cdc` Amino instance has been deprecated and moved to the `codec/legacy_global` package. + * (codec) [\#8080](https://github.com/cosmos/cosmos-sdk/pull/8080) Updated the `codec.Marshaler` interface + * Moved `MarshalAny` and `UnmarshalAny` helper functions to `codec.Marshaler` and renamed to `MarshalInterface` and `UnmarshalInterface` respectively. These functions must take interface as a parameter (not a concrete type nor `Any` object). Underneath they use `Any` wrapping for correct protobuf serialization. - * (crypto) [\#6780](https://github.com/cosmos/cosmos-sdk/issues/6780) Move ledger code to its own package. - * (crypto/types/multisig) [\#6373](https://github.com/cosmos/cosmos-sdk/pull/6373) `multisig.Multisignature` has been renamed to `AminoMultisignature` - * (codec) `*codec.LegacyAmino` is now a wrapper around Amino which provides backwards compatibility with protobuf `Any`. ALL legacy code should use `*codec.LegacyAmino` instead of `*amino.Codec` directly - * (crypto) [\#5880](https://github.com/cosmos/cosmos-sdk/pull/5880) Merge `crypto/keys/mintkey` into `crypto`. - * (crypto/hd) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `crypto/keys/hd` moved to `crypto/hd`. - * (crypto/keyring): - * [\#5866](https://github.com/cosmos/cosmos-sdk/pull/5866) Rename `crypto/keys/` to `crypto/keyring/`. - * [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `Keybase` -> `Keyring` interfaces migration. `LegacyKeybase` interface is added in order + * (crypto) [\#6780](https://github.com/cosmos/cosmos-sdk/issues/6780) Move ledger code to its own package. + * (crypto/types/multisig) [\#6373](https://github.com/cosmos/cosmos-sdk/pull/6373) `multisig.Multisignature` has been renamed to `AminoMultisignature` + * (codec) `*codec.LegacyAmino` is now a wrapper around Amino which provides backwards compatibility with protobuf `Any`. ALL legacy code should use `*codec.LegacyAmino` instead of `*amino.Codec` directly + * (crypto) [\#5880](https://github.com/cosmos/cosmos-sdk/pull/5880) Merge `crypto/keys/mintkey` into `crypto`. + * (crypto/hd) [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `crypto/keys/hd` moved to `crypto/hd`. + * (crypto/keyring): + * [\#5866](https://github.com/cosmos/cosmos-sdk/pull/5866) Rename `crypto/keys/` to `crypto/keyring/`. + * [\#5904](https://github.com/cosmos/cosmos-sdk/pull/5904) `Keybase` -> `Keyring` interfaces migration. `LegacyKeybase` interface is added in order to guarantee limited backward compatibility with the old Keybase interface for the sole purpose of migrating keys across the new keyring backends. `NewLegacy` constructor is provided [\#5889](https://github.com/cosmos/cosmos-sdk/pull/5889) to allow for smooth migration of keys from the legacy LevelDB based implementation to new keyring backends. Plus, the package and the new keyring no longer depends on the sdk.Config singleton. Please consult the [package documentation](https://github.com/cosmos/cosmos-sdk/tree/master/crypto/keyring/doc.go) for more information on how to implement the new `Keyring` interface. - * [\#5858](https://github.com/cosmos/cosmos-sdk/pull/5858) Make Keyring store keys by name and address's hexbytes representation. - * (export) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) `AppExporter` now returns ABCI consensus parameters to be included in marshaled exported state. These parameters must be returned from the application via the `BaseApp`. - * (simapp) Deprecating and renaming `MakeEncodingConfig` to `MakeTestEncodingConfig` (both in `simapp` and `simapp/params` packages). - * (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) The `store.CommitMultiStore` interface now includes the new `snapshots.Snapshotter` interface as well. - * (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The `keepRecent` field has been removed from the `PruningOptions` type. + * [\#5858](https://github.com/cosmos/cosmos-sdk/pull/5858) Make Keyring store keys by name and address's hexbytes representation. + * (export) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) `AppExporter` now returns ABCI consensus parameters to be included in marshaled exported state. These parameters must be returned from the application via the `BaseApp`. + * (simapp) Deprecating and renaming `MakeEncodingConfig` to `MakeTestEncodingConfig` (both in `simapp` and `simapp/params` packages). + * (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) The `store.CommitMultiStore` interface now includes the new `snapshots.Snapshotter` interface as well. + * (types) [\#5579](https://github.com/cosmos/cosmos-sdk/pull/5579) The `keepRecent` field has been removed from the `PruningOptions` type. The `PruningOptions` type now only includes fields `KeepEvery` and `SnapshotEvery`, where `KeepEvery` determines which committed heights are flushed to disk and `SnapshotEvery` determines which of these heights are kept after pruning. The `IsValid` method should be called whenever using these options. Methods `SnapshotVersion` and `FlushVersion` accept a version arugment and determine if the version should be flushed to disk or kept as a snapshot. Note, `KeepRecent` is automatically inferred from the options and provided directly the IAVL store. - * (types) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Refactored `AppModuleBasic` and `AppModuleGenesis` + * (types) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Refactored `AppModuleBasic` and `AppModuleGenesis` to now accept a `codec.JSONMarshaler` for modular serialization of genesis state. - * (types/rest) [\#5779](https://github.com/cosmos/cosmos-sdk/pull/5779) Drop unused Parse{Int64OrReturnBadRequest,QueryParamBool}() functions. -* __Modules__ - * (modules) [\#7243](https://github.com/cosmos/cosmos-sdk/pull/7243) Rename `RegisterCodec` to `RegisterLegacyAminoCodec` and `codec.New()` is now renamed to `codec.NewLegacyAmino()` - * (modules) [\#6564](https://github.com/cosmos/cosmos-sdk/pull/6564) Constant `DefaultParamspace` is removed from all modules, use ModuleName instead. - * (modules) [\#5989](https://github.com/cosmos/cosmos-sdk/pull/5989) `AppModuleBasic.GetTxCmd` now takes a single `CLIContext` parameter. - * (modules) [\#5664](https://github.com/cosmos/cosmos-sdk/pull/5664) Remove amino `Codec` from simulation `StoreDecoder`, which now returns a function closure in order to unmarshal the key-value pairs. - * (modules) [\#5555](https://github.com/cosmos/cosmos-sdk/pull/5555) Move `x/auth/client/utils/` types and functions to `x/auth/client/`. - * (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Move account balance logic and APIs from `x/auth` to `x/bank`. - * (modules) [\#6326](https://github.com/cosmos/cosmos-sdk/pull/6326) `AppModuleBasic.GetQueryCmd` now takes a single `client.Context` parameter. - * (modules) [\#6336](https://github.com/cosmos/cosmos-sdk/pull/6336) `AppModuleBasic.RegisterQueryService` method was added to support gRPC queries, and `QuerierRoute` and `NewQuerierHandler` were deprecated. - * (modules) [\#6311](https://github.com/cosmos/cosmos-sdk/issues/6311) Remove `alias.go` usage - * (modules) [\#6447](https://github.com/cosmos/cosmos-sdk/issues/6447) Rename `blacklistedAddrs` to `blockedAddrs`. - * (modules) [\#6834](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `RegisterInterfaces` method to `AppModuleBasic` to support registration of protobuf interface types. - * (modules) [\#6734](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `TxEncodingConfig` parameter to `AppModuleBasic.ValidateGenesis` command to support JSON tx decoding in `genutil`. - * (modules) [#7764](https://github.com/cosmos/cosmos-sdk/pull/7764) Added module initialization options: - * `server/types.AppExporter` requires extra argument: `AppOptions`. - * `server.AddCommands` requires extra argument: `addStartFlags types.ModuleInitFlags` - * `x/crisis.NewAppModule` has a new attribute: `skipGenesisInvariants`. [PR](https://github.com/cosmos/cosmos-sdk/pull/7764) - * (types) [\#6327](https://github.com/cosmos/cosmos-sdk/pull/6327) `sdk.Msg` now inherits `proto.Message`, as a result all `sdk.Msg` types now use pointer semantics. - * (types) [\#7032](https://github.com/cosmos/cosmos-sdk/pull/7032) All types ending with `ID` (e.g. `ProposalID`) now end with `Id` (e.g. `ProposalId`), to match default Protobuf generated format. Also see [\#7033](https://github.com/cosmos/cosmos-sdk/pull/7033) for more details. - * (x/auth) [\#6029](https://github.com/cosmos/cosmos-sdk/pull/6029) Module accounts have been moved from `x/supply` to `x/auth`. - * (x/auth) [\#6443](https://github.com/cosmos/cosmos-sdk/issues/6443) Move `FeeTx` and `TxWithMemo` interfaces from `x/auth/ante` to `types`. - * (x/auth) [\#7006](https://github.com/cosmos/cosmos-sdk/pull/7006) All `AccountRetriever` methods now take `client.Context` as a parameter instead of as a struct member. - * (x/auth) [\#6270](https://github.com/cosmos/cosmos-sdk/pull/6270) The passphrase argument has been removed from the signature of the following functions and methods: `BuildAndSign`, ` MakeSignature`, ` SignStdTx`, `TxBuilder.BuildAndSign`, `TxBuilder.Sign`, `TxBuilder.SignStdTx` - * (x/auth) [\#6428](https://github.com/cosmos/cosmos-sdk/issues/6428): - * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. - * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. - * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. - * (x/auth/tx) [\#8106](https://github.com/cosmos/cosmos-sdk/pull/8106) change related to missing append functionality in + * (types/rest) [\#5779](https://github.com/cosmos/cosmos-sdk/pull/5779) Drop unused Parse{Int64OrReturnBadRequest,QueryParamBool}() functions. +* **Modules** + * (modules) [\#7243](https://github.com/cosmos/cosmos-sdk/pull/7243) Rename `RegisterCodec` to `RegisterLegacyAminoCodec` and `codec.New()` is now renamed to `codec.NewLegacyAmino()` + * (modules) [\#6564](https://github.com/cosmos/cosmos-sdk/pull/6564) Constant `DefaultParamspace` is removed from all modules, use ModuleName instead. + * (modules) [\#5989](https://github.com/cosmos/cosmos-sdk/pull/5989) `AppModuleBasic.GetTxCmd` now takes a single `CLIContext` parameter. + * (modules) [\#5664](https://github.com/cosmos/cosmos-sdk/pull/5664) Remove amino `Codec` from simulation `StoreDecoder`, which now returns a function closure in order to unmarshal the key-value pairs. + * (modules) [\#5555](https://github.com/cosmos/cosmos-sdk/pull/5555) Move `x/auth/client/utils/` types and functions to `x/auth/client/`. + * (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Move account balance logic and APIs from `x/auth` to `x/bank`. + * (modules) [\#6326](https://github.com/cosmos/cosmos-sdk/pull/6326) `AppModuleBasic.GetQueryCmd` now takes a single `client.Context` parameter. + * (modules) [\#6336](https://github.com/cosmos/cosmos-sdk/pull/6336) `AppModuleBasic.RegisterQueryService` method was added to support gRPC queries, and `QuerierRoute` and `NewQuerierHandler` were deprecated. + * (modules) [\#6311](https://github.com/cosmos/cosmos-sdk/issues/6311) Remove `alias.go` usage + * (modules) [\#6447](https://github.com/cosmos/cosmos-sdk/issues/6447) Rename `blacklistedAddrs` to `blockedAddrs`. + * (modules) [\#6834](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `RegisterInterfaces` method to `AppModuleBasic` to support registration of protobuf interface types. + * (modules) [\#6734](https://github.com/cosmos/cosmos-sdk/issues/6834) Add `TxEncodingConfig` parameter to `AppModuleBasic.ValidateGenesis` command to support JSON tx decoding in `genutil`. + * (modules) [#7764](https://github.com/cosmos/cosmos-sdk/pull/7764) Added module initialization options: + * `server/types.AppExporter` requires extra argument: `AppOptions`. + * `server.AddCommands` requires extra argument: `addStartFlags types.ModuleInitFlags` + * `x/crisis.NewAppModule` has a new attribute: `skipGenesisInvariants`. [PR](https://github.com/cosmos/cosmos-sdk/pull/7764) + * (types) [\#6327](https://github.com/cosmos/cosmos-sdk/pull/6327) `sdk.Msg` now inherits `proto.Message`, as a result all `sdk.Msg` types now use pointer semantics. + * (types) [\#7032](https://github.com/cosmos/cosmos-sdk/pull/7032) All types ending with `ID` (e.g. `ProposalID`) now end with `Id` (e.g. `ProposalId`), to match default Protobuf generated format. Also see [\#7033](https://github.com/cosmos/cosmos-sdk/pull/7033) for more details. + * (x/auth) [\#6029](https://github.com/cosmos/cosmos-sdk/pull/6029) Module accounts have been moved from `x/supply` to `x/auth`. + * (x/auth) [\#6443](https://github.com/cosmos/cosmos-sdk/issues/6443) Move `FeeTx` and `TxWithMemo` interfaces from `x/auth/ante` to `types`. + * (x/auth) [\#7006](https://github.com/cosmos/cosmos-sdk/pull/7006) All `AccountRetriever` methods now take `client.Context` as a parameter instead of as a struct member. + * (x/auth) [\#6270](https://github.com/cosmos/cosmos-sdk/pull/6270) The passphrase argument has been removed from the signature of the following functions and methods: `BuildAndSign`, ` MakeSignature`, ` SignStdTx`, `TxBuilder.BuildAndSign`, `TxBuilder.Sign`, `TxBuilder.SignStdTx` + * (x/auth) [\#6428](https://github.com/cosmos/cosmos-sdk/issues/6428): + * `NewAnteHandler` and `NewSigVerificationDecorator` both now take a `SignModeHandler` parameter. + * `SignatureVerificationGasConsumer` now has the signature: `func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error`. + * The `SigVerifiableTx` interface now has a `GetSignaturesV2() ([]signing.SignatureV2, error)` method and no longer has the `GetSignBytes` method. + * (x/auth/tx) [\#8106](https://github.com/cosmos/cosmos-sdk/pull/8106) change related to missing append functionality in client transaction signing - + added `overwriteSig` argument to `x/auth/client.SignTx` and `client/tx.Sign` functions. - + removed `x/auth/tx.go:wrapper.GetSignatures`. The `wrapper` provides `TxBuilder` functionality, and it's a private + * added `overwriteSig` argument to `x/auth/client.SignTx` and `client/tx.Sign` functions. + * removed `x/auth/tx.go:wrapper.GetSignatures`. The `wrapper` provides `TxBuilder` functionality, and it's a private structure. That function was not used at all and it's not exposed through the `TxBuilder` interface. - * (x/bank) [\#7327](https://github.com/cosmos/cosmos-sdk/pull/7327) AddCoins and SubtractCoins no longer return a resultingValue and will only return an error. - * (x/capability) [#7918](https://github.com/cosmos/cosmos-sdk/pull/7918) Add x/capability safety checks: - * All outward facing APIs will now check that capability is not nil and name is not empty before performing any state-machine changes - * `SetIndex` has been renamed to `InitializeIndex` - * (x/evidence) [\#7251](https://github.com/cosmos/cosmos-sdk/pull/7251) New evidence types and light client evidence handling. The module function names changed. - * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove APIs for getting and setting `x/evidence` parameters. `BaseApp` now uses a `ParamStore` to manage Tendermint consensus parameters which is managed via the `x/params` `Substore` type. - * (x/gov) [\#6147](https://github.com/cosmos/cosmos-sdk/pull/6147) The `Content` field on `Proposal` and `MsgSubmitProposal` + * (x/bank) [\#7327](https://github.com/cosmos/cosmos-sdk/pull/7327) AddCoins and SubtractCoins no longer return a resultingValue and will only return an error. + * (x/capability) [#7918](https://github.com/cosmos/cosmos-sdk/pull/7918) Add x/capability safety checks: + * All outward facing APIs will now check that capability is not nil and name is not empty before performing any state-machine changes + * `SetIndex` has been renamed to `InitializeIndex` + * (x/evidence) [\#7251](https://github.com/cosmos/cosmos-sdk/pull/7251) New evidence types and light client evidence handling. The module function names changed. + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove APIs for getting and setting `x/evidence` parameters. `BaseApp` now uses a `ParamStore` to manage Tendermint consensus parameters which is managed via the `x/params` `Substore` type. + * (x/gov) [\#6147](https://github.com/cosmos/cosmos-sdk/pull/6147) The `Content` field on `Proposal` and `MsgSubmitProposal` is now `Any` in concordance with [ADR 019](docs/architecture/adr-019-protobuf-state-encoding.md) and `GetContent` should now be used to retrieve the actual proposal `Content`. Also the `NewMsgSubmitProposal` constructor now may return an `error` - * (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) `VerifyMembership` and `VerifyNonMembership` now take a `specs []string` argument to specify the proof format used for verification. Most SDK chains can simply use `commitmenttypes.GetSDKSpecs()` for this argument. - * (x/params) [\#5619](https://github.com/cosmos/cosmos-sdk/pull/5619) The `x/params` keeper now accepts a `codec.Marshaller` instead of + * (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) `VerifyMembership` and `VerifyNonMembership` now take a `specs []string` argument to specify the proof format used for verification. Most SDK chains can simply use `commitmenttypes.GetSDKSpecs()` for this argument. + * (x/params) [\#5619](https://github.com/cosmos/cosmos-sdk/pull/5619) The `x/params` keeper now accepts a `codec.Marshaller` instead of a reference to an amino codec. Amino is still used for JSON serialization. - * (x/staking) [\#6451](https://github.com/cosmos/cosmos-sdk/pull/6451) `DefaultParamspace` and `ParamKeyTable` in staking module are moved from keeper to types to enforce consistency. - * (x/staking) [\#7419](https://github.com/cosmos/cosmos-sdk/pull/7419) The `TmConsPubKey` method on ValidatorI has been + * (x/staking) [\#6451](https://github.com/cosmos/cosmos-sdk/pull/6451) `DefaultParamspace` and `ParamKeyTable` in staking module are moved from keeper to types to enforce consistency. + * (x/staking) [\#7419](https://github.com/cosmos/cosmos-sdk/pull/7419) The `TmConsPubKey` method on ValidatorI has been removed and replaced instead by `ConsPubKey` (which returns a SDK `cryptotypes.PubKey`) and `TmConsPublicKey` (which returns a Tendermint proto PublicKey). - * (x/staking/types) [\#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support: - * `ValidatorI` interface update. `GetConsPubKey` renamed to `TmConsPubKey` (consensus public key must be a tendermint key). `TmConsPubKey`, `GetConsAddr` methods return error. - * `Validator` update. Methods changed in `ValidatorI` (as described above) and `ToTmValidator` return error. - * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. - * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. - * (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) All `x/supply` types and APIs have been moved to `x/bank`. - * [\#6409](https://github.com/cosmos/cosmos-sdk/pull/6409) Rename all IsEmpty methods to Empty across the codebase and enforce consistency. - * [\#6231](https://github.com/cosmos/cosmos-sdk/pull/6231) Simplify `AppModule` interface, `Route` and `NewHandler` methods become only `Route` + * (x/staking/types) [\#7447](https://github.com/cosmos/cosmos-sdk/issues/7447) Remove bech32 PubKey support: + * `ValidatorI` interface update. `GetConsPubKey` renamed to `TmConsPubKey` (consensus public key must be a tendermint key). `TmConsPubKey`, `GetConsAddr` methods return error. + * `Validator` update. Methods changed in `ValidatorI` (as described above) and `ToTmValidator` return error. + * `Validator.ConsensusPubkey` type changed from `string` to `codectypes.Any`. + * `MsgCreateValidator.Pubkey` type changed from `string` to `codectypes.Any`. + * (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) All `x/supply` types and APIs have been moved to `x/bank`. + * [\#6409](https://github.com/cosmos/cosmos-sdk/pull/6409) Rename all IsEmpty methods to Empty across the codebase and enforce consistency. + * [\#6231](https://github.com/cosmos/cosmos-sdk/pull/6231) Simplify `AppModule` interface, `Route` and `NewHandler` methods become only `Route` and returns a new `Route` type. - * (x/slashing) [\#6212](https://github.com/cosmos/cosmos-sdk/pull/6212) Remove `Get*` prefixes from key construction functions - * (server) [\#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28). - * [\#5719](https://github.com/cosmos/cosmos-sdk/pull/5719) Bump Go requirement to 1.14+ + * (x/slashing) [\#6212](https://github.com/cosmos/cosmos-sdk/pull/6212) Remove `Get*` prefixes from key construction functions + * (server) [\#6079](https://github.com/cosmos/cosmos-sdk/pull/6079) Remove `UpgradeOldPrivValFile` (deprecated in Tendermint Core v0.28). + * [\#5719](https://github.com/cosmos/cosmos-sdk/pull/5719) Bump Go requirement to 1.14+ ### State Machine Breaking -* __General__ - * (client) [\#7268](https://github.com/cosmos/cosmos-sdk/pull/7268) / [\#7147](https://github.com/cosmos/cosmos-sdk/pull/7147) Introduce new protobuf based PubKeys, and migrate PubKey in BaseAccount to use this new protobuf based PubKey format +* **General** + * (client) [\#7268](https://github.com/cosmos/cosmos-sdk/pull/7268) / [\#7147](https://github.com/cosmos/cosmos-sdk/pull/7147) Introduce new protobuf based PubKeys, and migrate PubKey in BaseAccount to use this new protobuf based PubKey format -* __Modules__ - * (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Separate balance from accounts per ADR 004. - * Account balances are now persisted and retrieved via the `x/bank` module. - * Vesting account interface has been modified to account for changes. - * Callers to `NewBaseVestingAccount` are responsible for verifying account balance in relation to +* **Modules** + * (modules) [\#5572](https://github.com/cosmos/cosmos-sdk/pull/5572) Separate balance from accounts per ADR 004. + * Account balances are now persisted and retrieved via the `x/bank` module. + * Vesting account interface has been modified to account for changes. + * Callers to `NewBaseVestingAccount` are responsible for verifying account balance in relation to the original vesting amount. - * The `SendKeeper` and `ViewKeeper` interfaces in `x/bank` have been modified to account for changes. - * (x/auth) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/auth` module to use Protocol Buffers for state + * The `SendKeeper` and `ViewKeeper` interfaces in `x/bank` have been modified to account for changes. + * (x/auth) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/auth` module to use Protocol Buffers for state serialization instead of Amino. - * The `BaseAccount.PubKey` field is now represented as a Bech32 string instead of a `crypto.Pubkey`. - * `NewBaseAccountWithAddress` now returns a reference to a `BaseAccount`. - * The `x/auth` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + * The `BaseAccount.PubKey` field is now represented as a Bech32 string instead of a `crypto.Pubkey`. + * `NewBaseAccountWithAddress` now returns a reference to a `BaseAccount`. + * The `x/auth` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by requiring a concrete codec to know how to serialize accounts. - * The `AccountRetriever` type now accepts a `Codec` in its constructor in order to know how to + * The `AccountRetriever` type now accepts a `Codec` in its constructor in order to know how to serialize accounts. - * (x/bank) [\#6518](https://github.com/cosmos/cosmos-sdk/pull/6518) Support for global and per-denomination send enabled flags. - * Existing send_enabled global flag has been moved into a Params structure as `default_send_enabled`. - * An array of: `{denom: string, enabled: bool}` is added to bank Params to support per-denomination override of global default value. - * (x/distribution) [\#5610](https://github.com/cosmos/cosmos-sdk/pull/5610) Migrate the `x/distribution` module to use Protocol Buffers for state + * (x/bank) [\#6518](https://github.com/cosmos/cosmos-sdk/pull/6518) Support for global and per-denomination send enabled flags. + * Existing send_enabled global flag has been moved into a Params structure as `default_send_enabled`. + * An array of: `{denom: string, enabled: bool}` is added to bank Params to support per-denomination override of global default value. + * (x/distribution) [\#5610](https://github.com/cosmos/cosmos-sdk/pull/5610) Migrate the `x/distribution` module to use Protocol Buffers for state serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino for JSON encoding. - * `ValidatorHistoricalRewards.ReferenceCount` is now of types `uint32` instead of `uint16`. - * `ValidatorSlashEvents` is now a struct with `slashevents`. - * `ValidatorOutstandingRewards` is now a struct with `rewards`. - * `ValidatorAccumulatedCommission` is now a struct with `commission`. - * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type + * `ValidatorHistoricalRewards.ReferenceCount` is now of types `uint32` instead of `uint16`. + * `ValidatorSlashEvents` is now a struct with `slashevents`. + * `ValidatorOutstandingRewards` is now a struct with `rewards`. + * `ValidatorAccumulatedCommission` is now a struct with `commission`. + * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type provided is specified by `ModuleCdc`. - * (x/evidence) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/evidence` module to use Protocol Buffers for state + * (x/evidence) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/evidence` module to use Protocol Buffers for state serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + * The `internal` sub-package has been removed in order to expose the types proto file. + * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by requiring a concrete codec to know how to serialize `Evidence` types. - * The `MsgSubmitEvidence` message has been removed in favor of `MsgSubmitEvidenceBase`. The application-level + * The `MsgSubmitEvidence` message has been removed in favor of `MsgSubmitEvidenceBase`. The application-level codec must now define the concrete `MsgSubmitEvidence` type which must implement the module's `MsgSubmitEvidence` interface. - * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove parameters from `x/evidence` genesis and module state. The `x/evidence` module now solely uses Tendermint consensus parameters to determine of evidence is valid or not. - * (x/gov) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Remove parameters from `x/evidence` genesis and module state. The `x/evidence` module now solely uses Tendermint consensus parameters to determine of evidence is valid or not. + * (x/gov) [\#5737](https://github.com/cosmos/cosmos-sdk/pull/5737) Migrate the `x/gov` module to use Protocol Buffers for state serialization instead of Amino. - * `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which + * `MsgSubmitProposal` will be removed in favor of the application-level proto-defined `MsgSubmitProposal` which implements the `MsgSubmitProposalI` interface. Applications should extend the `NewMsgSubmitProposalBase` type to define their own concrete `MsgSubmitProposal` types. - * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + * The module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by requiring a concrete codec to know how to serialize `Proposal` types. - * (x/mint) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/mint` module to use Protocol Buffers for state + * (x/mint) [\#5634](https://github.com/cosmos/cosmos-sdk/pull/5634) Migrate the `x/mint` module to use Protocol Buffers for state serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * (x/slashing) [\#5627](https://github.com/cosmos/cosmos-sdk/pull/5627) Migrate the `x/slashing` module to use Protocol Buffers for state + * The `internal` sub-package has been removed in order to expose the types proto file. + * (x/slashing) [\#5627](https://github.com/cosmos/cosmos-sdk/pull/5627) Migrate the `x/slashing` module to use Protocol Buffers for state serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino for JSON encoding. - * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type + * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type provided is specified by `ModuleCdc`. - * (x/staking) [\#6844](https://github.com/cosmos/cosmos-sdk/pull/6844) Validators are now inserted into the unbonding queue based on their unbonding time and height. The relevant keeper APIs are modified to reflect these changes by now also requiring a height. - * (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to + * (x/staking) [\#6844](https://github.com/cosmos/cosmos-sdk/pull/6844) Validators are now inserted into the unbonding queue based on their unbonding time and height. The relevant keeper APIs are modified to reflect these changes by now also requiring a height. + * (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. - * (x/staking) [\#5600](https://github.com/cosmos/cosmos-sdk/pull/5600) Migrate the `x/staking` module to use Protocol Buffers for state + * (x/staking) [\#5600](https://github.com/cosmos/cosmos-sdk/pull/5600) Migrate the `x/staking` module to use Protocol Buffers for state serialization instead of Amino. The exact codec used is `codec.HybridCodec` which utilizes Protobuf for binary encoding and Amino for JSON encoding. - * `BondStatus` is now of type `int32` instead of `byte`. - * Types of `int16` in the `Params` type are now of type `int32`. - * Every reference of `crypto.Pubkey` in context of a `Validator` is now of type string. `GetPubKeyFromBech32` must be used to get the `crypto.Pubkey`. - * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type + * `BondStatus` is now of type `int32` instead of `byte`. + * Types of `int16` in the `Params` type are now of type `int32`. + * Every reference of `crypto.Pubkey` in context of a `Validator` is now of type string. `GetPubKeyFromBech32` must be used to get the `crypto.Pubkey`. + * The `Keeper` constructor now takes a `codec.Marshaler` instead of a concrete Amino codec. This exact type provided is specified by `ModuleCdc`. - * (x/staking) [\#7979](https://github.com/cosmos/cosmos-sdk/pull/7979) keeper pubkey storage serialization migration + * (x/staking) [\#7979](https://github.com/cosmos/cosmos-sdk/pull/7979) keeper pubkey storage serialization migration from bech32 to protobuf. - * (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) Removed the `x/supply` module by merging the existing types and APIs into the `x/bank` module. - * (x/supply) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/supply` module to use Protocol Buffers for state + * (x/supply) [\#6010](https://github.com/cosmos/cosmos-sdk/pull/6010) Removed the `x/supply` module by merging the existing types and APIs into the `x/bank` module. + * (x/supply) [\#5533](https://github.com/cosmos/cosmos-sdk/pull/5533) Migrate the `x/supply` module to use Protocol Buffers for state serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * The `x/supply` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by + * The `internal` sub-package has been removed in order to expose the types proto file. + * The `x/supply` module now accepts a `Codec` interface which extends the `codec.Marshaler` interface by requiring a concrete codec to know how to serialize `SupplyI` types. - * The `SupplyI` interface has been modified to no longer return `SupplyI` on methods. Instead the + * The `SupplyI` interface has been modified to no longer return `SupplyI` on methods. Instead the concrete type's receiver should modify the type. - * (x/upgrade) [\#5659](https://github.com/cosmos/cosmos-sdk/pull/5659) Migrate the `x/upgrade` module to use Protocol + * (x/upgrade) [\#5659](https://github.com/cosmos/cosmos-sdk/pull/5659) Migrate the `x/upgrade` module to use Protocol Buffers for state serialization instead of Amino. - * The `internal` sub-package has been removed in order to expose the types proto file. - * The `x/upgrade` module now accepts a `codec.Marshaler` interface. + * The `internal` sub-package has been removed in order to expose the types proto file. + * The `x/upgrade` module now accepts a `codec.Marshaler` interface. ### Features -* __Baseapp / Client / REST__ - * (x/auth) [\#6213](https://github.com/cosmos/cosmos-sdk/issues/6213) Introduce new protobuf based path for transaction signing, see [ADR020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) for more details - * (x/auth) [\#6350](https://github.com/cosmos/cosmos-sdk/pull/6350) New sign-batch command to sign StdTx batch files. - * (baseapp) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added support for taking state snapshots at regular height intervals, via options `snapshot-interval` and `snapshot-keep-recent`. - * (baseapp) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) Add `ServiceMsgRouter` to BaseApp to handle routing of protobuf service `Msg`s. The two new types defined in ADR 031, `sdk.ServiceMsg` and `sdk.MsgRequest` are introduced with this router. - * (client) [\#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduce new gRPC and gRPC Gateway based APIs for querying app & module data. See [ADR021](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md) for more details - * (cli) [\#7485](https://github.com/cosmos/cosmos-sdk/pull/7485) Introduce a new optional `--keyring-dir` flag that allows clients to specify a Keyring directory if it does not reside in the directory specified by `--home`. - * (cli) [\#7221](https://github.com/cosmos/cosmos-sdk/pull/7221) Add the option of emitting amino encoded json from the CLI - * (codec) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) `InterfaceRegistry` now inherits `jsonpb.AnyResolver`, and has a `RegisterCustomTypeURL` method to support ADR 031 packing of `Any`s. `AnyResolver` is now a required parameter to `RejectUnknownFields`. - * (coin) [\#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) Add custom regex validation for `Coin` denom by overwriting `CoinDenomRegex` when using `/types/coin.go`. - * (config) [\#7265](https://github.com/cosmos/cosmos-sdk/pull/7265) Support Tendermint block pruning through a new `min-retain-blocks` configuration that can be set in either `app.toml` or via the CLI. This parameter is used in conjunction with other criteria to determine the height at which Tendermint should prune blocks. - * (events) [\#7121](https://github.com/cosmos/cosmos-sdk/pull/7121) The application now derives what events are indexed by Tendermint via the `index-events` configuration in `app.toml`, which is a list of events taking the form `{eventType}.{attributeKey}`. - * (tx) [\#6089](https://github.com/cosmos/cosmos-sdk/pull/6089) Transactions can now have a `TimeoutHeight` set which allows the transaction to be rejected if it's committed at a height greater than the timeout. - * (rest) [\#6167](https://github.com/cosmos/cosmos-sdk/pull/6167) Support `max-body-bytes` CLI flag for the REST service. - * (genesis) [\#7089](https://github.com/cosmos/cosmos-sdk/pull/7089) The `export` command now adds a `initial_height` field in the exported JSON. Baseapp's `CommitMultiStore` now also has a `SetInitialVersion` setter, so it can set the initial store version inside `InitChain` and start a new chain from a given height. -* __General__ - * (crypto/multisig) [\#6241](https://github.com/cosmos/cosmos-sdk/pull/6241) Add Multisig type directly to the repo. Previously this was in tendermint. - * (codec/types) [\#8106](https://github.com/cosmos/cosmos-sdk/pull/8106) Adding `NewAnyWithCustomTypeURL` to correctly +* **Baseapp / Client / REST** + * (x/auth) [\#6213](https://github.com/cosmos/cosmos-sdk/issues/6213) Introduce new protobuf based path for transaction signing, see [ADR020](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-020-protobuf-transaction-encoding.md) for more details + * (x/auth) [\#6350](https://github.com/cosmos/cosmos-sdk/pull/6350) New sign-batch command to sign StdTx batch files. + * (baseapp) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added support for taking state snapshots at regular height intervals, via options `snapshot-interval` and `snapshot-keep-recent`. + * (baseapp) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) Add `ServiceMsgRouter` to BaseApp to handle routing of protobuf service `Msg`s. The two new types defined in ADR 031, `sdk.ServiceMsg` and `sdk.MsgRequest` are introduced with this router. + * (client) [\#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduce new gRPC and gRPC Gateway based APIs for querying app & module data. See [ADR021](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-021-protobuf-query-encoding.md) for more details + * (cli) [\#7485](https://github.com/cosmos/cosmos-sdk/pull/7485) Introduce a new optional `--keyring-dir` flag that allows clients to specify a Keyring directory if it does not reside in the directory specified by `--home`. + * (cli) [\#7221](https://github.com/cosmos/cosmos-sdk/pull/7221) Add the option of emitting amino encoded json from the CLI + * (codec) [\#7519](https://github.com/cosmos/cosmos-sdk/pull/7519) `InterfaceRegistry` now inherits `jsonpb.AnyResolver`, and has a `RegisterCustomTypeURL` method to support ADR 031 packing of `Any`s. `AnyResolver` is now a required parameter to `RejectUnknownFields`. + * (coin) [\#6755](https://github.com/cosmos/cosmos-sdk/pull/6755) Add custom regex validation for `Coin` denom by overwriting `CoinDenomRegex` when using `/types/coin.go`. + * (config) [\#7265](https://github.com/cosmos/cosmos-sdk/pull/7265) Support Tendermint block pruning through a new `min-retain-blocks` configuration that can be set in either `app.toml` or via the CLI. This parameter is used in conjunction with other criteria to determine the height at which Tendermint should prune blocks. + * (events) [\#7121](https://github.com/cosmos/cosmos-sdk/pull/7121) The application now derives what events are indexed by Tendermint via the `index-events` configuration in `app.toml`, which is a list of events taking the form `{eventType}.{attributeKey}`. + * (tx) [\#6089](https://github.com/cosmos/cosmos-sdk/pull/6089) Transactions can now have a `TimeoutHeight` set which allows the transaction to be rejected if it's committed at a height greater than the timeout. + * (rest) [\#6167](https://github.com/cosmos/cosmos-sdk/pull/6167) Support `max-body-bytes` CLI flag for the REST service. + * (genesis) [\#7089](https://github.com/cosmos/cosmos-sdk/pull/7089) The `export` command now adds a `initial_height` field in the exported JSON. Baseapp's `CommitMultiStore` now also has a `SetInitialVersion` setter, so it can set the initial store version inside `InitChain` and start a new chain from a given height. +* **General** + * (crypto/multisig) [\#6241](https://github.com/cosmos/cosmos-sdk/pull/6241) Add Multisig type directly to the repo. Previously this was in tendermint. + * (codec/types) [\#8106](https://github.com/cosmos/cosmos-sdk/pull/8106) Adding `NewAnyWithCustomTypeURL` to correctly marshal Messages in TxBuilder. - * (tests) [\#6489](https://github.com/cosmos/cosmos-sdk/pull/6489) Introduce package `testutil`, new in-process testing network framework for use in integration and unit tests. - * (tx) Add new auth/tx gRPC & gRPC-Gateway endpoints for basic querying & broadcasting support - * [\#7842](https://github.com/cosmos/cosmos-sdk/pull/7842) Add TxsByEvent gRPC endpoint - * [\#7852](https://github.com/cosmos/cosmos-sdk/pull/7852) Add tx broadcast gRPC endpoint - * (tx) [\#7688](https://github.com/cosmos/cosmos-sdk/pull/7688) Add a new Tx gRPC service with methods `Simulate` and `GetTx` (by hash). - * (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added `rootmulti.Store` methods for taking and restoring snapshots, based on `iavl.Store` export/import. - * (store) [\#6324](https://github.com/cosmos/cosmos-sdk/pull/6324) IAVL store query proofs now return CommitmentOp which wraps an ics23 CommitmentProof - * (store) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) `RootMulti` store query proofs now return `CommitmentOp` which wraps `CommitmentProofs` - * `store.Query` now only returns chained `ics23.CommitmentProof` wrapped in `merkle.Proof` - * `ProofRuntime` only decodes and verifies `ics23.CommitmentProof` -* __Modules__ - * (modules) [\#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduction of Query gRPC service definitions along with REST annotations for gRPC Gateway for each module - * (modules) [\#7540](https://github.com/cosmos/cosmos-sdk/issues/7540) Protobuf service definitions can now be used for + * (tests) [\#6489](https://github.com/cosmos/cosmos-sdk/pull/6489) Introduce package `testutil`, new in-process testing network framework for use in integration and unit tests. + * (tx) Add new auth/tx gRPC & gRPC-Gateway endpoints for basic querying & broadcasting support + * [\#7842](https://github.com/cosmos/cosmos-sdk/pull/7842) Add TxsByEvent gRPC endpoint + * [\#7852](https://github.com/cosmos/cosmos-sdk/pull/7852) Add tx broadcast gRPC endpoint + * (tx) [\#7688](https://github.com/cosmos/cosmos-sdk/pull/7688) Add a new Tx gRPC service with methods `Simulate` and `GetTx` (by hash). + * (store) [\#5803](https://github.com/cosmos/cosmos-sdk/pull/5803) Added `rootmulti.Store` methods for taking and restoring snapshots, based on `iavl.Store` export/import. + * (store) [\#6324](https://github.com/cosmos/cosmos-sdk/pull/6324) IAVL store query proofs now return CommitmentOp which wraps an ics23 CommitmentProof + * (store) [\#6390](https://github.com/cosmos/cosmos-sdk/pull/6390) `RootMulti` store query proofs now return `CommitmentOp` which wraps `CommitmentProofs` + * `store.Query` now only returns chained `ics23.CommitmentProof` wrapped in `merkle.Proof` + * `ProofRuntime` only decodes and verifies `ics23.CommitmentProof` +* **Modules** + * (modules) [\#5921](https://github.com/cosmos/cosmos-sdk/issues/5921) Introduction of Query gRPC service definitions along with REST annotations for gRPC Gateway for each module + * (modules) [\#7540](https://github.com/cosmos/cosmos-sdk/issues/7540) Protobuf service definitions can now be used for packing `Msg`s in transactions as defined in [ADR 031](./docs/architecture/adr-031-msg-service.md). All modules now define a `Msg` protobuf service. - * (x/auth/vesting) [\#7209](https://github.com/cosmos/cosmos-sdk/pull/7209) Create new `MsgCreateVestingAccount` message type along with CLI handler that allows for the creation of delayed and continuous vesting types. - * (x/capability) [\#5828](https://github.com/cosmos/cosmos-sdk/pull/5828) Capability module integration as outlined in [ADR 3 - Dynamic Capability Store](https://github.com/cosmos/tree/master/docs/architecture/adr-003-dynamic-capability-store.md). - * (x/crisis) `x/crisis` has a new function: `AddModuleInitFlags`, which will register optional crisis module flags for the start command. - * (x/ibc) [\#5277](https://github.com/cosmos/cosmos-sdk/pull/5277) `x/ibc` changes from IBC alpha. For more details check the the [`x/ibc/core/spec`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc/core/spec) directory, or the ICS specs below: - * [ICS 002 - Client Semantics](https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics) subpackage - * [ICS 003 - Connection Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-003-connection-semantics) subpackage - * [ICS 004 - Channel and Packet Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-004-channel-and-packet-semantics) subpackage - * [ICS 005 - Port Allocation](https://github.com/cosmos/ics/blob/master/spec/ics-005-port-allocation) subpackage - * [ICS 006 - Solo Machine Client](https://github.com/cosmos/ics/tree/master/spec/ics-006-solo-machine-client) subpackage - * [ICS 007 - Tendermint Client](https://github.com/cosmos/ics/blob/master/spec/ics-007-tendermint-client) subpackage - * [ICS 009 - Loopback Client](https://github.com/cosmos/ics/tree/master/spec/ics-009-loopback-client) subpackage - * [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer) subpackage - * [ICS 023 - Vector Commitments](https://github.com/cosmos/ics/tree/master/spec/ics-023-vector-commitments) subpackage - * [ICS 024 - Host State Machine Requirements](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements) subpackage - * (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) ICS-23 Verify functions will now accept and verify ics23 CommitmentProofs exclusively - * (x/params) [\#6005](https://github.com/cosmos/cosmos-sdk/pull/6005) Add new CLI command for querying raw x/params parameters by subspace and key. + * (x/auth/vesting) [\#7209](https://github.com/cosmos/cosmos-sdk/pull/7209) Create new `MsgCreateVestingAccount` message type along with CLI handler that allows for the creation of delayed and continuous vesting types. + * (x/capability) [\#5828](https://github.com/cosmos/cosmos-sdk/pull/5828) Capability module integration as outlined in [ADR 3 - Dynamic Capability Store](https://github.com/cosmos/tree/master/docs/architecture/adr-003-dynamic-capability-store.md). + * (x/crisis) `x/crisis` has a new function: `AddModuleInitFlags`, which will register optional crisis module flags for the start command. + * (x/ibc) [\#5277](https://github.com/cosmos/cosmos-sdk/pull/5277) `x/ibc` changes from IBC alpha. For more details check the the [`x/ibc/core/spec`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc/core/spec) directory, or the ICS specs below: + * [ICS 002 - Client Semantics](https://github.com/cosmos/ics/tree/master/spec/ics-002-client-semantics) subpackage + * [ICS 003 - Connection Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-003-connection-semantics) subpackage + * [ICS 004 - Channel and Packet Semantics](https://github.com/cosmos/ics/blob/master/spec/ics-004-channel-and-packet-semantics) subpackage + * [ICS 005 - Port Allocation](https://github.com/cosmos/ics/blob/master/spec/ics-005-port-allocation) subpackage + * [ICS 006 - Solo Machine Client](https://github.com/cosmos/ics/tree/master/spec/ics-006-solo-machine-client) subpackage + * [ICS 007 - Tendermint Client](https://github.com/cosmos/ics/blob/master/spec/ics-007-tendermint-client) subpackage + * [ICS 009 - Loopback Client](https://github.com/cosmos/ics/tree/master/spec/ics-009-loopback-client) subpackage + * [ICS 020 - Fungible Token Transfer](https://github.com/cosmos/ics/tree/master/spec/ics-020-fungible-token-transfer) subpackage + * [ICS 023 - Vector Commitments](https://github.com/cosmos/ics/tree/master/spec/ics-023-vector-commitments) subpackage + * [ICS 024 - Host State Machine Requirements](https://github.com/cosmos/ics/tree/master/spec/ics-024-host-requirements) subpackage + * (x/ibc) [\#6374](https://github.com/cosmos/cosmos-sdk/pull/6374) ICS-23 Verify functions will now accept and verify ics23 CommitmentProofs exclusively + * (x/params) [\#6005](https://github.com/cosmos/cosmos-sdk/pull/6005) Add new CLI command for querying raw x/params parameters by subspace and key. ### Bug Fixes -* __Baseapp / Client / REST__ - * (client) [\#5964](https://github.com/cosmos/cosmos-sdk/issues/5964) `--trust-node` is now false by default - for real. Users must ensure it is set to true if they don't want to enable the verifier. - * (client) [\#6402](https://github.com/cosmos/cosmos-sdk/issues/6402) Fix `keys add` `--algo` flag which only worked for Tendermint's `secp256k1` default key signing algorithm. - * (client) [\#7699](https://github.com/cosmos/cosmos-sdk/pull/7699) Fix panic in context when setting invalid nodeURI. `WithNodeURI` does not set the `Client` in the context. - * (export) [\#6510](https://github.com/cosmos/cosmos-sdk/pull/6510/) Field TimeIotaMs now is included in genesis file while exporting. - * (rest) [\#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending invalid or incomplete requests. - * (crypto) [\#7966](https://github.com/cosmos/cosmos-sdk/issues/7966) `Bip44Params` `String()` function now correctly +* **Baseapp / Client / REST** + * (client) [\#5964](https://github.com/cosmos/cosmos-sdk/issues/5964) `--trust-node` is now false by default - for real. Users must ensure it is set to true if they don't want to enable the verifier. + * (client) [\#6402](https://github.com/cosmos/cosmos-sdk/issues/6402) Fix `keys add` `--algo` flag which only worked for Tendermint's `secp256k1` default key signing algorithm. + * (client) [\#7699](https://github.com/cosmos/cosmos-sdk/pull/7699) Fix panic in context when setting invalid nodeURI. `WithNodeURI` does not set the `Client` in the context. + * (export) [\#6510](https://github.com/cosmos/cosmos-sdk/pull/6510/) Field TimeIotaMs now is included in genesis file while exporting. + * (rest) [\#5906](https://github.com/cosmos/cosmos-sdk/pull/5906) Fix an issue that make some REST calls panic when sending invalid or incomplete requests. + * (crypto) [\#7966](https://github.com/cosmos/cosmos-sdk/issues/7966) `Bip44Params` `String()` function now correctly returns the absolute HD path by adding the `m/` prefix. - * (crypto/keyring) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `Keyring.Sign()` methods no longer decode amino signatures when method receivers + * (crypto/keyring) [\#5844](https://github.com/cosmos/cosmos-sdk/pull/5844) `Keyring.Sign()` methods no longer decode amino signatures when method receivers are offline/multisig keys. - * (store) [\#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. -* __Modules__ - * (modules) [\#5569](https://github.com/cosmos/cosmos-sdk/issues/5569) `InitGenesis`, for the relevant modules, now ensures module accounts exist. - * (x/auth) [\#5892](https://github.com/cosmos/cosmos-sdk/pull/5892) Add `RegisterKeyTypeCodec` to register new + * (store) [\#7415](https://github.com/cosmos/cosmos-sdk/pull/7415) Allow new stores to be registered during on-chain upgrades. +* **Modules** + * (modules) [\#5569](https://github.com/cosmos/cosmos-sdk/issues/5569) `InitGenesis`, for the relevant modules, now ensures module accounts exist. + * (x/auth) [\#5892](https://github.com/cosmos/cosmos-sdk/pull/5892) Add `RegisterKeyTypeCodec` to register new types (eg. keys) to the `auth` module internal amino codec. - * (x/bank) [\#6536](https://github.com/cosmos/cosmos-sdk/pull/6536) Fix bug in `WriteGeneratedTxResponse` function used by multiple + * (x/bank) [\#6536](https://github.com/cosmos/cosmos-sdk/pull/6536) Fix bug in `WriteGeneratedTxResponse` function used by multiple REST endpoints. Now it writes a Tx in StdTx format. - * (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling. - * (x/gentx) [\#8183](https://github.com/cosmos/cosmos-sdk/pull/8183) change gentx cmd amount to arg from flag - * (x/gov) [#7641](https://github.com/cosmos/cosmos-sdk/pull/7641) Fix tally calculation precision error. - * (x/staking) [\#6529](https://github.com/cosmos/cosmos-sdk/pull/6529) Export validator addresses (previously was empty). - * (x/staking) [\#5949](https://github.com/cosmos/cosmos-sdk/pull/5949) Skip staking `HistoricalInfoKey` in simulations as headers are not exported. - * (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to + * (x/genutil) [\#5938](https://github.com/cosmos/cosmos-sdk/pull/5938) Fix `InitializeNodeValidatorFiles` error handling. + * (x/gentx) [\#8183](https://github.com/cosmos/cosmos-sdk/pull/8183) change gentx cmd amount to arg from flag + * (x/gov) [#7641](https://github.com/cosmos/cosmos-sdk/pull/7641) Fix tally calculation precision error. + * (x/staking) [\#6529](https://github.com/cosmos/cosmos-sdk/pull/6529) Export validator addresses (previously was empty). + * (x/staking) [\#5949](https://github.com/cosmos/cosmos-sdk/pull/5949) Skip staking `HistoricalInfoKey` in simulations as headers are not exported. + * (x/staking) [\#6061](https://github.com/cosmos/cosmos-sdk/pull/6061) Allow a validator to immediately unjail when no signing info is present due to falling below their minimum self-delegation and never having been bonded. The validator may immediately unjail once they've met their minimum self-delegation. -* __General__ - * (types) [\#7038](https://github.com/cosmos/cosmos-sdk/issues/7038) Fix infinite looping of `ApproxRoot` by including a hard-coded maximum iterations limit of 100. - * (types) [\#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`. - * (simulation) [\#7129](https://github.com/cosmos/cosmos-sdk/issues/7129) Fix support for custom `Account` and key types on auth's simulation. +* **General** + * (types) [\#7038](https://github.com/cosmos/cosmos-sdk/issues/7038) Fix infinite looping of `ApproxRoot` by including a hard-coded maximum iterations limit of 100. + * (types) [\#7084](https://github.com/cosmos/cosmos-sdk/pull/7084) Fix panic when calling `BigInt()` on an uninitialized `Int`. + * (simulation) [\#7129](https://github.com/cosmos/cosmos-sdk/issues/7129) Fix support for custom `Account` and key types on auth's simulation. ### Improvements -* __Baseapp / Client / REST__ - * (baseapp) [\#6186](https://github.com/cosmos/cosmos-sdk/issues/6186) Support emitting events during `AnteHandler` execution. - * (baseapp) [\#6053](https://github.com/cosmos/cosmos-sdk/pull/6053) Customizable panic recovery handling added for `app.runTx()` method (as proposed in the [ADR 22](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-022-custom-panic-handling.md)). Adds ability for developers to register custom panic handlers extending standard ones. - * (client) [\#5810](https://github.com/cosmos/cosmos-sdk/pull/5810) Added a new `--offline` flag that allows commands to be executed without an + +* **Baseapp / Client / REST** + * (baseapp) [\#6186](https://github.com/cosmos/cosmos-sdk/issues/6186) Support emitting events during `AnteHandler` execution. + * (baseapp) [\#6053](https://github.com/cosmos/cosmos-sdk/pull/6053) Customizable panic recovery handling added for `app.runTx()` method (as proposed in the [ADR 22](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-022-custom-panic-handling.md)). Adds ability for developers to register custom panic handlers extending standard ones. + * (client) [\#5810](https://github.com/cosmos/cosmos-sdk/pull/5810) Added a new `--offline` flag that allows commands to be executed without an internet connection. Previously, `--generate-only` served this purpose in addition to only allowing txs to be generated. Now, `--generate-only` solely allows txs to be generated without being broadcasted and disallows Keybase use and `--offline` allows the use of Keybase but does not allow any functionality that requires an online connection. - * (cli) [#7764](https://github.com/cosmos/cosmos-sdk/pull/7764) Update x/banking and x/crisis InitChain to improve node startup time - * (client) [\#5856](https://github.com/cosmos/cosmos-sdk/pull/5856) Added the possibility to set `--offline` flag with config command. - * (client) [\#5895](https://github.com/cosmos/cosmos-sdk/issues/5895) show config options in the config command's help screen. - * (client/keys) [\#8043](https://github.com/cosmos/cosmos-sdk/pull/8043) Add support for export of unarmored private key - * (client/tx) [\#7801](https://github.com/cosmos/cosmos-sdk/pull/7801) Update sign-batch multisig to work online - * (x/genutil) [\#8099](https://github.com/cosmos/cosmos-sdk/pull/8099) `init` now supports a `--recover` flag to recover + * (cli) [#7764](https://github.com/cosmos/cosmos-sdk/pull/7764) Update x/banking and x/crisis InitChain to improve node startup time + * (client) [\#5856](https://github.com/cosmos/cosmos-sdk/pull/5856) Added the possibility to set `--offline` flag with config command. + * (client) [\#5895](https://github.com/cosmos/cosmos-sdk/issues/5895) show config options in the config command's help screen. + * (client/keys) [\#8043](https://github.com/cosmos/cosmos-sdk/pull/8043) Add support for export of unarmored private key + * (client/tx) [\#7801](https://github.com/cosmos/cosmos-sdk/pull/7801) Update sign-batch multisig to work online + * (x/genutil) [\#8099](https://github.com/cosmos/cosmos-sdk/pull/8099) `init` now supports a `--recover` flag to recover the private validator key from a given mnemonic -* __Modules__ - * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) Add parameter querying support for `x/auth`. - * (x/auth/ante) [\#6040](https://github.com/cosmos/cosmos-sdk/pull/6040) `AccountKeeper` interface used for `NewAnteHandler` and handler's decorators to add support of using custom `AccountKeeper` implementations. - * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Tendermint Consensus parameters can now be changed via parameter change proposals through `x/gov`. - * (x/evidence) [\#5961](https://github.com/cosmos/cosmos-sdk/issues/5961) Add `StoreDecoder` simulation for evidence module. - * (x/ibc) [\#5948](https://github.com/cosmos/cosmos-sdk/issues/5948) Add `InitGenesis` and `ExportGenesis` functions for `ibc` module. - * (x/ibc-transfer) [\#6871](https://github.com/cosmos/cosmos-sdk/pull/6871) Implement [ADR 001 - Coin Source Tracing](./docs/architecture/adr-001-coin-source-tracing.md). - * (x/staking) [\#6059](https://github.com/cosmos/cosmos-sdk/pull/6059) Updated `HistoricalEntries` parameter default to 100. - * (x/staking) [\#5584](https://github.com/cosmos/cosmos-sdk/pull/5584) Add util function `ToTmValidator` that converts a `staking.Validator` type to `*tmtypes.Validator`. - * (x/staking) [\#6163](https://github.com/cosmos/cosmos-sdk/pull/6163) CLI and REST call to unbonding delegations and delegations now accept +* **Modules** + * (x/auth) [\#5702](https://github.com/cosmos/cosmos-sdk/pull/5702) Add parameter querying support for `x/auth`. + * (x/auth/ante) [\#6040](https://github.com/cosmos/cosmos-sdk/pull/6040) `AccountKeeper` interface used for `NewAnteHandler` and handler's decorators to add support of using custom `AccountKeeper` implementations. + * (x/evidence) [\#5952](https://github.com/cosmos/cosmos-sdk/pull/5952) Tendermint Consensus parameters can now be changed via parameter change proposals through `x/gov`. + * (x/evidence) [\#5961](https://github.com/cosmos/cosmos-sdk/issues/5961) Add `StoreDecoder` simulation for evidence module. + * (x/ibc) [\#5948](https://github.com/cosmos/cosmos-sdk/issues/5948) Add `InitGenesis` and `ExportGenesis` functions for `ibc` module. + * (x/ibc-transfer) [\#6871](https://github.com/cosmos/cosmos-sdk/pull/6871) Implement [ADR 001 - Coin Source Tracing](./docs/architecture/adr-001-coin-source-tracing.md). + * (x/staking) [\#6059](https://github.com/cosmos/cosmos-sdk/pull/6059) Updated `HistoricalEntries` parameter default to 100. + * (x/staking) [\#5584](https://github.com/cosmos/cosmos-sdk/pull/5584) Add util function `ToTmValidator` that converts a `staking.Validator` type to `*tmtypes.Validator`. + * (x/staking) [\#6163](https://github.com/cosmos/cosmos-sdk/pull/6163) CLI and REST call to unbonding delegations and delegations now accept pagination. - * (x/staking) [\#8178](https://github.com/cosmos/cosmos-sdk/pull/8178) Update default historical header number for stargate -* __General__ - * (crypto) [\#7987](https://github.com/cosmos/cosmos-sdk/pull/7987) Fix the inconsistency of CryptoCdc, only use + * (x/staking) [\#8178](https://github.com/cosmos/cosmos-sdk/pull/8178) Update default historical header number for stargate +* **General** + * (crypto) [\#7987](https://github.com/cosmos/cosmos-sdk/pull/7987) Fix the inconsistency of CryptoCdc, only use `codec/legacy.Cdc`. - * (logging) [\#8072](https://github.com/cosmos/cosmos-sdk/pull/8072) Refactor logging: - * Use [zerolog](https://github.com/rs/zerolog) over Tendermint's go-kit logging wrapper. - * Introduce Tendermint's `--log_format=plain|json` flag. Using format `json` allows for emitting structured JSON + * (logging) [\#8072](https://github.com/cosmos/cosmos-sdk/pull/8072) Refactor logging: + * Use [zerolog](https://github.com/rs/zerolog) over Tendermint's go-kit logging wrapper. + * Introduce Tendermint's `--log_format=plain|json` flag. Using format `json` allows for emitting structured JSON logs which can be consumed by an external logging facility (e.g. Loggly). Both formats log to STDERR. - * The existing `--log_level` flag and it's default value now solely relates to the global logging + * The existing `--log_level` flag and it's default value now solely relates to the global logging level (e.g. `info`, `debug`, etc...) instead of `:`. - * (rest) [#7649](https://github.com/cosmos/cosmos-sdk/pull/7649) Return an unsigned tx in legacy GET /tx endpoint when signature conversion fails - * (simulation) [\#6002](https://github.com/cosmos/cosmos-sdk/pull/6002) Add randomized consensus params into simulation. - * (store) [\#6481](https://github.com/cosmos/cosmos-sdk/pull/6481) Move `SimpleProofsFromMap` from Tendermint into the SDK. - * (store) [\#6719](https://github.com/cosmos/cosmos-sdk/6754) Add validity checks to stores for nil and empty keys. - * (SDK) Updated dependencies - * Updated iavl dependency to v0.15.3 - * Update tendermint to v0.34.1 - * (types) [\#7027](https://github.com/cosmos/cosmos-sdk/pull/7027) `Coin(s)` and `DecCoin(s)` updates: - * Bump denomination max length to 128 - * Allow uppercase letters and numbers in denominations to support [ADR 001](./docs/architecture/adr-001-coin-source-tracing.md) - * Added `Validate` function that returns a descriptive error - * (types) [\#5581](https://github.com/cosmos/cosmos-sdk/pull/5581) Add convenience functions {,Must}Bech32ifyAddressBytes. - * (types/module) [\#5724](https://github.com/cosmos/cosmos-sdk/issues/5724) The `types/module` package does no longer depend on `x/simulation`. - * (types) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) IBC additions: - * `Coin` denomination max lenght has been increased to 32. - * Added `CapabilityKey` alias for `StoreKey` to match IBC spec. - * (types/rest) [\#5900](https://github.com/cosmos/cosmos-sdk/pull/5900) Add Check*Error function family to spare developers from replicating tons of boilerplate code. - * (types) [\#6128](https://github.com/cosmos/cosmos-sdk/pull/6137) Add `String()` method to `GasMeter`. - * (types) [\#6195](https://github.com/cosmos/cosmos-sdk/pull/6195) Add codespace to broadcast(sync/async) response. - * (types) \#6897 Add KV type from tendermint to `types` directory. - * (version) [\#7848](https://github.com/cosmos/cosmos-sdk/pull/7848) [\#7941](https://github.com/cosmos/cosmos-sdk/pull/7941) + * (rest) [#7649](https://github.com/cosmos/cosmos-sdk/pull/7649) Return an unsigned tx in legacy GET /tx endpoint when signature conversion fails + * (simulation) [\#6002](https://github.com/cosmos/cosmos-sdk/pull/6002) Add randomized consensus params into simulation. + * (store) [\#6481](https://github.com/cosmos/cosmos-sdk/pull/6481) Move `SimpleProofsFromMap` from Tendermint into the SDK. + * (store) [\#6719](https://github.com/cosmos/cosmos-sdk/6754) Add validity checks to stores for nil and empty keys. + * (SDK) Updated dependencies + * Updated iavl dependency to v0.15.3 + * Update tendermint to v0.34.1 + * (types) [\#7027](https://github.com/cosmos/cosmos-sdk/pull/7027) `Coin(s)` and `DecCoin(s)` updates: + * Bump denomination max length to 128 + * Allow uppercase letters and numbers in denominations to support [ADR 001](./docs/architecture/adr-001-coin-source-tracing.md) + * Added `Validate` function that returns a descriptive error + * (types) [\#5581](https://github.com/cosmos/cosmos-sdk/pull/5581) Add convenience functions {,Must}Bech32ifyAddressBytes. + * (types/module) [\#5724](https://github.com/cosmos/cosmos-sdk/issues/5724) The `types/module` package does no longer depend on `x/simulation`. + * (types) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) IBC additions: + * `Coin` denomination max lenght has been increased to 32. + * Added `CapabilityKey` alias for `StoreKey` to match IBC spec. + * (types/rest) [\#5900](https://github.com/cosmos/cosmos-sdk/pull/5900) Add Check*Error function family to spare developers from replicating tons of boilerplate code. + * (types) [\#6128](https://github.com/cosmos/cosmos-sdk/pull/6137) Add `String()` method to `GasMeter`. + * (types) [\#6195](https://github.com/cosmos/cosmos-sdk/pull/6195) Add codespace to broadcast(sync/async) response. + * (types) \#6897 Add KV type from tendermint to `types` directory. + * (version) [\#7848](https://github.com/cosmos/cosmos-sdk/pull/7848) [\#7941](https://github.com/cosmos/cosmos-sdk/pull/7941) `version --long` output now shows the list of build dependencies and replaced build dependencies. ## [v0.39.1](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.39.1) - 2020-08-11 @@ -1151,8 +1155,8 @@ falling below their minimum self-delegation and never having been bonded. The va * (deps) Bump IAVL version to [v0.14.0](https://github.com/cosmos/iavl/releases/tag/v0.14.0) * (client) [\#5585](https://github.com/cosmos/cosmos-sdk/pull/5585) `CLIContext` additions: - * Introduce `QueryABCI` that returns the full `abci.ResponseQuery` with inclusion Merkle proofs. - * Added `prove` flag for Merkle proof verification. + * Introduce `QueryABCI` that returns the full `abci.ResponseQuery` with inclusion Merkle proofs. + * Added `prove` flag for Merkle proof verification. * (x/staking) [\#6791)](https://github.com/cosmos/cosmos-sdk/pull/6791) Close {UBDQueue,RedelegationQueu}Iterator once used. ### API Breaking Changes @@ -1214,8 +1218,8 @@ respectively, and the latter defines the height interval in which versions are d ### Improvements * (rest) [\#5648](https://github.com/cosmos/cosmos-sdk/pull/5648) Enhance /txs usability: - * Add `tx.minheight` key to filter transaction with an inclusive minimum block height - * Add `tx.maxheight` key to filter transaction with an inclusive maximum block height + * Add `tx.minheight` key to filter transaction with an inclusive minimum block height + * Add `tx.maxheight` key to filter transaction with an inclusive maximum block height * (crypto/keys) [\#5739](https://github.com/cosmos/cosmos-sdk/pull/5739) Print an error message if the password input failed. ## [v0.38.1] - 2020-02-11 @@ -1259,13 +1263,13 @@ logic has been implemented for v0.38 target version. Applications can migrate vi to `...DecCoin`, `Coins#Add` parameter changed from `Coins` to `...Coin`. * (baseapp/types) [\#5421](https://github.com/cosmos/cosmos-sdk/pull/5421) The `Error` interface (`types/errors.go`) has been removed in favor of the concrete type defined in `types/errors/` which implements the standard `error` interface. - * As a result, the `Handler` and `Querier` implementations now return a standard `error`. + * As a result, the `Handler` and `Querier` implementations now return a standard `error`. Within `BaseApp`, `runTx` now returns a `(GasInfo, *Result, error)` tuple and `runMsgs` returns a `(*Result, error)` tuple. A reference to a `Result` is now used to indicate success whereas an error signals an invalid message or failed message execution. As a result, the fields `Code`, `Codespace`, `GasWanted`, and `GasUsed` have been removed the `Result` type. The latter two fields are now found in the `GasInfo` type which is always returned regardless of execution outcome. - * Note to developers: Since all handlers and queriers must now return a standard `error`, the `types/errors/` + * Note to developers: Since all handlers and queriers must now return a standard `error`, the `types/errors/` package contains all the relevant and pre-registered errors that you typically work with. A typical error returned will look like `sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "...")`. You can retrieve relevant ABCI information from the error via `ABCIInfo`. @@ -1275,21 +1279,21 @@ components can be imported directly from the packages. now requires a `SetInterBlockCache` method. Applications that do not wish to support this can simply have this method perform a no-op. * (modules) [\#4665](https://github.com/cosmos/cosmos-sdk/issues/4665) Refactored `x/gov` module structure and dev-UX: - * Prepare for module spec integration - * Update gov keys to use big endian encoding instead of little endian + * Prepare for module spec integration + * Update gov keys to use big endian encoding instead of little endian * (modules) [\#5017](https://github.com/cosmos/cosmos-sdk/pull/5017) The `x/genaccounts` module has been deprecated and all components removed except the `legacy/` package. * [\#4486](https://github.com/cosmos/cosmos-sdk/issues/4486) Vesting account types decoupled from the `x/auth` module and now live under `x/auth/vesting`. Applications wishing to use vesting account types must be sure to register types via `RegisterCodec` under the new vesting package. * [\#4486](https://github.com/cosmos/cosmos-sdk/issues/4486) The `NewBaseVestingAccount` constructor returns an error if the provided arguments are invalid. * (x/auth) [\#5006](https://github.com/cosmos/cosmos-sdk/pull/5006) Modular `AnteHandler` via composable decorators: - * The `AnteHandler` interface now returns `(newCtx Context, err error)` instead of `(newCtx Context, result sdk.Result, abort bool)` - * The `NewAnteHandler` function returns an `AnteHandler` function that returns the new `AnteHandler` + * The `AnteHandler` interface now returns `(newCtx Context, err error)` instead of `(newCtx Context, result sdk.Result, abort bool)` + * The `NewAnteHandler` function returns an `AnteHandler` function that returns the new `AnteHandler` interface and has been moved into the `auth/ante` directory. - * `ValidateSigCount`, `ValidateMemo`, `ProcessPubKey`, `EnsureSufficientMempoolFee`, and `GetSignBytes` + * `ValidateSigCount`, `ValidateMemo`, `ProcessPubKey`, `EnsureSufficientMempoolFee`, and `GetSignBytes` have all been removed as public functions. - * Invalid Signatures may return `InvalidPubKey` instead of `Unauthorized` error, since the transaction + * Invalid Signatures may return `InvalidPubKey` instead of `Unauthorized` error, since the transaction will first hit `SetPubKeyDecorator` before the `SigVerificationDecorator` runs. - * `StdTx#GetSignatures` will return an array of just signature byte slices `[][]byte` instead of + * `StdTx#GetSignatures` will return an array of just signature byte slices `[][]byte` instead of returning an array of `StdSignature` structs. To replicate the old behavior, use the public field `StdTx.Signatures` to get back the array of StdSignatures `[]StdSignature`. * (modules) [\#5299](https://github.com/cosmos/cosmos-sdk/pull/5299) `HandleDoubleSign` along with params `MaxEvidenceAge` and `DoubleSignJailEndTime` have moved from the `x/slashing` module to the `x/evidence` module. @@ -1299,13 +1303,13 @@ these options to be set on the commands or ignored to default to previous behavi * [\#5547](https://github.com/cosmos/cosmos-sdk/pull/5547) `NewKeyBaseFromHomeFlag` constructor has been removed. * [\#5439](https://github.com/cosmos/cosmos-sdk/pull/5439) Further modularization was done to the `keybase` package to make it more suitable for use with different key formats and algorithms: - * The `WithKeygenFunc` function added as a `KeybaseOption` which allows a custom bytes to key + * The `WithKeygenFunc` function added as a `KeybaseOption` which allows a custom bytes to key implementation to be defined when keys are created. - * The `WithDeriveFunc` function added as a `KeybaseOption` allows custom logic for deriving a key + * The `WithDeriveFunc` function added as a `KeybaseOption` allows custom logic for deriving a key from a mnemonic, bip39 password, and HD Path. - * BIP44 is no longer build into `keybase.CreateAccount()`. It is however the default when using + * BIP44 is no longer build into `keybase.CreateAccount()`. It is however the default when using the `client/keys` add command. - * `SupportedAlgos` and `SupportedAlgosLedger` functions return a slice of `SigningAlgo`s that are + * `SupportedAlgos` and `SupportedAlgosLedger` functions return a slice of `SigningAlgo`s that are supported by the keybase and the ledger integration respectively. * (simapp) [\#5419](https://github.com/cosmos/cosmos-sdk/pull/5419) The `helpers.GenTx()` now accepts a gas argument. * (baseapp) [\#5455](https://github.com/cosmos/cosmos-sdk/issues/5455) A `sdk.Context` is now passed into the `router.Route()` function. @@ -1330,9 +1334,9 @@ increased significantly due to modular `AnteHandler` support. Increase GasLimit longer panics if the store to load contains substores that we didn't explicitly mount. * [\#4972](https://github.com/cosmos/cosmos-sdk/issues/4972) A `TxResponse` with a corresponding code and tx hash will be returned for specific Tendermint errors: - * `CodeTxInMempoolCache` - * `CodeMempoolIsFull` - * `CodeTxTooLarge` + * `CodeTxInMempoolCache` + * `CodeMempoolIsFull` + * `CodeTxTooLarge` * [\#3872](https://github.com/cosmos/cosmos-sdk/issues/3872) Implement a RESTful endpoint and cli command to decode transactions. * (keys) [\#4754](https://github.com/cosmos/cosmos-sdk/pull/4754) Introduce new Keybase implementation that can leverage operating systems' built-in functionalities to securely store secrets. MacOS users may encounter @@ -1342,11 +1346,11 @@ upgrade via: `sudo rm -rf /Library/Developer/CommandLineTools; xcode-select --in correct version via: `pkgutil --pkg-info=com.apple.pkg.CLTools_Executables`. * [\#5355](https://github.com/cosmos/cosmos-sdk/pull/5355) Client commands accept a new `--keyring-backend` option through which users can specify which backend should be used by the new key store: - * `os`: use OS default credentials storage (default). - * `file`: use encrypted file-based store. - * `kwallet`: use [KDE Wallet](https://utils.kde.org/projects/kwalletmanager/) service. - * `pass`: use the [pass](https://www.passwordstore.org/) command line password manager. - * `test`: use password-less key store. *For testing purposes only. Use it at your own risk.* + * `os`: use OS default credentials storage (default). + * `file`: use encrypted file-based store. + * `kwallet`: use [KDE Wallet](https://utils.kde.org/projects/kwalletmanager/) service. + * `pass`: use the [pass](https://www.passwordstore.org/) command line password manager. + * `test`: use password-less key store. _For testing purposes only. Use it at your own risk._ * (keys) [\#5097](https://github.com/cosmos/cosmos-sdk/pull/5097) New `keys migrate` command to assist users migrate their keys to the new keyring. * (keys) [\#5366](https://github.com/cosmos/cosmos-sdk/pull/5366) `keys list` now accepts a `--list-names` option to list key names only, whilst the `keys delete` @@ -1359,39 +1363,39 @@ that allows for arbitrary vesting periods. * (types) [\#5196](https://github.com/cosmos/cosmos-sdk/pull/5196) Context has new `IsRecheckTx() bool` and `WithIsReCheckTx(bool) Context` methods to to be used in the `AnteHandler`. * (x/auth/ante) [\#5196](https://github.com/cosmos/cosmos-sdk/pull/5196) AnteDecorators have been updated to avoid unnecessary checks when `ctx.IsReCheckTx() == true` * (x/auth) [\#5006](https://github.com/cosmos/cosmos-sdk/pull/5006) Modular `AnteHandler` via composable decorators: - * The `AnteDecorator` interface has been introduced to allow users to implement modular `AnteHandler` + * The `AnteDecorator` interface has been introduced to allow users to implement modular `AnteHandler` functionality that can be composed together to create a single `AnteHandler` rather than implementing a custom `AnteHandler` completely from scratch, where each `AnteDecorator` allows for custom behavior in tightly defined and logically isolated manner. These custom `AnteDecorator` can then be chained together with default `AnteDecorator` or third-party `AnteDecorator` to create a modularized `AnteHandler` which will run each `AnteDecorator` in the order specified in `ChainAnteDecorators`. For details on the new architecture, refer to the [ADR](docs/architecture/adr-010-modular-antehandler.md). - * `ChainAnteDecorators` function has been introduced to take in a list of `AnteDecorators` and chain + * `ChainAnteDecorators` function has been introduced to take in a list of `AnteDecorators` and chain them in sequence and return a single `AnteHandler`: - * `SetUpContextDecorator`: Sets `GasMeter` in context and creates defer clause to recover from any + * `SetUpContextDecorator`: Sets `GasMeter` in context and creates defer clause to recover from any `OutOfGas` panics in future AnteDecorators and return `OutOfGas` error to `BaseApp`. It MUST be the first `AnteDecorator` in the chain for any application that uses gas (or another one that sets the gas meter). - * `ValidateBasicDecorator`: Calls tx.ValidateBasic and returns any non-nil error. - * `ValidateMemoDecorator`: Validates tx memo with application parameters and returns any non-nil error. - * `ConsumeGasTxSizeDecorator`: Consumes gas proportional to the tx size based on application parameters. - * `MempoolFeeDecorator`: Checks if fee is above local mempool `minFee` parameter during `CheckTx`. - * `DeductFeeDecorator`: Deducts the `FeeAmount` from first signer of the transaction. - * `SetPubKeyDecorator`: Sets pubkey of account in any account that does not already have pubkey saved in state machine. - * `SigGasConsumeDecorator`: Consume parameter-defined amount of gas for each signature. - * `SigVerificationDecorator`: Verify each signature is valid, return if there is an error. - * `ValidateSigCountDecorator`: Validate the number of signatures in tx based on app-parameters. - * `IncrementSequenceDecorator`: Increments the account sequence for each signer to prevent replay attacks. + * `ValidateBasicDecorator`: Calls tx.ValidateBasic and returns any non-nil error. + * `ValidateMemoDecorator`: Validates tx memo with application parameters and returns any non-nil error. + * `ConsumeGasTxSizeDecorator`: Consumes gas proportional to the tx size based on application parameters. + * `MempoolFeeDecorator`: Checks if fee is above local mempool `minFee` parameter during `CheckTx`. + * `DeductFeeDecorator`: Deducts the `FeeAmount` from first signer of the transaction. + * `SetPubKeyDecorator`: Sets pubkey of account in any account that does not already have pubkey saved in state machine. + * `SigGasConsumeDecorator`: Consume parameter-defined amount of gas for each signature. + * `SigVerificationDecorator`: Verify each signature is valid, return if there is an error. + * `ValidateSigCountDecorator`: Validate the number of signatures in tx based on app-parameters. + * `IncrementSequenceDecorator`: Increments the account sequence for each signer to prevent replay attacks. * (cli) [\#5223](https://github.com/cosmos/cosmos-sdk/issues/5223) Cosmos Ledger App v2.0.0 is now supported. The changes are backwards compatible and App v1.5.x is still supported. * (x/staking) [\#5380](https://github.com/cosmos/cosmos-sdk/pull/5380) Introduced ability to store historical info entries in staking keeper, allows applications to introspect specified number of past headers and validator sets - * Introduces new parameter `HistoricalEntries` which allows applications to determine how many recent historical info entries they want to persist in store. Default value is 0. - * Introduces cli commands and rest routes to query historical information at a given height + * Introduces new parameter `HistoricalEntries` which allows applications to determine how many recent historical info entries they want to persist in store. Default value is 0. + * Introduces cli commands and rest routes to query historical information at a given height * (modules) [\#5249](https://github.com/cosmos/cosmos-sdk/pull/5249) Funds are now allowed to be directly sent to the community pool (via the distribution module account). * (keys) [\#4941](https://github.com/cosmos/cosmos-sdk/issues/4941) Introduce keybase option to allow overriding the default private key implementation of a key generated through the `keys add` cli command. * (keys) [\#5439](https://github.com/cosmos/cosmos-sdk/pull/5439) Flags `--algo` and `--hd-path` are added to `keys add` command in order to make use of keybase modularized. By default, it uses (0, 0) bip44 HD path and secp256k1 keys, so is non-breaking. * (types) [\#5447](https://github.com/cosmos/cosmos-sdk/pull/5447) Added `ApproxRoot` function to sdk.Decimal type in order to get the nth root for a decimal number, where n is a positive integer. - * An `ApproxSqrt` function was also added for convenience around the common case of n=2. + * An `ApproxSqrt` function was also added for convenience around the common case of n=2. ### Improvements @@ -1401,6 +1405,7 @@ has been moved to the configuration file, to allow easier node configuration. * (cli) [\#5116](https://github.com/cosmos/cosmos-sdk/issues/5116) The `CLIContext` now supports multiple verifiers when connecting to multiple chains. The connecting chain's `CLIContext` will have to have the correct chain ID and node URI or client set. To use a `CLIContext` with a verifier for another chain: + ```go // main or parent chain (chain as if you're running without IBC) mainCtx := context.NewCLIContext() @@ -1414,6 +1419,7 @@ chain ID and node URI or client set. To use a `CLIContext` with a verifier for a context.CreateVerifier(sideCtx, context.DefaultVerifierCacheSize), ) ``` + * (modules) [\#5017](https://github.com/cosmos/cosmos-sdk/pull/5017) The `x/auth` package now supports generalized genesis accounts through the `GenesisAccount` interface. * (modules) [\#4762](https://github.com/cosmos/cosmos-sdk/issues/4762) Deprecate remove and add permissions in ModuleAccount. @@ -1427,22 +1433,22 @@ generalized genesis accounts through the `GenesisAccount` interface. * (simulation) [\#4824](https://github.com/cosmos/cosmos-sdk/issues/4824) `PrintAllInvariants` flag will print all failed invariants * (simulation) [\#4490](https://github.com/cosmos/cosmos-sdk/issues/4490) add `InitialBlockHeight` flag to resume a simulation from a given block - * Support exporting the simulation stats to a given JSON file + * Support exporting the simulation stats to a given JSON file * (simulation) [\#4847](https://github.com/cosmos/cosmos-sdk/issues/4847), [\#4838](https://github.com/cosmos/cosmos-sdk/pull/4838) and [\#4869](https://github.com/cosmos/cosmos-sdk/pull/4869) `SimApp` and simulation refactors: - * Implement `SimulationManager` for executing modules' simulation functionalities in a modularized way - * Add `RegisterStoreDecoders` to the `SimulationManager` for decoding each module's types - * Add `GenerateGenesisStates` to the `SimulationManager` to generate a randomized `GenState` for each module - * Add `RandomizedParams` to the `SimulationManager` that registers each modules' parameters in order to + * Implement `SimulationManager` for executing modules' simulation functionalities in a modularized way + * Add `RegisterStoreDecoders` to the `SimulationManager` for decoding each module's types + * Add `GenerateGenesisStates` to the `SimulationManager` to generate a randomized `GenState` for each module + * Add `RandomizedParams` to the `SimulationManager` that registers each modules' parameters in order to simulate `ParamChangeProposal`s' `Content`s - * Add `WeightedOperations` to the `SimulationManager` that define simulation operations (modules' `Msg`s) with their + * Add `WeightedOperations` to the `SimulationManager` that define simulation operations (modules' `Msg`s) with their respective weights (i.e chance of being simulated). - * Add `ProposalContents` to the `SimulationManager` to register each module's governance proposal `Content`s. + * Add `ProposalContents` to the `SimulationManager` to register each module's governance proposal `Content`s. * (simulation) [\#4893](https://github.com/cosmos/cosmos-sdk/issues/4893) Change `SimApp` keepers to be public and add getter functions for keys and codec * (simulation) [\#4906](https://github.com/cosmos/cosmos-sdk/issues/4906) Add simulation `Config` struct that wraps simulation flags * (simulation) [\#4935](https://github.com/cosmos/cosmos-sdk/issues/4935) Update simulation to reflect a proper `ABCI` application without bypassing `BaseApp` semantics * (simulation) [\#5378](https://github.com/cosmos/cosmos-sdk/pull/5378) Simulation tests refactor: - * Add `App` interface for general SDK-based app's methods. - * Refactor and cleanup simulation tests into util functions to simplify their implementation for other SDK apps. + * Add `App` interface for general SDK-based app's methods. + * Refactor and cleanup simulation tests into util functions to simplify their implementation for other SDK apps. * (store) [\#4792](https://github.com/cosmos/cosmos-sdk/issues/4792) panic on non-registered store * (types) [\#4821](https://github.com/cosmos/cosmos-sdk/issues/4821) types/errors package added with support for stacktraces. It is meant as a more feature-rich replacement for sdk.Errors in the mid-term. * (store) [\#1947](https://github.com/cosmos/cosmos-sdk/issues/1947) Implement inter-block (persistent) @@ -1451,12 +1457,12 @@ must set it in their app via a `BaseApp` option. The `BaseApp` docs have been dr to detail this new feature and how state transitions occur. * (docs/spec) All module specs moved into their respective module dir in x/ (i.e. docs/spec/staking -->> x/staking/spec) * (docs/) [\#5379](https://github.com/cosmos/cosmos-sdk/pull/5379) Major documentation refactor, including: - * (docs/intro/) Add and improve introduction material for newcomers. - * (docs/basics/) Add documentation about basic concepts of the cosmos sdk such as the anatomy of an SDK application, the transaction lifecycle or accounts. - * (docs/core/) Add documentation about core conepts of the cosmos sdk such as `baseapp`, `server`, `store`s, `context` and more. - * (docs/building-modules/) Add reference documentation on concepts relevant for module developers (`keeper`, `handler`, `messages`, `queries`,...). - * (docs/interfaces/) Add documentation on building interfaces for the Cosmos SDK. - * Redesigned user interface that features new dynamically generated sidebar, build-time code embedding from GitHub, new homepage as well as many other improvements. + * (docs/intro/) Add and improve introduction material for newcomers. + * (docs/basics/) Add documentation about basic concepts of the cosmos sdk such as the anatomy of an SDK application, the transaction lifecycle or accounts. + * (docs/core/) Add documentation about core conepts of the cosmos sdk such as `baseapp`, `server`, `store`s, `context` and more. + * (docs/building-modules/) Add reference documentation on concepts relevant for module developers (`keeper`, `handler`, `messages`, `queries`,...). + * (docs/interfaces/) Add documentation on building interfaces for the Cosmos SDK. + * Redesigned user interface that features new dynamically generated sidebar, build-time code embedding from GitHub, new homepage as well as many other improvements. * (types) [\#5428](https://github.com/cosmos/cosmos-sdk/pull/5428) Add `Mod` (modulo) method and `RelativePow` (exponentation) function for `Uint`. * (modules) [\#5506](https://github.com/cosmos/cosmos-sdk/pull/5506) Remove redundancy in `x/distribution`s use of parameters. There now exists a single `Params` type with a getter and setter along with a getter for each individual parameter. @@ -1519,8 +1525,8 @@ to detail this new feature and how state transitions occur. ### Improvements * (rest) [\#5648](https://github.com/cosmos/cosmos-sdk/pull/5648) Enhance /txs usability: - * Add `tx.minheight` key to filter transaction with an inclusive minimum block height - * Add `tx.maxheight` key to filter transaction with an inclusive maximum block height + * Add `tx.minheight` key to filter transaction with an inclusive minimum block height + * Add `tx.maxheight` key to filter transaction with an inclusive maximum block height ## [v0.37.7] - 2020-02-10 @@ -1612,9 +1618,9 @@ in `TxResponse` is deprecated and will be removed in the next major release. ### Bug Fixes * (baseapp) [\#4903](https://github.com/cosmos/cosmos-sdk/issues/4903) Various height query fixes: - * Move height with proof check from `CLIContext` to `BaseApp` as the height + * Move height with proof check from `CLIContext` to `BaseApp` as the height can automatically be injected there. - * Update `handleQueryStore` to resemble `handleQueryCustom` + * Update `handleQueryStore` to resemble `handleQueryCustom` * (simulation) [\#4912](https://github.com/cosmos/cosmos-sdk/issues/4912) Fix SimApp ModuleAccountAddrs to properly return black listed addresses for bank keeper initialization. * (cli) [\#4919](https://github.com/cosmos/cosmos-sdk/pull/4919) Don't crash CLI @@ -1638,23 +1644,23 @@ that error is that the account doesn't exist. * All REST responses now wrap the original resource/result. The response will contain two fields: height and result. * [\#3565](https://github.com/cosmos/cosmos-sdk/issues/3565) Updates to the governance module: - * Rename JSON field from `proposal_content` to `content` - * Rename JSON field from `proposal_id` to `id` - * Disable `ProposalTypeSoftwareUpgrade` temporarily + * Rename JSON field from `proposal_content` to `content` + * Rename JSON field from `proposal_id` to `id` + * Disable `ProposalTypeSoftwareUpgrade` temporarily * [\#3775](https://github.com/cosmos/cosmos-sdk/issues/3775) unify sender transaction tag for ease of querying * [\#4255](https://github.com/cosmos/cosmos-sdk/issues/4255) Add supply module that passively tracks the supplies of a chain - - Renamed `x/distribution` `ModuleName` - - Genesis JSON and CLI now use `distribution` instead of `distr` - - Introduce `ModuleAccount` type, which tracks the flow of coins held within a module - - Replaced `FeeCollectorKeeper` for a `ModuleAccount` - - Replaced the staking `Pool`, which coins are now held by the `BondedPool` and `NotBonded` module accounts - - The `NotBonded` module account now only keeps track of the not bonded tokens within staking, instead of the whole chain - - [\#3628](https://github.com/cosmos/cosmos-sdk/issues/3628) Replaced governance's burn and deposit accounts for a `ModuleAccount` - - Added a `ModuleAccount` for the distribution module - - Added a `ModuleAccount` for the mint module + * Renamed `x/distribution` `ModuleName` + * Genesis JSON and CLI now use `distribution` instead of `distr` + * Introduce `ModuleAccount` type, which tracks the flow of coins held within a module + * Replaced `FeeCollectorKeeper` for a `ModuleAccount` + * Replaced the staking `Pool`, which coins are now held by the `BondedPool` and `NotBonded` module accounts + * The `NotBonded` module account now only keeps track of the not bonded tokens within staking, instead of the whole chain + * [\#3628](https://github.com/cosmos/cosmos-sdk/issues/3628) Replaced governance's burn and deposit accounts for a `ModuleAccount` + * Added a `ModuleAccount` for the distribution module + * Added a `ModuleAccount` for the mint module [\#4472](https://github.com/cosmos/cosmos-sdk/issues/4472) validation for crisis genesis * [\#3985](https://github.com/cosmos/cosmos-sdk/issues/3985) `ValidatorPowerRank` uses potential consensus power instead of tendermint power -* [\#4104](https://github.com/cosmos/cosmos-sdk/issues/4104) Gaia has been moved to its own repository: https://github.com/cosmos/gaia +* [\#4104](https://github.com/cosmos/cosmos-sdk/issues/4104) Gaia has been moved to its own repository: * [\#4104](https://github.com/cosmos/cosmos-sdk/issues/4104) Rename gaiad.toml to app.toml. The internal contents of the application config remain unchanged. * [\#4159](https://github.com/cosmos/cosmos-sdk/issues/4159) create the default module patterns and module manager @@ -1669,22 +1675,22 @@ that error is that the account doesn't exist. * [\#4351](https://github.com/cosmos/cosmos-sdk/issues/4351) InitCmd, AddGenesisAccountCmd, and CollectGenTxsCmd take node's and client's default home directories as arguments. * [\#4387](https://github.com/cosmos/cosmos-sdk/issues/4387) Refactor the usage of tags (now called events) to reflect the new ABCI events semantics: - - Move `x/{module}/tags/tags.go` => `x/{module}/types/events.go` - - Update `docs/specs` - - Refactor tags in favor of new `Event(s)` type(s) - - Update `Context` to use new `EventManager` - - (Begin|End)Blocker no longer return tags, but rather uses new `EventManager` - - Message handlers no longer return tags, but rather uses new `EventManager` + * Move `x/{module}/tags/tags.go` => `x/{module}/types/events.go` + * Update `docs/specs` + * Refactor tags in favor of new `Event(s)` type(s) + * Update `Context` to use new `EventManager` + * (Begin|End)Blocker no longer return tags, but rather uses new `EventManager` + * Message handlers no longer return tags, but rather uses new `EventManager` Any component (e.g. BeginBlocker, message handler, etc...) wishing to emit an event must do so through `ctx.EventManger().EmitEvent(s)`. To reset or wipe emitted events: `ctx = ctx.WithEventManager(sdk.NewEventManager())` To get all emitted events: `events := ctx.EventManager().Events()` * [\#4437](https://github.com/cosmos/cosmos-sdk/issues/4437) Replace governance module store keys to use `[]byte` instead of `string`. * [\#4451](https://github.com/cosmos/cosmos-sdk/issues/4451) Improve modularization of clients and modules: - * Module directory structure improved and standardized - * Aliases autogenerated - * Auth and bank related commands are now mounted under the respective moduels - * Client initialization and mounting standardized + * Module directory structure improved and standardized + * Aliases autogenerated + * Auth and bank related commands are now mounted under the respective moduels + * Client initialization and mounting standardized * [\#4479](https://github.com/cosmos/cosmos-sdk/issues/4479) Remove codec argument redundency in client usage where the CLIContext's codec should be used instead. * [\#4488](https://github.com/cosmos/cosmos-sdk/issues/4488) Decouple client tx, REST, and ultil packages from auth. These packages have @@ -1696,9 +1702,9 @@ that error is that the account doesn't exist. * [\#4543](https://github.com/cosmos/cosmos-sdk/issues/4543) Account getters are no longer part of client.CLIContext() and have now moved to reside in the auth-specific AccountRetriever. * [\#4588](https://github.com/cosmos/cosmos-sdk/issues/4588) Context does not depend on x/auth anymore. client/context is stripped out of the following features: - - GetAccountDecoder() - - CLIContext.WithAccountDecoder() - - CLIContext.WithAccountStore() + * GetAccountDecoder() + * CLIContext.WithAccountDecoder() + * CLIContext.WithAccountStore() x/auth.AccountDecoder is unnecessary and consequently removed. * [\#4602](https://github.com/cosmos/cosmos-sdk/issues/4602) client/input.{Buffer,Override}Stdin() functions are removed. Thanks to cobra's new release they are now redundant. * [\#4633](https://github.com/cosmos/cosmos-sdk/issues/4633) Update old Tx search by tags APIs to use new Events @@ -1706,7 +1712,7 @@ that error is that the account doesn't exist. * [\#4649](https://github.com/cosmos/cosmos-sdk/issues/4649) Refactor x/crisis as per modules new specs. * [\#3685](https://github.com/cosmos/cosmos-sdk/issues/3685) The default signature verification gas logic (`DefaultSigVerificationGasConsumer`) now specifies explicit key types rather than string pattern matching. This means that zones that depended on string matching to allow other keys will need to write a custom `SignatureVerificationGasConsumer` function. * [\#4663](https://github.com/cosmos/cosmos-sdk/issues/4663) Refactor bank keeper by removing private functions - - `InputOutputCoins`, `SetCoins`, `SubtractCoins` and `AddCoins` are now part of the `SendKeeper` instead of the `Keeper` interface + * `InputOutputCoins`, `SetCoins`, `SubtractCoins` and `AddCoins` are now part of the `SendKeeper` instead of the `Keeper` interface * (tendermint) [\#4721](https://github.com/cosmos/cosmos-sdk/pull/4721) Upgrade Tendermint to v0.32.1 ### Features @@ -1741,7 +1747,7 @@ that error is that the account doesn't exist. * (simulation) Add `InitialBlockHeight` flag to resume a simulation from a given block * (simulation) [\#4670](https://github.com/cosmos/cosmos-sdk/issues/4670) Update simulation statistics to JSON format - - Support exporting the simulation stats to a given JSON file + * Support exporting the simulation stats to a given JSON file * [\#4775](https://github.com/cosmos/cosmos-sdk/issues/4775) Refactor CI config * Upgrade IAVL to v0.12.4 * (tendermint) Upgrade Tendermint to v0.32.2 @@ -1859,7 +1865,7 @@ that error is that the account doesn't exist. methods. * [\#4654](https://github.com/cosmos/cosmos-sdk/issues/4654) validator slash event stored by period and height * [\#4681](https://github.com/cosmos/cosmos-sdk/issues/4681) panic on invalid amount on `MintCoins` and `BurnCoins` - * skip minting if inflation is set to zero + * skip minting if inflation is set to zero * Sort state JSON during export and initialization ## 0.35.0 @@ -2042,17 +2048,17 @@ status and pagination query flags. #### Gaia * [\#3808](https://github.com/cosmos/cosmos-sdk/issues/3808) `gaiad` and `gaiacli` integration tests use ./build/ binaries. -* \[\#3819](https://github.com/cosmos/cosmos-sdk/issues/3819) Simulation refactor, log output now stored in ~/.gaiad/simulation/ - * Simulation moved to its own module (not a part of mock) - * Logger type instead of passing function variables everywhere - * Logger json output (for reloadable simulation running) - * Cleanup bank simulation messages / remove dup code in bank simulation - * Simulations saved in `~/.gaiad/simulations/` - * "Lean" simulation output option to exclude No-ops and !ok functions (`--SimulationLean` flag) +* [\#3819](https://github.com/cosmos/cosmos-sdk/issues/3819) Simulation refactor, log output now stored in ~/.gaiad/simulation/ + * Simulation moved to its own module (not a part of mock) + * Logger type instead of passing function variables everywhere + * Logger json output (for reloadable simulation running) + * Cleanup bank simulation messages / remove dup code in bank simulation + * Simulations saved in `~/.gaiad/simulations/` + * "Lean" simulation output option to exclude No-ops and !ok functions (`--SimulationLean` flag) * [\#3893](https://github.com/cosmos/cosmos-sdk/issues/3893) Improve `gaiacli tx sign` command - * Add shorthand flags -a and -s for the account and sequence numbers respectively - * Mark the account and sequence numbers required during "offline" mode - * Always do an RPC query for account and sequence number during "online" mode + * Add shorthand flags -a and -s for the account and sequence numbers respectively + * Mark the account and sequence numbers required during "offline" mode + * Always do an RPC query for account and sequence number during "online" mode * [\#4018](https://github.com/cosmos/cosmos-sdk/issues/4018) create genesis port script for release v.0.34.0 #### Gaia CLI @@ -2066,14 +2072,14 @@ status and pagination query flags. * [\#3238](https://github.com/cosmos/cosmos-sdk/issues/3238) Add block time to tx responses when querying for txs by tags or hash. -* \[\#3752](https://github.com/cosmos/cosmos-sdk/issues/3752) Explanatory docs for minting mechanism (`docs/spec/mint/01_concepts.md`) +* [\#3752](https://github.com/cosmos/cosmos-sdk/issues/3752) Explanatory docs for minting mechanism (`docs/spec/mint/01_concepts.md`) * [\#3801](https://github.com/cosmos/cosmos-sdk/issues/3801) `baseapp` safety improvements * [\#3820](https://github.com/cosmos/cosmos-sdk/issues/3820) Make Coins.IsAllGT() more robust and consistent. * [\#3828](https://github.com/cosmos/cosmos-sdk/issues/3828) New sdkch tool to maintain changelogs * [\#3864](https://github.com/cosmos/cosmos-sdk/issues/3864) Make Coins.IsAllGTE() more consistent. * [\#3907](https://github.com/cosmos/cosmos-sdk/issues/3907): dep -> go mod migration - * Drop dep in favor of go modules. - * Upgrade to Go 1.12.1. + * Drop dep in favor of go modules. + * Upgrade to Go 1.12.1. * [\#3917](https://github.com/cosmos/cosmos-sdk/issues/3917) Allow arbitrary decreases to validator commission rates. * [\#3937](https://github.com/cosmos/cosmos-sdk/issues/3937) Implement community pool querier. * [\#3940](https://github.com/cosmos/cosmos-sdk/issues/3940) Codespace should be lowercase. @@ -2132,144 +2138,144 @@ by accounting for rounding errors when multiplying stake by slashing fractions. BREAKING CHANGES * Gaia REST API - * [\#3641](https://github.com/cosmos/cosmos-sdk/pull/3641) Remove the ability to use a Keybase from the REST API client: - * `password` and `generate_only` have been removed from the `base_req` object - * All txs that used to sign or use the Keybase now only generate the tx - * `keys` routes completely removed - * [\#3692](https://github.com/cosmos/cosmos-sdk/pull/3692) Update tx encoding and broadcasting endpoints: - * Remove duplicate broadcasting endpoints in favor of POST @ `/txs` - * The `Tx` field now accepts a `StdTx` and not raw tx bytes - * Move encoding endpoint to `/txs/encode` + * [\#3641](https://github.com/cosmos/cosmos-sdk/pull/3641) Remove the ability to use a Keybase from the REST API client: + * `password` and `generate_only` have been removed from the `base_req` object + * All txs that used to sign or use the Keybase now only generate the tx + * `keys` routes completely removed + * [\#3692](https://github.com/cosmos/cosmos-sdk/pull/3692) Update tx encoding and broadcasting endpoints: + * Remove duplicate broadcasting endpoints in favor of POST @ `/txs` + * The `Tx` field now accepts a `StdTx` and not raw tx bytes + * Move encoding endpoint to `/txs/encode` * Gaia - * [\#3787](https://github.com/cosmos/cosmos-sdk/pull/3787) Fork the `x/bank` module into the Gaia application with only a + * [\#3787](https://github.com/cosmos/cosmos-sdk/pull/3787) Fork the `x/bank` module into the Gaia application with only a modified message handler, where the modified message handler behaves the same as the standard `x/bank` message handler except for `MsgMultiSend` that must burn exactly 9 atoms and transfer 1 atom, and `MsgSend` is disabled. - * [\#3789](https://github.com/cosmos/cosmos-sdk/pull/3789) Update validator creation flow: - * Remove `NewMsgCreateValidatorOnBehalfOf` and corresponding business logic - * Ensure the validator address equals the delegator address during + * [\#3789](https://github.com/cosmos/cosmos-sdk/pull/3789) Update validator creation flow: + * Remove `NewMsgCreateValidatorOnBehalfOf` and corresponding business logic + * Ensure the validator address equals the delegator address during `MsgCreateValidator#ValidateBasic` * SDK - * [\#3750](https://github.com/cosmos/cosmos-sdk/issues/3750) Track outstanding rewards per-validator instead of globally, + * [\#3750](https://github.com/cosmos/cosmos-sdk/issues/3750) Track outstanding rewards per-validator instead of globally, and fix the main simulation issue, which was that slashes of re-delegations to a validator were not correctly accounted for in fee distribution when the redelegation in question had itself been slashed (from a fault committed by a different validator) in the same BeginBlock. Outstanding rewards are now available on a per-validator basis in REST. - * [\#3669](https://github.com/cosmos/cosmos-sdk/pull/3669) Ensure consistency in message naming, codec registration, and JSON + * [\#3669](https://github.com/cosmos/cosmos-sdk/pull/3669) Ensure consistency in message naming, codec registration, and JSON tags. - * [\#3788](https://github.com/cosmos/cosmos-sdk/pull/3788) Change order of operations for greater accuracy when calculating delegation share token value - * [\#3788](https://github.com/cosmos/cosmos-sdk/pull/3788) DecCoins.Cap -> DecCoins.Intersect - * [\#3666](https://github.com/cosmos/cosmos-sdk/pull/3666) Improve coins denom validation. - * [\#3751](https://github.com/cosmos/cosmos-sdk/pull/3751) Disable (temporarily) support for ED25519 account key pairs. + * [\#3788](https://github.com/cosmos/cosmos-sdk/pull/3788) Change order of operations for greater accuracy when calculating delegation share token value + * [\#3788](https://github.com/cosmos/cosmos-sdk/pull/3788) DecCoins.Cap -> DecCoins.Intersect + * [\#3666](https://github.com/cosmos/cosmos-sdk/pull/3666) Improve coins denom validation. + * [\#3751](https://github.com/cosmos/cosmos-sdk/pull/3751) Disable (temporarily) support for ED25519 account key pairs. * Tendermint - * [\#3804] Update to Tendermint `v0.31.0-dev0` + * [\#3804] Update to Tendermint `v0.31.0-dev0` FEATURES * SDK - * [\#3719](https://github.com/cosmos/cosmos-sdk/issues/3719) DBBackend can now be set at compile time. + * [\#3719](https://github.com/cosmos/cosmos-sdk/issues/3719) DBBackend can now be set at compile time. Defaults: goleveldb. Supported: cleveldb. IMPROVEMENTS * Gaia REST API - * Update the `TxResponse` type allowing for the `Logs` result to be JSON decoded automatically. + * Update the `TxResponse` type allowing for the `Logs` result to be JSON decoded automatically. * Gaia CLI - * [\#3653](https://github.com/cosmos/cosmos-sdk/pull/3653) Prompt user confirmation prior to signing and broadcasting a transaction. - * [\#3670](https://github.com/cosmos/cosmos-sdk/pull/3670) CLI support for showing bech32 addresses in Ledger devices - * [\#3711](https://github.com/cosmos/cosmos-sdk/pull/3711) Update `tx sign` to use `--from` instead of the deprecated `--name` + * [\#3653](https://github.com/cosmos/cosmos-sdk/pull/3653) Prompt user confirmation prior to signing and broadcasting a transaction. + * [\#3670](https://github.com/cosmos/cosmos-sdk/pull/3670) CLI support for showing bech32 addresses in Ledger devices + * [\#3711](https://github.com/cosmos/cosmos-sdk/pull/3711) Update `tx sign` to use `--from` instead of the deprecated `--name` CLI flag. - * [\#3738](https://github.com/cosmos/cosmos-sdk/pull/3738) Improve multisig UX: - * `gaiacli keys show -o json` now includes constituent pubkeys, respective weights and threshold - * `gaiacli keys show --show-multisig` now displays constituent pubkeys, respective weights and threshold - * `gaiacli tx sign --validate-signatures` now displays multisig signers with their respective weights - * [\#3730](https://github.com/cosmos/cosmos-sdk/issues/3730) Improve workflow for + * [\#3738](https://github.com/cosmos/cosmos-sdk/pull/3738) Improve multisig UX: + * `gaiacli keys show -o json` now includes constituent pubkeys, respective weights and threshold + * `gaiacli keys show --show-multisig` now displays constituent pubkeys, respective weights and threshold + * `gaiacli tx sign --validate-signatures` now displays multisig signers with their respective weights + * [\#3730](https://github.com/cosmos/cosmos-sdk/issues/3730) Improve workflow for `gaiad gentx` with offline public keys, by outputting stdtx file that needs to be signed. - * [\#3761](https://github.com/cosmos/cosmos-sdk/issues/3761) Querying account related information using custom querier in auth module + * [\#3761](https://github.com/cosmos/cosmos-sdk/issues/3761) Querying account related information using custom querier in auth module * SDK - * [\#3753](https://github.com/cosmos/cosmos-sdk/issues/3753) Remove no-longer-used governance penalty parameter - * [\#3679](https://github.com/cosmos/cosmos-sdk/issues/3679) Consistent operators across Coins, DecCoins, Int, Dec + * [\#3753](https://github.com/cosmos/cosmos-sdk/issues/3753) Remove no-longer-used governance penalty parameter + * [\#3679](https://github.com/cosmos/cosmos-sdk/issues/3679) Consistent operators across Coins, DecCoins, Int, Dec replaced: Minus->Sub Plus->Add Div->Quo - * [\#3665](https://github.com/cosmos/cosmos-sdk/pull/3665) Overhaul sdk.Uint type in preparation for Coins Int -> Uint migration. - * [\#3691](https://github.com/cosmos/cosmos-sdk/issues/3691) Cleanup error messages - * [\#3456](https://github.com/cosmos/cosmos-sdk/issues/3456) Integrate in the Int.ToDec() convenience function - * [\#3300](https://github.com/cosmos/cosmos-sdk/pull/3300) Update the spec-spec, spec file reorg, and TOC updates. - * [\#3694](https://github.com/cosmos/cosmos-sdk/pull/3694) Push tagged docker images on docker hub when tag is created. - * [\#3716](https://github.com/cosmos/cosmos-sdk/pull/3716) Update file permissions the client keys directory and contents to `0700`. - * [\#3681](https://github.com/cosmos/cosmos-sdk/issues/3681) Migrate ledger-cosmos-go from ZondaX to Cosmos organization + * [\#3665](https://github.com/cosmos/cosmos-sdk/pull/3665) Overhaul sdk.Uint type in preparation for Coins Int -> Uint migration. + * [\#3691](https://github.com/cosmos/cosmos-sdk/issues/3691) Cleanup error messages + * [\#3456](https://github.com/cosmos/cosmos-sdk/issues/3456) Integrate in the Int.ToDec() convenience function + * [\#3300](https://github.com/cosmos/cosmos-sdk/pull/3300) Update the spec-spec, spec file reorg, and TOC updates. + * [\#3694](https://github.com/cosmos/cosmos-sdk/pull/3694) Push tagged docker images on docker hub when tag is created. + * [\#3716](https://github.com/cosmos/cosmos-sdk/pull/3716) Update file permissions the client keys directory and contents to `0700`. + * [\#3681](https://github.com/cosmos/cosmos-sdk/issues/3681) Migrate ledger-cosmos-go from ZondaX to Cosmos organization * Tendermint - * [\#3699](https://github.com/cosmos/cosmos-sdk/pull/3699) Upgrade to Tendermint 0.30.1 + * [\#3699](https://github.com/cosmos/cosmos-sdk/pull/3699) Upgrade to Tendermint 0.30.1 BUG FIXES * Gaia CLI - * [\#3731](https://github.com/cosmos/cosmos-sdk/pull/3731) `keys add --interactive` bip32 passphrase regression fix - * [\#3714](https://github.com/cosmos/cosmos-sdk/issues/3714) Fix USB raw access issues with gaiacli when installed via snap + * [\#3731](https://github.com/cosmos/cosmos-sdk/pull/3731) `keys add --interactive` bip32 passphrase regression fix + * [\#3714](https://github.com/cosmos/cosmos-sdk/issues/3714) Fix USB raw access issues with gaiacli when installed via snap * Gaia - * [\#3777](https://github.com/cosmso/cosmos-sdk/pull/3777) `gaiad export` no longer panics when the database is empty - * [\#3806](https://github.com/cosmos/cosmos-sdk/pull/3806) Properly return errors from a couple of struct Unmarshal functions + * [\#3777](https://github.com/cosmso/cosmos-sdk/pull/3777) `gaiad export` no longer panics when the database is empty + * [\#3806](https://github.com/cosmos/cosmos-sdk/pull/3806) Properly return errors from a couple of struct Unmarshal functions * SDK - * [\#3728](https://github.com/cosmos/cosmos-sdk/issues/3728) Truncate decimal multiplication & division in distribution to ensure + * [\#3728](https://github.com/cosmos/cosmos-sdk/issues/3728) Truncate decimal multiplication & division in distribution to ensure no more than the collected fees / inflation are distributed - * [\#3727](https://github.com/cosmos/cosmos-sdk/issues/3727) Return on zero-length (including []byte{}) PrefixEndBytes() calls - * [\#3559](https://github.com/cosmos/cosmos-sdk/issues/3559) fix occasional failing due to non-determinism in lcd test TestBonding + * [\#3727](https://github.com/cosmos/cosmos-sdk/issues/3727) Return on zero-length (including []byte{}) PrefixEndBytes() calls + * [\#3559](https://github.com/cosmos/cosmos-sdk/issues/3559) fix occasional failing due to non-determinism in lcd test TestBonding where validator is unexpectedly slashed throwing off test calculations - * [\#3411](https://github.com/cosmos/cosmos-sdk/pull/3411) Include the `RequestInitChain.Time` in the block header init during + * [\#3411](https://github.com/cosmos/cosmos-sdk/pull/3411) Include the `RequestInitChain.Time` in the block header init during `InitChain`. - * [\#3717](https://github.com/cosmos/cosmos-sdk/pull/3717) Update the vesting specification and implementation to cap deduction from + * [\#3717](https://github.com/cosmos/cosmos-sdk/pull/3717) Update the vesting specification and implementation to cap deduction from `DelegatedVesting` by at most `DelegatedVesting`. This accounts for the case where the undelegation amount may exceed the original delegation amount due to truncation of undelegation tokens. - * [\#3717](https://github.com/cosmos/cosmos-sdk/pull/3717) Ignore unknown proposers in allocating rewards for proposers, in case + * [\#3717](https://github.com/cosmos/cosmos-sdk/pull/3717) Ignore unknown proposers in allocating rewards for proposers, in case unbonding period was just 1 block and proposer was already deleted. - * [\#3726](https://github.com/cosmos/cosmos-sdk/pull/3724) Cap(clip) reward to remaining coins in AllocateTokens. + * [\#3726](https://github.com/cosmos/cosmos-sdk/pull/3724) Cap(clip) reward to remaining coins in AllocateTokens. ## 0.32.0 BREAKING CHANGES * Gaia REST API - * [\#3642](https://github.com/cosmos/cosmos-sdk/pull/3642) `GET /tx/{hash}` now returns `404` instead of `500` if the transaction is not found + * [\#3642](https://github.com/cosmos/cosmos-sdk/pull/3642) `GET /tx/{hash}` now returns `404` instead of `500` if the transaction is not found * SDK - * [\#3580](https://github.com/cosmos/cosmos-sdk/issues/3580) Migrate HTTP request/response types and utilities to types/rest. - * [\#3592](https://github.com/cosmos/cosmos-sdk/issues/3592) Drop deprecated keybase implementation's New() constructor in +* [\#3580](https://github.com/cosmos/cosmos-sdk/issues/3580) Migrate HTTP request/response types and utilities to types/rest. +* [\#3592](https://github.com/cosmos/cosmos-sdk/issues/3592) Drop deprecated keybase implementation's New() constructor in favor of a new crypto/keys.New(string, string) implementation that returns a lazy keybase instance. Remove client.MockKeyBase, superseded by crypto/keys.NewInMemory() - * [\#3621](https://github.com/cosmos/cosmos-sdk/issues/3621) staking.GenesisState.Bonds -> Delegations +* [\#3621](https://github.com/cosmos/cosmos-sdk/issues/3621) staking.GenesisState.Bonds -> Delegations IMPROVEMENTS * SDK - * [\#3311](https://github.com/cosmos/cosmos-sdk/pull/3311) Reconcile the `DecCoin/s` API with the `Coin/s` API. - * [\#3614](https://github.com/cosmos/cosmos-sdk/pull/3614) Add coin denom length checks to the coins constructors. - * [\#3621](https://github.com/cosmos/cosmos-sdk/issues/3621) remove many inter-module dependancies - * [\#3601](https://github.com/cosmos/cosmos-sdk/pull/3601) JSON-stringify the ABCI log response which includes the log and message + * [\#3311](https://github.com/cosmos/cosmos-sdk/pull/3311) Reconcile the `DecCoin/s` API with the `Coin/s` API. + * [\#3614](https://github.com/cosmos/cosmos-sdk/pull/3614) Add coin denom length checks to the coins constructors. + * [\#3621](https://github.com/cosmos/cosmos-sdk/issues/3621) remove many inter-module dependancies + * [\#3601](https://github.com/cosmos/cosmos-sdk/pull/3601) JSON-stringify the ABCI log response which includes the log and message index. - * [\#3604](https://github.com/cosmos/cosmos-sdk/pull/3604) Improve SDK funds related error messages and allow for unicode in + * [\#3604](https://github.com/cosmos/cosmos-sdk/pull/3604) Improve SDK funds related error messages and allow for unicode in JSON ABCI log. - * [\#3620](https://github.com/cosmos/cosmos-sdk/pull/3620) Version command shows build tags - * [\#3638](https://github.com/cosmos/cosmos-sdk/pull/3638) Add Bcrypt benchmarks & justification of security parameter choice - * [\#3648](https://github.com/cosmos/cosmos-sdk/pull/3648) Add JSON struct tags to vesting accounts. + * [\#3620](https://github.com/cosmos/cosmos-sdk/pull/3620) Version command shows build tags + * [\#3638](https://github.com/cosmos/cosmos-sdk/pull/3638) Add Bcrypt benchmarks & justification of security parameter choice + * [\#3648](https://github.com/cosmos/cosmos-sdk/pull/3648) Add JSON struct tags to vesting accounts. * Tendermint - * [\#3618](https://github.com/cosmos/cosmos-sdk/pull/3618) Upgrade to Tendermint 0.30.03 + * [\#3618](https://github.com/cosmos/cosmos-sdk/pull/3618) Upgrade to Tendermint 0.30.03 BUG FIXES * SDK - * [\#3646](https://github.com/cosmos/cosmos-sdk/issues/3646) `x/mint` now uses total token supply instead of total bonded tokens to calculate inflation + * [\#3646](https://github.com/cosmos/cosmos-sdk/issues/3646) `x/mint` now uses total token supply instead of total bonded tokens to calculate inflation ## 0.31.2 @@ -2277,7 +2283,7 @@ BUG FIXES BREAKING CHANGES * SDK - * [\#3592](https://github.com/cosmos/cosmos-sdk/issues/3592) Drop deprecated keybase implementation's +* [\#3592](https://github.com/cosmos/cosmos-sdk/issues/3592) Drop deprecated keybase implementation's New constructor in favor of a new crypto/keys.New(string, string) implementation that returns a lazy keybase instance. Remove client.MockKeyBase, @@ -2286,23 +2292,23 @@ BREAKING CHANGES IMPROVEMENTS * SDK - * [\#3604](https://github.com/cosmos/cosmos-sdk/pulls/3604) Improve SDK funds related error messages and allow for unicode in + * [\#3604](https://github.com/cosmos/cosmos-sdk/pulls/3604) Improve SDK funds related error messages and allow for unicode in JSON ABCI log. * Tendermint - * [\#3563](https://github.com/cosmos/cosmos-sdk/3563) Update to Tendermint version `0.30.0-rc0` + * [\#3563](https://github.com/cosmos/cosmos-sdk/3563) Update to Tendermint version `0.30.0-rc0` BUG FIXES * Gaia - * [\#3585] Fix setting the tx hash in `NewResponseFormatBroadcastTxCommit`. - * [\#3585] Return an empty `TxResponse` when Tendermint returns an empty + * [\#3585] Fix setting the tx hash in `NewResponseFormatBroadcastTxCommit`. + * [\#3585] Return an empty `TxResponse` when Tendermint returns an empty `ResultBroadcastTx`. * SDK - * [\#3582](https://github.com/cosmos/cosmos-sdk/pull/3582) Running `make test_unit` was failing due to a missing tag - * [\#3617](https://github.com/cosmos/cosmos-sdk/pull/3582) Fix fee comparison when the required fees does not contain any denom + * [\#3582](https://github.com/cosmos/cosmos-sdk/pull/3582) Running `make test_unit` was failing due to a missing tag + * [\#3617](https://github.com/cosmos/cosmos-sdk/pull/3582) Fix fee comparison when the required fees does not contain any denom present in the tx fees. ## 0.31.0 @@ -2310,37 +2316,37 @@ BUG FIXES BREAKING CHANGES * Gaia REST API (`gaiacli advanced rest-server`) - * [\#3284](https://github.com/cosmos/cosmos-sdk/issues/3284) Rename the `name` + * [\#3284](https://github.com/cosmos/cosmos-sdk/issues/3284) Rename the `name` field to `from` in the `base_req` body. - * [\#3485](https://github.com/cosmos/cosmos-sdk/pull/3485) Error responses are now JSON objects. - * [\#3477][distribution] endpoint changed "all_delegation_rewards" -> "delegator_total_rewards" + * [\#3485](https://github.com/cosmos/cosmos-sdk/pull/3485) Error responses are now JSON objects. + * [\#3477][distribution] endpoint changed "all_delegation_rewards" -> "delegator_total_rewards" * Gaia CLI (`gaiacli`) - - [#3399](https://github.com/cosmos/cosmos-sdk/pull/3399) Add `gaiad validate-genesis` command to facilitate checking of genesis files - - [\#1894](https://github.com/cosmos/cosmos-sdk/issues/1894) `version` prints out short info by default. Add `--long` flag. Proper handling of `--format` flag introduced. - - [\#3465](https://github.com/cosmos/cosmos-sdk/issues/3465) `gaiacli rest-server` switched back to insecure mode by default: - - `--insecure` flag is removed. - - `--tls` is now used to enable secure layer. - - [\#3451](https://github.com/cosmos/cosmos-sdk/pull/3451) `gaiacli` now returns transactions in plain text including tags. - - [\#3497](https://github.com/cosmos/cosmos-sdk/issues/3497) `gaiad init` now takes moniker as required arguments, not as parameter. - * [\#3501](https://github.com/cosmos/cosmos-sdk/issues/3501) Change validator + * [#3399](https://github.com/cosmos/cosmos-sdk/pull/3399) Add `gaiad validate-genesis` command to facilitate checking of genesis files + * [\#1894](https://github.com/cosmos/cosmos-sdk/issues/1894) `version` prints out short info by default. Add `--long` flag. Proper handling of `--format` flag introduced. + * [\#3465](https://github.com/cosmos/cosmos-sdk/issues/3465) `gaiacli rest-server` switched back to insecure mode by default: + * `--insecure` flag is removed. + * `--tls` is now used to enable secure layer. + * [\#3451](https://github.com/cosmos/cosmos-sdk/pull/3451) `gaiacli` now returns transactions in plain text including tags. + * [\#3497](https://github.com/cosmos/cosmos-sdk/issues/3497) `gaiad init` now takes moniker as required arguments, not as parameter. + * [\#3501](https://github.com/cosmos/cosmos-sdk/issues/3501) Change validator address Bech32 encoding to consensus address in `tendermint-validator-set`. * Gaia - * [\#3457](https://github.com/cosmos/cosmos-sdk/issues/3457) Changed governance tally validatorGovInfo to use sdk.Int power instead of sdk.Dec - * [\#3495](https://github.com/cosmos/cosmos-sdk/issues/3495) Added Validator Minimum Self Delegation - * Reintroduce OR semantics for tx fees + * [\#3457](https://github.com/cosmos/cosmos-sdk/issues/3457) Changed governance tally validatorGovInfo to use sdk.Int power instead of sdk.Dec + * [\#3495](https://github.com/cosmos/cosmos-sdk/issues/3495) Added Validator Minimum Self Delegation + * Reintroduce OR semantics for tx fees * SDK - * [\#2513](https://github.com/cosmos/cosmos-sdk/issues/2513) Tendermint updates are adjusted by 10^-6 relative to staking tokens, - * [\#3487](https://github.com/cosmos/cosmos-sdk/pull/3487) Move HTTP/REST utilities out of client/utils into a new dedicated client/rest package. - * [\#3490](https://github.com/cosmos/cosmos-sdk/issues/3490) ReadRESTReq() returns bool to avoid callers to write error responses twice. - * [\#3502](https://github.com/cosmos/cosmos-sdk/pull/3502) Fixes issue when comparing genesis states - * [\#3514](https://github.com/cosmos/cosmos-sdk/pull/3514) Various clean ups: - - Replace all GetKeyBase\* functions family in favor of NewKeyBaseFromDir and NewKeyBaseFromHomeFlag. - - Remove Get prefix from all TxBuilder's getters. - * [\#3522](https://github.com/cosmos/cosmos-sdk/pull/3522) Get rid of double negatives: Coins.IsNotNegative() -> Coins.IsAnyNegative(). - * [\#3561](https://github.com/cosmos/cosmos-sdk/issues/3561) Don't unnecessarily store denominations in staking + * [\#2513](https://github.com/cosmos/cosmos-sdk/issues/2513) Tendermint updates are adjusted by 10^-6 relative to staking tokens, + * [\#3487](https://github.com/cosmos/cosmos-sdk/pull/3487) Move HTTP/REST utilities out of client/utils into a new dedicated client/rest package. + * [\#3490](https://github.com/cosmos/cosmos-sdk/issues/3490) ReadRESTReq() returns bool to avoid callers to write error responses twice. + * [\#3502](https://github.com/cosmos/cosmos-sdk/pull/3502) Fixes issue when comparing genesis states + * [\#3514](https://github.com/cosmos/cosmos-sdk/pull/3514) Various clean ups: + * Replace all GetKeyBase\* functions family in favor of NewKeyBaseFromDir and NewKeyBaseFromHomeFlag. + * Remove Get prefix from all TxBuilder's getters. + * [\#3522](https://github.com/cosmos/cosmos-sdk/pull/3522) Get rid of double negatives: Coins.IsNotNegative() -> Coins.IsAnyNegative(). + * [\#3561](https://github.com/cosmos/cosmos-sdk/issues/3561) Don't unnecessarily store denominations in staking FEATURES @@ -2350,81 +2356,81 @@ FEATURES * [\#2358](https://github.com/cosmos/cosmos-sdk/issues/2358) Add distribution module REST interface * Gaia CLI (`gaiacli`) - * [\#3429](https://github.com/cosmos/cosmos-sdk/issues/3429) Support querying + * [\#3429](https://github.com/cosmos/cosmos-sdk/issues/3429) Support querying for all delegator distribution rewards. - * [\#3449](https://github.com/cosmos/cosmos-sdk/issues/3449) Proof verification now works with absence proofs - * [\#3484](https://github.com/cosmos/cosmos-sdk/issues/3484) Add support + * [\#3449](https://github.com/cosmos/cosmos-sdk/issues/3449) Proof verification now works with absence proofs + * [\#3484](https://github.com/cosmos/cosmos-sdk/issues/3484) Add support vesting accounts to the add-genesis-account command. * Gaia - - [\#3397](https://github.com/cosmos/cosmos-sdk/pull/3397) Implement genesis file sanitization to avoid failures at chain init. - * [\#3428](https://github.com/cosmos/cosmos-sdk/issues/3428) Run the simulation from a particular genesis state loaded from a file + * [\#3397](https://github.com/cosmos/cosmos-sdk/pull/3397) Implement genesis file sanitization to avoid failures at chain init. + * [\#3428](https://github.com/cosmos/cosmos-sdk/issues/3428) Run the simulation from a particular genesis state loaded from a file * SDK - * [\#3270](https://github.com/cosmos/cosmos-sdk/issues/3270) [x/staking] limit number of ongoing unbonding delegations /redelegations per pair/trio - * [\#3477][distribution] new query endpoint "delegator_validators" - * [\#3514](https://github.com/cosmos/cosmos-sdk/pull/3514) Provided a lazy loading implementation of Keybase that locks the underlying + * [\#3270](https://github.com/cosmos/cosmos-sdk/issues/3270) [x/staking] limit number of ongoing unbonding delegations /redelegations per pair/trio + * [\#3477][distribution] new query endpoint "delegator_validators" + * [\#3514](https://github.com/cosmos/cosmos-sdk/pull/3514) Provided a lazy loading implementation of Keybase that locks the underlying storage only for the time needed to perform the required operation. Also added Keybase reference to TxBuilder struct. - * [types] [\#2580](https://github.com/cosmos/cosmos-sdk/issues/2580) Addresses now Bech32 empty addresses to an empty string + * [types] [\#2580](https://github.com/cosmos/cosmos-sdk/issues/2580) Addresses now Bech32 empty addresses to an empty string IMPROVEMENTS * Gaia REST API - * [\#3284](https://github.com/cosmos/cosmos-sdk/issues/3284) Update Gaia Lite + * [\#3284](https://github.com/cosmos/cosmos-sdk/issues/3284) Update Gaia Lite REST service to support the following: - * Automatic account number and sequence population when fields are omitted - * Generate only functionality no longer requires access to a local Keybase - * `from` field in the `base_req` body can be a Keybase name or account address - * [\#3423](https://github.com/cosmos/cosmos-sdk/issues/3423) Allow simulation + * Automatic account number and sequence population when fields are omitted + * Generate only functionality no longer requires access to a local Keybase + * `from` field in the `base_req` body can be a Keybase name or account address + * [\#3423](https://github.com/cosmos/cosmos-sdk/issues/3423) Allow simulation (auto gas) to work with generate only. - * [\#3514](https://github.com/cosmos/cosmos-sdk/pull/3514) REST server calls to keybase does not lock the underlying storage anymore. - * [\#3523](https://github.com/cosmos/cosmos-sdk/pull/3523) Added `/tx/encode` endpoint to serialize a JSON tx to base64-encoded Amino. + * [\#3514](https://github.com/cosmos/cosmos-sdk/pull/3514) REST server calls to keybase does not lock the underlying storage anymore. + * [\#3523](https://github.com/cosmos/cosmos-sdk/pull/3523) Added `/tx/encode` endpoint to serialize a JSON tx to base64-encoded Amino. * Gaia CLI (`gaiacli`) - * [\#3476](https://github.com/cosmos/cosmos-sdk/issues/3476) New `withdraw-all-rewards` command to withdraw all delegations rewards for delegators. - * [\#3497](https://github.com/cosmos/cosmos-sdk/issues/3497) `gaiad gentx` supports `--ip` and `--node-id` flags to override defaults. - * [\#3518](https://github.com/cosmos/cosmos-sdk/issues/3518) Fix flow in + * [\#3476](https://github.com/cosmos/cosmos-sdk/issues/3476) New `withdraw-all-rewards` command to withdraw all delegations rewards for delegators. + * [\#3497](https://github.com/cosmos/cosmos-sdk/issues/3497) `gaiad gentx` supports `--ip` and `--node-id` flags to override defaults. + * [\#3518](https://github.com/cosmos/cosmos-sdk/issues/3518) Fix flow in `keys add` to show the mnemonic by default. - * [\#3517](https://github.com/cosmos/cosmos-sdk/pull/3517) Increased test coverage - * [\#3523](https://github.com/cosmos/cosmos-sdk/pull/3523) Added `tx encode` command to serialize a JSON tx to base64-encoded Amino. + * [\#3517](https://github.com/cosmos/cosmos-sdk/pull/3517) Increased test coverage + * [\#3523](https://github.com/cosmos/cosmos-sdk/pull/3523) Added `tx encode` command to serialize a JSON tx to base64-encoded Amino. * Gaia - * [\#3418](https://github.com/cosmos/cosmos-sdk/issues/3418) Add vesting account + * [\#3418](https://github.com/cosmos/cosmos-sdk/issues/3418) Add vesting account genesis validation checks to `GaiaValidateGenesisState`. - * [\#3420](https://github.com/cosmos/cosmos-sdk/issues/3420) Added maximum length to governance proposal descriptions and titles - * [\#3256](https://github.com/cosmos/cosmos-sdk/issues/3256) Add gas consumption + * [\#3420](https://github.com/cosmos/cosmos-sdk/issues/3420) Added maximum length to governance proposal descriptions and titles + * [\#3256](https://github.com/cosmos/cosmos-sdk/issues/3256) Add gas consumption for tx size in the ante handler. - * [\#3454](https://github.com/cosmos/cosmos-sdk/pull/3454) Add `--jail-whitelist` to `gaiad export` to enable testing of complex exports - * [\#3424](https://github.com/cosmos/cosmos-sdk/issues/3424) Allow generation of gentxs with empty memo field. - * [\#3507](https://github.com/cosmos/cosmos-sdk/issues/3507) General cleanup, removal of unnecessary struct fields, undelegation bugfix, and comment clarification in x/staking and x/slashing + * [\#3454](https://github.com/cosmos/cosmos-sdk/pull/3454) Add `--jail-whitelist` to `gaiad export` to enable testing of complex exports + * [\#3424](https://github.com/cosmos/cosmos-sdk/issues/3424) Allow generation of gentxs with empty memo field. + * [\#3507](https://github.com/cosmos/cosmos-sdk/issues/3507) General cleanup, removal of unnecessary struct fields, undelegation bugfix, and comment clarification in x/staking and x/slashing * SDK - * [\#2605] x/params add subkey accessing - * [\#2986](https://github.com/cosmos/cosmos-sdk/pull/2986) Store Refactor - * [\#3435](https://github.com/cosmos/cosmos-sdk/issues/3435) Test that store implementations do not allow nil values - * [\#2509](https://github.com/cosmos/cosmos-sdk/issues/2509) Sanitize all usage of Dec.RoundInt64() - * [\#556](https://github.com/cosmos/cosmos-sdk/issues/556) Increase `BaseApp` + * [\#2605] x/params add subkey accessing + * [\#2986](https://github.com/cosmos/cosmos-sdk/pull/2986) Store Refactor + * [\#3435](https://github.com/cosmos/cosmos-sdk/issues/3435) Test that store implementations do not allow nil values + * [\#2509](https://github.com/cosmos/cosmos-sdk/issues/2509) Sanitize all usage of Dec.RoundInt64() + * [\#556](https://github.com/cosmos/cosmos-sdk/issues/556) Increase `BaseApp` test coverage. - * [\#3357](https://github.com/cosmos/cosmos-sdk/issues/3357) develop state-transitions.md for staking spec, missing states added to `state.md` - * [\#3552](https://github.com/cosmos/cosmos-sdk/pull/3552) Validate bit length when + * [\#3357](https://github.com/cosmos/cosmos-sdk/issues/3357) develop state-transitions.md for staking spec, missing states added to `state.md` + * [\#3552](https://github.com/cosmos/cosmos-sdk/pull/3552) Validate bit length when deserializing `Int` types. BUG FIXES * Gaia CLI (`gaiacli`) - - [\#3417](https://github.com/cosmos/cosmos-sdk/pull/3417) Fix `q slashing signing-info` panic by ensuring safety of user input and properly returning not found error - - [\#3345](https://github.com/cosmos/cosmos-sdk/issues/3345) Upgrade ledger-cosmos-go dependency to v0.9.3 to pull - https://github.com/ZondaX/ledger-cosmos-go/commit/ed9aa39ce8df31bad1448c72d3d226bf2cb1a8d1 in order to fix a derivation path issue that causes `gaiacli keys add --recover` + * [\#3417](https://github.com/cosmos/cosmos-sdk/pull/3417) Fix `q slashing signing-info` panic by ensuring safety of user input and properly returning not found error + * [\#3345](https://github.com/cosmos/cosmos-sdk/issues/3345) Upgrade ledger-cosmos-go dependency to v0.9.3 to pull + in order to fix a derivation path issue that causes `gaiacli keys add --recover` to malfunction. - - [\#3419](https://github.com/cosmos/cosmos-sdk/pull/3419) Fix `q distr slashes` panic - - [\#3453](https://github.com/cosmos/cosmos-sdk/pull/3453) The `rest-server` command didn't respect persistent flags such as `--chain-id` and `--trust-node` if they were + * [\#3419](https://github.com/cosmos/cosmos-sdk/pull/3419) Fix `q distr slashes` panic + * [\#3453](https://github.com/cosmos/cosmos-sdk/pull/3453) The `rest-server` command didn't respect persistent flags such as `--chain-id` and `--trust-node` if they were passed on the command line. - - [\#3441](https://github.com/cosmos/cosmos-sdk/pull/3431) Improved resource management and connection handling (ledger devices). Fixes issue with DER vs BER signatures. + * [\#3441](https://github.com/cosmos/cosmos-sdk/pull/3431) Improved resource management and connection handling (ledger devices). Fixes issue with DER vs BER signatures. * Gaia - * [\#3486](https://github.com/cosmos/cosmos-sdk/pull/3486) Use AmountOf in + * [\#3486](https://github.com/cosmos/cosmos-sdk/pull/3486) Use AmountOf in vesting accounts instead of zipping/aligning denominations. @@ -2433,147 +2439,147 @@ BUG FIXES BREAKING CHANGES * Gaia REST API (`gaiacli advanced rest-server`) - * [gaia-lite] [\#2182] Renamed and merged all redelegations endpoints into `/staking/redelegations` - * [\#3176](https://github.com/cosmos/cosmos-sdk/issues/3176) `tx/sign` endpoint now expects `BaseReq` fields as nested object. - * [\#2222] all endpoints renamed from `/stake` -> `/staking` - * [\#1268] `LooseTokens` -> `NotBondedTokens` - * [\#3289] misc renames: - * `Validator.UnbondingMinTime` -> `Validator.UnbondingCompletionTime` - * `Delegation` -> `Value` in `MsgCreateValidator` and `MsgDelegate` - * `MsgBeginUnbonding` -> `MsgUndelegate` + * [gaia-lite] [\#2182] Renamed and merged all redelegations endpoints into `/staking/redelegations` + * [\#3176](https://github.com/cosmos/cosmos-sdk/issues/3176) `tx/sign` endpoint now expects `BaseReq` fields as nested object. + * [\#2222] all endpoints renamed from `/stake` -> `/staking` + * [\#1268] `LooseTokens` -> `NotBondedTokens` + * [\#3289] misc renames: + * `Validator.UnbondingMinTime` -> `Validator.UnbondingCompletionTime` + * `Delegation` -> `Value` in `MsgCreateValidator` and `MsgDelegate` + * `MsgBeginUnbonding` -> `MsgUndelegate` * Gaia CLI (`gaiacli`) - * [\#810](https://github.com/cosmos/cosmos-sdk/issues/810) Don't fallback to any default values for chain ID. - * Users need to supply chain ID either via config file or the `--chain-id` flag. - * Change `chain_id` and `trust_node` in `gaiacli` configuration to `chain-id` and `trust-node` respectively. - * [\#3069](https://github.com/cosmos/cosmos-sdk/pull/3069) `--fee` flag renamed to `--fees` to support multiple coins - * [\#3156](https://github.com/cosmos/cosmos-sdk/pull/3156) Remove unimplemented `gaiacli init` command - * [\#2222] `gaiacli tx stake` -> `gaiacli tx staking`, `gaiacli query stake` -> `gaiacli query staking` - * [\#1894](https://github.com/cosmos/cosmos-sdk/issues/1894) `version` command now shows latest commit, vendor dir hash, and build machine info. - * [\#3320](https://github.com/cosmos/cosmos-sdk/pull/3320) Ensure all `gaiacli query` commands respect the `--output` and `--indent` flags + * [\#810](https://github.com/cosmos/cosmos-sdk/issues/810) Don't fallback to any default values for chain ID. + * Users need to supply chain ID either via config file or the `--chain-id` flag. + * Change `chain_id` and `trust_node` in `gaiacli` configuration to `chain-id` and `trust-node` respectively. + * [\#3069](https://github.com/cosmos/cosmos-sdk/pull/3069) `--fee` flag renamed to `--fees` to support multiple coins + * [\#3156](https://github.com/cosmos/cosmos-sdk/pull/3156) Remove unimplemented `gaiacli init` command + * [\#2222] `gaiacli tx stake` -> `gaiacli tx staking`, `gaiacli query stake` -> `gaiacli query staking` + * [\#1894](https://github.com/cosmos/cosmos-sdk/issues/1894) `version` command now shows latest commit, vendor dir hash, and build machine info. + * [\#3320](https://github.com/cosmos/cosmos-sdk/pull/3320) Ensure all `gaiacli query` commands respect the `--output` and `--indent` flags * Gaia - * https://github.com/cosmos/cosmos-sdk/issues/2838 - Move store keys to constants - * [\#3162](https://github.com/cosmos/cosmos-sdk/issues/3162) The `--gas` flag now takes `auto` instead of `simulate` + * - Move store keys to constants + * [\#3162](https://github.com/cosmos/cosmos-sdk/issues/3162) The `--gas` flag now takes `auto` instead of `simulate` in order to trigger a simulation of the tx before the actual execution. - * [\#3285](https://github.com/cosmos/cosmos-sdk/pull/3285) New `gaiad tendermint version` to print libs versions - * [\#1894](https://github.com/cosmos/cosmos-sdk/pull/1894) `version` command now shows latest commit, vendor dir hash, and build machine info. - * [\#3249\(https://github.com/cosmos/cosmos-sdk/issues/3249) `tendermint`'s `show-validator` and `show-address` `--json` flags removed in favor of `--output-format=json`. + * [\#3285](https://github.com/cosmos/cosmos-sdk/pull/3285) New `gaiad tendermint version` to print libs versions + * [\#1894](https://github.com/cosmos/cosmos-sdk/pull/1894) `version` command now shows latest commit, vendor dir hash, and build machine info. + * [\#3249](https://github.com/cosmos/cosmos-sdk/issues/3249) `tendermint`'s `show-validator` and `show-address` `--json` flags removed in favor of `--output-format=json`. * SDK - * [distribution] [\#3359](https://github.com/cosmos/cosmos-sdk/issues/3359) Always round down when calculating rewards-to-be-withdrawn in F1 fee distribution - * [#3336](https://github.com/cosmos/cosmos-sdk/issues/3336) Ensure all SDK + * [distribution] [\#3359](https://github.com/cosmos/cosmos-sdk/issues/3359) Always round down when calculating rewards-to-be-withdrawn in F1 fee distribution + * [#3336](https://github.com/cosmos/cosmos-sdk/issues/3336) Ensure all SDK messages have their signature bytes contain canonical fields `value` and `type`. - * [\#3333](https://github.com/cosmos/cosmos-sdk/issues/3333) - F1 storage efficiency improvements - automatic withdrawals when unbonded, historical reward reference counting - * [staking] [\#2513](https://github.com/cosmos/cosmos-sdk/issues/2513) Validator power type from Dec -> Int - * [staking] [\#3233](https://github.com/cosmos/cosmos-sdk/issues/3233) key and value now contain duplicate fields to simplify code - * [\#3064](https://github.com/cosmos/cosmos-sdk/issues/3064) Sanitize `sdk.Coin` denom. Coins denoms are now case insensitive, i.e. 100fooToken equals to 100FOOTOKEN. - * [\#3195](https://github.com/cosmos/cosmos-sdk/issues/3195) Allows custom configuration for syncable strategy - * [\#3242](https://github.com/cosmos/cosmos-sdk/issues/3242) Fix infinite gas + * [\#3333](https://github.com/cosmos/cosmos-sdk/issues/3333) - F1 storage efficiency improvements - automatic withdrawals when unbonded, historical reward reference counting + * [staking] [\#2513](https://github.com/cosmos/cosmos-sdk/issues/2513) Validator power type from Dec -> Int + * [staking] [\#3233](https://github.com/cosmos/cosmos-sdk/issues/3233) key and value now contain duplicate fields to simplify code + * [\#3064](https://github.com/cosmos/cosmos-sdk/issues/3064) Sanitize `sdk.Coin` denom. Coins denoms are now case insensitive, i.e. 100fooToken equals to 100FOOTOKEN. + * [\#3195](https://github.com/cosmos/cosmos-sdk/issues/3195) Allows custom configuration for syncable strategy + * [\#3242](https://github.com/cosmos/cosmos-sdk/issues/3242) Fix infinite gas meter utilization during aborted ante handler executions. - * [x/distribution] [\#3292](https://github.com/cosmos/cosmos-sdk/issues/3292) Enable or disable withdraw addresses with a parameter in the param store - * [staking] [\#2222](https://github.com/cosmos/cosmos-sdk/issues/2222) `/stake` -> `/staking` module rename - * [staking] [\#1268](https://github.com/cosmos/cosmos-sdk/issues/1268) `LooseTokens` -> `NotBondedTokens` - * [staking] [\#1402](https://github.com/cosmos/cosmos-sdk/issues/1402) Redelegation and unbonding-delegation structs changed to include multiple an array of entries - * [staking] [\#3289](https://github.com/cosmos/cosmos-sdk/issues/3289) misc renames: - * `Validator.UnbondingMinTime` -> `Validator.UnbondingCompletionTime` - * `Delegation` -> `Value` in `MsgCreateValidator` and `MsgDelegate` - * `MsgBeginUnbonding` -> `MsgUndelegate` - * [\#3315] Increase decimal precision to 18 - * [\#3323](https://github.com/cosmos/cosmos-sdk/issues/3323) Update to Tendermint 0.29.0 - * [\#3328](https://github.com/cosmos/cosmos-sdk/issues/3328) [x/gov] Remove redundant action tag + * [x/distribution] [\#3292](https://github.com/cosmos/cosmos-sdk/issues/3292) Enable or disable withdraw addresses with a parameter in the param store + * [staking] [\#2222](https://github.com/cosmos/cosmos-sdk/issues/2222) `/stake` -> `/staking` module rename + * [staking] [\#1268](https://github.com/cosmos/cosmos-sdk/issues/1268) `LooseTokens` -> `NotBondedTokens` + * [staking] [\#1402](https://github.com/cosmos/cosmos-sdk/issues/1402) Redelegation and unbonding-delegation structs changed to include multiple an array of entries + * [staking] [\#3289](https://github.com/cosmos/cosmos-sdk/issues/3289) misc renames: + * `Validator.UnbondingMinTime` -> `Validator.UnbondingCompletionTime` + * `Delegation` -> `Value` in `MsgCreateValidator` and `MsgDelegate` + * `MsgBeginUnbonding` -> `MsgUndelegate` + * [\#3315] Increase decimal precision to 18 + * [\#3323](https://github.com/cosmos/cosmos-sdk/issues/3323) Update to Tendermint 0.29.0 + * [\#3328](https://github.com/cosmos/cosmos-sdk/issues/3328) [x/gov] Remove redundant action tag * Tendermint - * [\#3298](https://github.com/cosmos/cosmos-sdk/issues/3298) Upgrade to Tendermint 0.28.0 + * [\#3298](https://github.com/cosmos/cosmos-sdk/issues/3298) Upgrade to Tendermint 0.28.0 FEATURES * Gaia REST API (`gaiacli advanced rest-server`) - * [\#3067](https://github.com/cosmos/cosmos-sdk/issues/3067) Add support for fees on transactions - * [\#3069](https://github.com/cosmos/cosmos-sdk/pull/3069) Add a custom memo on transactions - * [\#3027](https://github.com/cosmos/cosmos-sdk/issues/3027) Implement + * [\#3067](https://github.com/cosmos/cosmos-sdk/issues/3067) Add support for fees on transactions + * [\#3069](https://github.com/cosmos/cosmos-sdk/pull/3069) Add a custom memo on transactions + * [\#3027](https://github.com/cosmos/cosmos-sdk/issues/3027) Implement `/gov/proposals/{proposalID}/proposer` to query for a proposal's proposer. * Gaia CLI (`gaiacli`) - * [\#2399](https://github.com/cosmos/cosmos-sdk/issues/2399) Implement `params` command to query slashing parameters. - * [\#2730](https://github.com/cosmos/cosmos-sdk/issues/2730) Add tx search pagination parameter - * [\#3027](https://github.com/cosmos/cosmos-sdk/issues/3027) Implement + * [\#2399](https://github.com/cosmos/cosmos-sdk/issues/2399) Implement `params` command to query slashing parameters. + * [\#2730](https://github.com/cosmos/cosmos-sdk/issues/2730) Add tx search pagination parameter + * [\#3027](https://github.com/cosmos/cosmos-sdk/issues/3027) Implement `query gov proposer [proposal-id]` to query for a proposal's proposer. - * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `keys add --multisig` flag to store multisig keys locally. - * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `multisign` command to generate multisig signatures. - * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `sign --multisig` flag to enable multisig mode. - * [\#2715](https://github.com/cosmos/cosmos-sdk/issues/2715) Reintroduce gaia server's insecure mode. - * [\#3334](https://github.com/cosmos/cosmos-sdk/pull/3334) New `gaiad completion` and `gaiacli completion` to generate Bash/Zsh completion scripts. - * [\#2607](https://github.com/cosmos/cosmos-sdk/issues/2607) Make `gaiacli config` handle the boolean `indent` flag to beautify commands JSON output. + * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `keys add --multisig` flag to store multisig keys locally. + * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `multisign` command to generate multisig signatures. + * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) New `sign --multisig` flag to enable multisig mode. + * [\#2715](https://github.com/cosmos/cosmos-sdk/issues/2715) Reintroduce gaia server's insecure mode. + * [\#3334](https://github.com/cosmos/cosmos-sdk/pull/3334) New `gaiad completion` and `gaiacli completion` to generate Bash/Zsh completion scripts. + * [\#2607](https://github.com/cosmos/cosmos-sdk/issues/2607) Make `gaiacli config` handle the boolean `indent` flag to beautify commands JSON output. * Gaia - * [\#2182] [x/staking] Added querier for querying a single redelegation - * [\#3305](https://github.com/cosmos/cosmos-sdk/issues/3305) Add support for + * [\#2182] [x/staking] Added querier for querying a single redelegation + * [\#3305](https://github.com/cosmos/cosmos-sdk/issues/3305) Add support for vesting accounts at genesis. - * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) [x/auth] Add multisig transactions support - * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) `add-genesis-account` can take both account addresses and key names + * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) [x/auth] Add multisig transactions support + * [\#3198](https://github.com/cosmos/cosmos-sdk/issues/3198) `add-genesis-account` can take both account addresses and key names * SDK - - [\#3099](https://github.com/cosmos/cosmos-sdk/issues/3099) Implement F1 fee distribution - - [\#2926](https://github.com/cosmos/cosmos-sdk/issues/2926) Add TxEncoder to client TxBuilder. - * [\#2694](https://github.com/cosmos/cosmos-sdk/issues/2694) Vesting account implementation. - * [\#2996](https://github.com/cosmos/cosmos-sdk/issues/2996) Update the `AccountKeeper` to contain params used in the context of + * [\#3099](https://github.com/cosmos/cosmos-sdk/issues/3099) Implement F1 fee distribution + * [\#2926](https://github.com/cosmos/cosmos-sdk/issues/2926) Add TxEncoder to client TxBuilder. + * [\#2694](https://github.com/cosmos/cosmos-sdk/issues/2694) Vesting account implementation. + * [\#2996](https://github.com/cosmos/cosmos-sdk/issues/2996) Update the `AccountKeeper` to contain params used in the context of the ante handler. - * [\#3179](https://github.com/cosmos/cosmos-sdk/pull/3179) New CodeNoSignatures error code. - * [\#3319](https://github.com/cosmos/cosmos-sdk/issues/3319) [x/distribution] Queriers for all distribution state worth querying; distribution query commands - * [\#3356](https://github.com/cosmos/cosmos-sdk/issues/3356) [x/auth] bech32-ify accounts address in error message. + * [\#3179](https://github.com/cosmos/cosmos-sdk/pull/3179) New CodeNoSignatures error code. + * [\#3319](https://github.com/cosmos/cosmos-sdk/issues/3319) [x/distribution] Queriers for all distribution state worth querying; distribution query commands + * [\#3356](https://github.com/cosmos/cosmos-sdk/issues/3356) [x/auth] bech32-ify accounts address in error message. IMPROVEMENTS * Gaia REST API - * [\#3176](https://github.com/cosmos/cosmos-sdk/issues/3176) Validate tx/sign endpoint POST body. - * [\#2948](https://github.com/cosmos/cosmos-sdk/issues/2948) Swagger UI now makes requests to light client node + * [\#3176](https://github.com/cosmos/cosmos-sdk/issues/3176) Validate tx/sign endpoint POST body. + * [\#2948](https://github.com/cosmos/cosmos-sdk/issues/2948) Swagger UI now makes requests to light client node * Gaia CLI (`gaiacli`) - * [\#3224](https://github.com/cosmos/cosmos-sdk/pull/3224) Support adding offline public keys to the keystore + * [\#3224](https://github.com/cosmos/cosmos-sdk/pull/3224) Support adding offline public keys to the keystore * Gaia - * [\#2186](https://github.com/cosmos/cosmos-sdk/issues/2186) Add Address Interface - * [\#3158](https://github.com/cosmos/cosmos-sdk/pull/3158) Validate slashing genesis - * [\#3172](https://github.com/cosmos/cosmos-sdk/pull/3172) Support minimum fees in a local testnet. - * [\#3250](https://github.com/cosmos/cosmos-sdk/pull/3250) Refactor integration tests and increase coverage - * [\#3248](https://github.com/cosmos/cosmos-sdk/issues/3248) Refactor tx fee + * [\#2186](https://github.com/cosmos/cosmos-sdk/issues/2186) Add Address Interface + * [\#3158](https://github.com/cosmos/cosmos-sdk/pull/3158) Validate slashing genesis + * [\#3172](https://github.com/cosmos/cosmos-sdk/pull/3172) Support minimum fees in a local testnet. + * [\#3250](https://github.com/cosmos/cosmos-sdk/pull/3250) Refactor integration tests and increase coverage + * [\#3248](https://github.com/cosmos/cosmos-sdk/issues/3248) Refactor tx fee model: - * Validators specify minimum gas prices instead of minimum fees - * Clients may provide either fees or gas prices directly - * The gas prices of a tx must meet a validator's minimum - * `gaiad start` and `gaia.toml` take --minimum-gas-prices flag and minimum-gas-price config key respectively. - * [\#2859](https://github.com/cosmos/cosmos-sdk/issues/2859) Rename `TallyResult` in gov proposals to `FinalTallyResult` - * [\#3286](https://github.com/cosmos/cosmos-sdk/pull/3286) Fix `gaiad gentx` printout of account's addresses, i.e. user bech32 instead of hex. - * [\#3249\(https://github.com/cosmos/cosmos-sdk/issues/3249) `--json` flag removed, users should use `--output=json` instead. + * Validators specify minimum gas prices instead of minimum fees + * Clients may provide either fees or gas prices directly + * The gas prices of a tx must meet a validator's minimum + * `gaiad start` and `gaia.toml` take --minimum-gas-prices flag and minimum-gas-price config key respectively. + * [\#2859](https://github.com/cosmos/cosmos-sdk/issues/2859) Rename `TallyResult` in gov proposals to `FinalTallyResult` + * [\#3286](https://github.com/cosmos/cosmos-sdk/pull/3286) Fix `gaiad gentx` printout of account's addresses, i.e. user bech32 instead of hex. + * [\#3249](https://github.com/cosmos/cosmos-sdk/issues/3249) `--json` flag removed, users should use `--output=json` instead. * SDK - * [\#3137](https://github.com/cosmos/cosmos-sdk/pull/3137) Add tag documentation + * [\#3137](https://github.com/cosmos/cosmos-sdk/pull/3137) Add tag documentation for each module along with cleaning up a few existing tags in the governance, slashing, and staking modules. - * [\#3093](https://github.com/cosmos/cosmos-sdk/issues/3093) Ante handler does no longer read all accounts in one go when processing signatures as signature + * [\#3093](https://github.com/cosmos/cosmos-sdk/issues/3093) Ante handler does no longer read all accounts in one go when processing signatures as signature verification may fail before last signature is checked. - * [staking] [\#1402](https://github.com/cosmos/cosmos-sdk/issues/1402) Add for multiple simultaneous redelegations or unbonding-delegations within an unbonding period - * [staking] [\#1268](https://github.com/cosmos/cosmos-sdk/issues/1268) staking spec rewrite + * [staking] [\#1402](https://github.com/cosmos/cosmos-sdk/issues/1402) Add for multiple simultaneous redelegations or unbonding-delegations within an unbonding period + * [staking] [\#1268](https://github.com/cosmos/cosmos-sdk/issues/1268) staking spec rewrite * CI - * [\#2498](https://github.com/cosmos/cosmos-sdk/issues/2498) Added macos CI job to CircleCI - * [#142](https://github.com/tendermint/devops/issues/142) Increased the number of blocks to be tested during multi-sim - * [#147](https://github.com/tendermint/devops/issues/142) Added docker image build to CI + * [\#2498](https://github.com/cosmos/cosmos-sdk/issues/2498) Added macos CI job to CircleCI + * [#142](https://github.com/tendermint/devops/issues/142) Increased the number of blocks to be tested during multi-sim + * [#147](https://github.com/tendermint/devops/issues/142) Added docker image build to CI BUG FIXES * Gaia CLI (`gaiacli`) - * [\#3141](https://github.com/cosmos/cosmos-sdk/issues/3141) Fix the bug in GetAccount when `len(res) == 0` and `err == nil` - * [\#810](https://github.com/cosmos/cosmos-sdk/pull/3316) Fix regression in gaiacli config file handling + * [\#3141](https://github.com/cosmos/cosmos-sdk/issues/3141) Fix the bug in GetAccount when `len(res) == 0` and `err == nil` + * [\#810](https://github.com/cosmos/cosmos-sdk/pull/3316) Fix regression in gaiacli config file handling * Gaia - * [\#3148](https://github.com/cosmos/cosmos-sdk/issues/3148) Fix `gaiad export` by adding a boolean to `NewGaiaApp` determining whether or not to load the latest version - * [\#3181](https://github.com/cosmos/cosmos-sdk/issues/3181) Correctly reset total accum update height and jailed-validator bond height / unbonding height on export-for-zero-height - * [\#3172](https://github.com/cosmos/cosmos-sdk/pull/3172) Fix parsing `gaiad.toml` + * [\#3148](https://github.com/cosmos/cosmos-sdk/issues/3148) Fix `gaiad export` by adding a boolean to `NewGaiaApp` determining whether or not to load the latest version + * [\#3181](https://github.com/cosmos/cosmos-sdk/issues/3181) Correctly reset total accum update height and jailed-validator bond height / unbonding height on export-for-zero-height + * [\#3172](https://github.com/cosmos/cosmos-sdk/pull/3172) Fix parsing `gaiad.toml` when it already exists. - * [\#3223](https://github.com/cosmos/cosmos-sdk/issues/3223) Fix unset governance proposal queues when importing state from old chain - * [#3187](https://github.com/cosmos/cosmos-sdk/issues/3187) Fix `gaiad export` + * [\#3223](https://github.com/cosmos/cosmos-sdk/issues/3223) Fix unset governance proposal queues when importing state from old chain + * [#3187](https://github.com/cosmos/cosmos-sdk/issues/3187) Fix `gaiad export` by resetting each validator's slashing period. ## 0.29.1 @@ -2581,17 +2587,17 @@ BUG FIXES BUG FIXES * SDK - * [\#3207](https://github.com/cosmos/cosmos-sdk/issues/3207) - Fix token printing bug + * [\#3207](https://github.com/cosmos/cosmos-sdk/issues/3207) - Fix token printing bug ## 0.29.0 BREAKING CHANGES * Gaia - * [\#3148](https://github.com/cosmos/cosmos-sdk/issues/3148) Fix `gaiad export` by adding a boolean to `NewGaiaApp` determining whether or not to load the latest version + * [\#3148](https://github.com/cosmos/cosmos-sdk/issues/3148) Fix `gaiad export` by adding a boolean to `NewGaiaApp` determining whether or not to load the latest version * SDK - * [\#3163](https://github.com/cosmos/cosmos-sdk/issues/3163) Withdraw commission on self bond removal + * [\#3163](https://github.com/cosmos/cosmos-sdk/issues/3163) Withdraw commission on self bond removal ## 0.28.1 @@ -2599,35 +2605,35 @@ BREAKING CHANGES BREAKING CHANGES * Gaia REST API (`gaiacli advanced rest-server`) - * [lcd] [\#3045](https://github.com/cosmos/cosmos-sdk/pull/3045) Fix quoted json return on GET /keys (keys list) - * [gaia-lite] [\#2191](https://github.com/cosmos/cosmos-sdk/issues/2191) Split `POST /stake/delegators/{delegatorAddr}/delegations` into `POST /stake/delegators/{delegatorAddr}/delegations`, `POST /stake/delegators/{delegatorAddr}/unbonding_delegations` and `POST /stake/delegators/{delegatorAddr}/redelegations` - * [gaia-lite] [\#3056](https://github.com/cosmos/cosmos-sdk/pull/3056) `generate_only` and `simulate` have moved from query arguments to POST requests body. + * [lcd] [\#3045](https://github.com/cosmos/cosmos-sdk/pull/3045) Fix quoted json return on GET /keys (keys list) + * [gaia-lite] [\#2191](https://github.com/cosmos/cosmos-sdk/issues/2191) Split `POST /stake/delegators/{delegatorAddr}/delegations` into `POST /stake/delegators/{delegatorAddr}/delegations`, `POST /stake/delegators/{delegatorAddr}/unbonding_delegations` and `POST /stake/delegators/{delegatorAddr}/redelegations` + * [gaia-lite] [\#3056](https://github.com/cosmos/cosmos-sdk/pull/3056) `generate_only` and `simulate` have moved from query arguments to POST requests body. * Tendermint - * [tendermint] Now using Tendermint 0.27.3 + * [tendermint] Now using Tendermint 0.27.3 FEATURES * Gaia REST API (`gaiacli advanced rest-server`) - * [slashing] [\#2399](https://github.com/cosmos/cosmos-sdk/issues/2399) Implement `/slashing/parameters` endpoint to query slashing parameters. + * [slashing] [\#2399](https://github.com/cosmos/cosmos-sdk/issues/2399) Implement `/slashing/parameters` endpoint to query slashing parameters. * Gaia CLI (`gaiacli`) - * [gaiacli] [\#2399](https://github.com/cosmos/cosmos-sdk/issues/2399) Implement `params` command to query slashing parameters. + * [gaiacli] [\#2399](https://github.com/cosmos/cosmos-sdk/issues/2399) Implement `params` command to query slashing parameters. * SDK - - [client] [\#2926](https://github.com/cosmos/cosmos-sdk/issues/2926) Add TxEncoder to client TxBuilder. + * [client] [\#2926](https://github.com/cosmos/cosmos-sdk/issues/2926) Add TxEncoder to client TxBuilder. * Other - - Introduced the logjack tool for saving logs w/ rotation + * Introduced the logjack tool for saving logs w/ rotation IMPROVEMENTS * Gaia REST API (`gaiacli advanced rest-server`) - * [\#2879](https://github.com/cosmos/cosmos-sdk/issues/2879), [\#2880](https://github.com/cosmos/cosmos-sdk/issues/2880) Update deposit and vote endpoints to perform a direct txs query + * [\#2879](https://github.com/cosmos/cosmos-sdk/issues/2879), [\#2880](https://github.com/cosmos/cosmos-sdk/issues/2880) Update deposit and vote endpoints to perform a direct txs query when a given proposal is inactive and thus having votes and deposits removed from state. * Gaia CLI (`gaiacli`) - * [\#2879](https://github.com/cosmos/cosmos-sdk/issues/2879), [\#2880](https://github.com/cosmos/cosmos-sdk/issues/2880) Update deposit and vote CLI commands to perform a direct txs query + * [\#2879](https://github.com/cosmos/cosmos-sdk/issues/2879), [\#2880](https://github.com/cosmos/cosmos-sdk/issues/2880) Update deposit and vote CLI commands to perform a direct txs query when a given proposal is inactive and thus having votes and deposits removed from state. * Gaia - * [\#3021](https://github.com/cosmos/cosmos-sdk/pull/3021) Add `--gentx-dir` to `gaiad collect-gentxs` to specify a directory from which collect and load gentxs. Add `--output-document` to `gaiad init` to allow one to redirect output to file. + * [\#3021](https://github.com/cosmos/cosmos-sdk/pull/3021) Add `--gentx-dir` to `gaiad collect-gentxs` to specify a directory from which collect and load gentxs. Add `--output-document` to `gaiad init` to allow one to redirect output to file. ## 0.28.0 @@ -2635,54 +2641,54 @@ IMPROVEMENTS BREAKING CHANGES * Gaia CLI (`gaiacli`) - * [cli] [\#2595](https://github.com/cosmos/cosmos-sdk/issues/2595) Remove `keys new` in favor of `keys add` incorporating existing functionality with addition of key recovery functionality. - * [cli] [\#2987](https://github.com/cosmos/cosmos-sdk/pull/2987) Add shorthand `-a` to `gaiacli keys show` and update docs - * [cli] [\#2971](https://github.com/cosmos/cosmos-sdk/pull/2971) Additional verification when running `gaiad gentx` - * [cli] [\#2734](https://github.com/cosmos/cosmos-sdk/issues/2734) Rewrite `gaiacli config`. It is now a non-interactive config utility. + * [cli] [\#2595](https://github.com/cosmos/cosmos-sdk/issues/2595) Remove `keys new` in favor of `keys add` incorporating existing functionality with addition of key recovery functionality. + * [cli] [\#2987](https://github.com/cosmos/cosmos-sdk/pull/2987) Add shorthand `-a` to `gaiacli keys show` and update docs + * [cli] [\#2971](https://github.com/cosmos/cosmos-sdk/pull/2971) Additional verification when running `gaiad gentx` + * [cli] [\#2734](https://github.com/cosmos/cosmos-sdk/issues/2734) Rewrite `gaiacli config`. It is now a non-interactive config utility. * Gaia - * [#128](https://github.com/tendermint/devops/issues/128) Updated CircleCI job to trigger website build on every push to master/develop. - * [\#2994](https://github.com/cosmos/cosmos-sdk/pull/2994) Change wrong-password error message. - * [\#3009](https://github.com/cosmos/cosmos-sdk/issues/3009) Added missing Gaia genesis verification - * [#128](https://github.com/tendermint/devops/issues/128) Updated CircleCI job to trigger website build on every push to master/develop. - * [\#2994](https://github.com/cosmos/cosmos-sdk/pull/2994) Change wrong-password error message. - * [\#3009](https://github.com/cosmos/cosmos-sdk/issues/3009) Added missing Gaia genesis verification - * [gas] [\#3052](https://github.com/cosmos/cosmos-sdk/issues/3052) Updated gas costs to more reasonable numbers + * [#128](https://github.com/tendermint/devops/issues/128) Updated CircleCI job to trigger website build on every push to master/develop. + * [\#2994](https://github.com/cosmos/cosmos-sdk/pull/2994) Change wrong-password error message. + * [\#3009](https://github.com/cosmos/cosmos-sdk/issues/3009) Added missing Gaia genesis verification + * [#128](https://github.com/tendermint/devops/issues/128) Updated CircleCI job to trigger website build on every push to master/develop. + * [\#2994](https://github.com/cosmos/cosmos-sdk/pull/2994) Change wrong-password error message. + * [\#3009](https://github.com/cosmos/cosmos-sdk/issues/3009) Added missing Gaia genesis verification + * [gas] [\#3052](https://github.com/cosmos/cosmos-sdk/issues/3052) Updated gas costs to more reasonable numbers * SDK - * [auth] [\#2952](https://github.com/cosmos/cosmos-sdk/issues/2952) Signatures are no longer serialized on chain with the account number and sequence number - * [auth] [\#2952](https://github.com/cosmos/cosmos-sdk/issues/2952) Signatures are no longer serialized on chain with the account number and sequence number - * [stake] [\#3055](https://github.com/cosmos/cosmos-sdk/issues/3055) Use address instead of bond height / intratxcounter for deduplication + * [auth] [\#2952](https://github.com/cosmos/cosmos-sdk/issues/2952) Signatures are no longer serialized on chain with the account number and sequence number + * [auth] [\#2952](https://github.com/cosmos/cosmos-sdk/issues/2952) Signatures are no longer serialized on chain with the account number and sequence number + * [stake] [\#3055](https://github.com/cosmos/cosmos-sdk/issues/3055) Use address instead of bond height / intratxcounter for deduplication FEATURES * Gaia CLI (`gaiacli`) - * [\#2961](https://github.com/cosmos/cosmos-sdk/issues/2961) Add --force flag to gaiacli keys delete command to skip passphrase check and force key deletion unconditionally. + * [\#2961](https://github.com/cosmos/cosmos-sdk/issues/2961) Add --force flag to gaiacli keys delete command to skip passphrase check and force key deletion unconditionally. IMPROVEMENTS * Gaia CLI (`gaiacli`) - * [\#2991](https://github.com/cosmos/cosmos-sdk/issues/2991) Fully validate transaction signatures during `gaiacli tx sign --validate-signatures` + * [\#2991](https://github.com/cosmos/cosmos-sdk/issues/2991) Fully validate transaction signatures during `gaiacli tx sign --validate-signatures` * SDK - * [\#1277](https://github.com/cosmos/cosmos-sdk/issues/1277) Complete bank module specification - * [\#2963](https://github.com/cosmos/cosmos-sdk/issues/2963) Complete auth module specification - * [\#2914](https://github.com/cosmos/cosmos-sdk/issues/2914) No longer withdraw validator rewards on bond/unbond, but rather move + * [\#1277](https://github.com/cosmos/cosmos-sdk/issues/1277) Complete bank module specification + * [\#2963](https://github.com/cosmos/cosmos-sdk/issues/2963) Complete auth module specification + * [\#2914](https://github.com/cosmos/cosmos-sdk/issues/2914) No longer withdraw validator rewards on bond/unbond, but rather move the rewards to the respective validator's pools. BUG FIXES * Gaia CLI (`gaiacli`) - * [\#2921](https://github.com/cosmos/cosmos-sdk/issues/2921) Fix `keys delete` inability to delete offline and ledger keys. + * [\#2921](https://github.com/cosmos/cosmos-sdk/issues/2921) Fix `keys delete` inability to delete offline and ledger keys. * Gaia - * [\#3003](https://github.com/cosmos/cosmos-sdk/issues/3003) CollectStdTxs() must validate DelegatorAddr against genesis accounts. + * [\#3003](https://github.com/cosmos/cosmos-sdk/issues/3003) CollectStdTxs() must validate DelegatorAddr against genesis accounts. * SDK - * [\#2967](https://github.com/cosmos/cosmos-sdk/issues/2967) Change ordering of `mint.BeginBlocker` and `distr.BeginBlocker`, recalculate inflation each block - * [\#3068](https://github.com/cosmos/cosmos-sdk/issues/3068) check for uint64 gas overflow during `Std#ValidateBasic`. - * [\#3071](https://github.com/cosmos/cosmos-sdk/issues/3071) Catch overflow on block gas meter + * [\#2967](https://github.com/cosmos/cosmos-sdk/issues/2967) Change ordering of `mint.BeginBlocker` and `distr.BeginBlocker`, recalculate inflation each block + * [\#3068](https://github.com/cosmos/cosmos-sdk/issues/3068) check for uint64 gas overflow during `Std#ValidateBasic`. + * [\#3071](https://github.com/cosmos/cosmos-sdk/issues/3071) Catch overflow on block gas meter ## 0.27.0 @@ -2690,168 +2696,168 @@ BUG FIXES BREAKING CHANGES * Gaia REST API (`gaiacli advanced rest-server`) - * [gaia-lite] [\#2819](https://github.com/cosmos/cosmos-sdk/pull/2819) Txs query param format is now: `/txs?tag=value` (removed '' wrapping the query parameter `value`) + * [gaia-lite] [\#2819](https://github.com/cosmos/cosmos-sdk/pull/2819) Txs query param format is now: `/txs?tag=value` (removed '' wrapping the query parameter `value`) * Gaia CLI (`gaiacli`) - * [cli] [\#2728](https://github.com/cosmos/cosmos-sdk/pull/2728) Seperate `tx` and `query` subcommands by module - * [cli] [\#2727](https://github.com/cosmos/cosmos-sdk/pull/2727) Fix unbonding command flow - * [cli] [\#2786](https://github.com/cosmos/cosmos-sdk/pull/2786) Fix redelegation command flow - * [cli] [\#2829](https://github.com/cosmos/cosmos-sdk/pull/2829) add-genesis-account command now validates state when adding accounts - * [cli] [\#2804](https://github.com/cosmos/cosmos-sdk/issues/2804) Check whether key exists before passing it on to `tx create-validator`. - * [cli] [\#2874](https://github.com/cosmos/cosmos-sdk/pull/2874) `gaiacli tx sign` takes an optional `--output-document` flag to support output redirection. - * [cli] [\#2875](https://github.com/cosmos/cosmos-sdk/pull/2875) Refactor `gaiad gentx` and avoid redirection to `gaiacli tx sign` for tx signing. + * [cli] [\#2728](https://github.com/cosmos/cosmos-sdk/pull/2728) Seperate `tx` and `query` subcommands by module + * [cli] [\#2727](https://github.com/cosmos/cosmos-sdk/pull/2727) Fix unbonding command flow + * [cli] [\#2786](https://github.com/cosmos/cosmos-sdk/pull/2786) Fix redelegation command flow + * [cli] [\#2829](https://github.com/cosmos/cosmos-sdk/pull/2829) add-genesis-account command now validates state when adding accounts + * [cli] [\#2804](https://github.com/cosmos/cosmos-sdk/issues/2804) Check whether key exists before passing it on to `tx create-validator`. + * [cli] [\#2874](https://github.com/cosmos/cosmos-sdk/pull/2874) `gaiacli tx sign` takes an optional `--output-document` flag to support output redirection. + * [cli] [\#2875](https://github.com/cosmos/cosmos-sdk/pull/2875) Refactor `gaiad gentx` and avoid redirection to `gaiacli tx sign` for tx signing. * Gaia - * [mint] [\#2825] minting now occurs every block, inflation parameter updates still hourly + * [mint] [\#2825] minting now occurs every block, inflation parameter updates still hourly * SDK - * [\#2752](https://github.com/cosmos/cosmos-sdk/pull/2752) Don't hardcode bondable denom. - * [\#2701](https://github.com/cosmos/cosmos-sdk/issues/2701) Account numbers and sequence numbers in `auth` are now `uint64` instead of `int64` - * [\#2019](https://github.com/cosmos/cosmos-sdk/issues/2019) Cap total number of signatures. Current per-transaction limit is 7, and if that is exceeded transaction is rejected. - * [\#2801](https://github.com/cosmos/cosmos-sdk/pull/2801) Remove AppInit structure. - * [\#2798](https://github.com/cosmos/cosmos-sdk/issues/2798) Governance API has miss-spelled English word in JSON response ('depositer' -> 'depositor') - * [\#2943](https://github.com/cosmos/cosmos-sdk/pull/2943) Transaction action tags equal the message type. Staking EndBlocker tags are included. + * [\#2752](https://github.com/cosmos/cosmos-sdk/pull/2752) Don't hardcode bondable denom. + * [\#2701](https://github.com/cosmos/cosmos-sdk/issues/2701) Account numbers and sequence numbers in `auth` are now `uint64` instead of `int64` + * [\#2019](https://github.com/cosmos/cosmos-sdk/issues/2019) Cap total number of signatures. Current per-transaction limit is 7, and if that is exceeded transaction is rejected. + * [\#2801](https://github.com/cosmos/cosmos-sdk/pull/2801) Remove AppInit structure. + * [\#2798](https://github.com/cosmos/cosmos-sdk/issues/2798) Governance API has miss-spelled English word in JSON response ('depositer' -> 'depositor') + * [\#2943](https://github.com/cosmos/cosmos-sdk/pull/2943) Transaction action tags equal the message type. Staking EndBlocker tags are included. * Tendermint - * Update to Tendermint 0.27.0 + * Update to Tendermint 0.27.0 FEATURES * Gaia REST API (`gaiacli advanced rest-server`) - * [gov] [\#2479](https://github.com/cosmos/cosmos-sdk/issues/2479) Added governance parameter + * [gov] [\#2479](https://github.com/cosmos/cosmos-sdk/issues/2479) Added governance parameter query REST endpoints. * Gaia CLI (`gaiacli`) - * [gov][cli] [\#2479](https://github.com/cosmos/cosmos-sdk/issues/2479) Added governance + * [gov][cli] [\#2479](https://github.com/cosmos/cosmos-sdk/issues/2479) Added governance parameter query commands. - * [stake][cli] [\#2027] Add CLI query command for getting all delegations to a specific validator. - * [\#2840](https://github.com/cosmos/cosmos-sdk/pull/2840) Standardize CLI exports from modules + * [stake][cli] [\#2027] Add CLI query command for getting all delegations to a specific validator. + * [\#2840](https://github.com/cosmos/cosmos-sdk/pull/2840) Standardize CLI exports from modules * Gaia - * [app] [\#2791](https://github.com/cosmos/cosmos-sdk/issues/2791) Support export at a specific height, with `gaiad export --height=HEIGHT`. - * [x/gov] [#2479](https://github.com/cosmos/cosmos-sdk/issues/2479) Implemented querier + * [app] [\#2791](https://github.com/cosmos/cosmos-sdk/issues/2791) Support export at a specific height, with `gaiad export --height=HEIGHT`. + * [x/gov] [#2479](https://github.com/cosmos/cosmos-sdk/issues/2479) Implemented querier for getting governance parameters. - * [app] [\#2663](https://github.com/cosmos/cosmos-sdk/issues/2663) - Runtime-assertable invariants - * [app] [\#2791](https://github.com/cosmos/cosmos-sdk/issues/2791) Support export at a specific height, with `gaiad export --height=HEIGHT`. - * [app] [\#2812](https://github.com/cosmos/cosmos-sdk/issues/2812) Support export alterations to prepare for restarting at zero-height + * [app] [\#2663](https://github.com/cosmos/cosmos-sdk/issues/2663) - Runtime-assertable invariants + * [app] [\#2791](https://github.com/cosmos/cosmos-sdk/issues/2791) Support export at a specific height, with `gaiad export --height=HEIGHT`. + * [app] [\#2812](https://github.com/cosmos/cosmos-sdk/issues/2812) Support export alterations to prepare for restarting at zero-height * SDK - * [simulator] [\#2682](https://github.com/cosmos/cosmos-sdk/issues/2682) MsgEditValidator now looks at the validator's max rate, thus it now succeeds a significant portion of the time - * [core] [\#2775](https://github.com/cosmos/cosmos-sdk/issues/2775) Add deliverTx maximum block gas limit + * [simulator] [\#2682](https://github.com/cosmos/cosmos-sdk/issues/2682) MsgEditValidator now looks at the validator's max rate, thus it now succeeds a significant portion of the time + * [core] [\#2775](https://github.com/cosmos/cosmos-sdk/issues/2775) Add deliverTx maximum block gas limit IMPROVEMENTS * Gaia REST API (`gaiacli advanced rest-server`) - * [gaia-lite] [\#2819](https://github.com/cosmos/cosmos-sdk/pull/2819) Tx search now supports multiple tags as query parameters - * [\#2836](https://github.com/cosmos/cosmos-sdk/pull/2836) Expose LCD router to allow users to register routes there. + * [gaia-lite] [\#2819](https://github.com/cosmos/cosmos-sdk/pull/2819) Tx search now supports multiple tags as query parameters + * [\#2836](https://github.com/cosmos/cosmos-sdk/pull/2836) Expose LCD router to allow users to register routes there. * Gaia CLI (`gaiacli`) - * [\#2749](https://github.com/cosmos/cosmos-sdk/pull/2749) Add --chain-id flag to gaiad testnet - * [\#2819](https://github.com/cosmos/cosmos-sdk/pull/2819) Tx search now supports multiple tags as query parameters + * [\#2749](https://github.com/cosmos/cosmos-sdk/pull/2749) Add --chain-id flag to gaiad testnet + * [\#2819](https://github.com/cosmos/cosmos-sdk/pull/2819) Tx search now supports multiple tags as query parameters * Gaia - * [\#2772](https://github.com/cosmos/cosmos-sdk/issues/2772) Update BaseApp to not persist state when the ante handler fails on DeliverTx. - * [\#2773](https://github.com/cosmos/cosmos-sdk/issues/2773) Require moniker to be provided on `gaiad init`. - * [\#2672](https://github.com/cosmos/cosmos-sdk/issues/2672) [Makefile] Updated for better Windows compatibility and ledger support logic, get_tools was rewritten as a cross-compatible Makefile. - * [\#2766](https://github.com/cosmos/cosmos-sdk/issues/2766) [Makefile] Added goimports tool to get_tools. Get_tools now only builds new versions if binaries are missing. - * [#110](https://github.com/tendermint/devops/issues/110) Updated CircleCI job to trigger website build when cosmos docs are updated. + * [\#2772](https://github.com/cosmos/cosmos-sdk/issues/2772) Update BaseApp to not persist state when the ante handler fails on DeliverTx. + * [\#2773](https://github.com/cosmos/cosmos-sdk/issues/2773) Require moniker to be provided on `gaiad init`. + * [\#2672](https://github.com/cosmos/cosmos-sdk/issues/2672) [Makefile] Updated for better Windows compatibility and ledger support logic, get_tools was rewritten as a cross-compatible Makefile. + * [\#2766](https://github.com/cosmos/cosmos-sdk/issues/2766) [Makefile] Added goimports tool to get_tools. Get_tools now only builds new versions if binaries are missing. + * [#110](https://github.com/tendermint/devops/issues/110) Updated CircleCI job to trigger website build when cosmos docs are updated. * SDK & [x/mock/simulation] [\#2720] major cleanup, introduction of helper objects, reorganization - * [\#2821](https://github.com/cosmos/cosmos-sdk/issues/2821) Codespaces are now strings - * [types] [\#2776](https://github.com/cosmos/cosmos-sdk/issues/2776) Improve safety of `Coin` and `Coins` types. Various functions +* [\#2821](https://github.com/cosmos/cosmos-sdk/issues/2821) Codespaces are now strings +* [types] [\#2776](https://github.com/cosmos/cosmos-sdk/issues/2776) Improve safety of `Coin` and `Coins` types. Various functions and methods will panic when a negative amount is discovered. - * [\#2815](https://github.com/cosmos/cosmos-sdk/issues/2815) Gas unit fields changed from `int64` to `uint64`. - * [\#2821](https://github.com/cosmos/cosmos-sdk/issues/2821) Codespaces are now strings - * [\#2779](https://github.com/cosmos/cosmos-sdk/issues/2779) Introduce `ValidateBasic` to the `Tx` interface and call it in the ante +* [\#2815](https://github.com/cosmos/cosmos-sdk/issues/2815) Gas unit fields changed from `int64` to `uint64`. +* [\#2821](https://github.com/cosmos/cosmos-sdk/issues/2821) Codespaces are now strings +* [\#2779](https://github.com/cosmos/cosmos-sdk/issues/2779) Introduce `ValidateBasic` to the `Tx` interface and call it in the ante handler. - * [\#2825](https://github.com/cosmos/cosmos-sdk/issues/2825) More staking and distribution invariants - * [\#2912](https://github.com/cosmos/cosmos-sdk/issues/2912) Print commit ID in hex when commit is synced. +* [\#2825](https://github.com/cosmos/cosmos-sdk/issues/2825) More staking and distribution invariants +* [\#2912](https://github.com/cosmos/cosmos-sdk/issues/2912) Print commit ID in hex when commit is synced. * Tendermint - * [\#2796](https://github.com/cosmos/cosmos-sdk/issues/2796) Update to go-amino 0.14.1 +* [\#2796](https://github.com/cosmos/cosmos-sdk/issues/2796) Update to go-amino 0.14.1 BUG FIXES * Gaia REST API (`gaiacli advanced rest-server`) - * [gaia-lite] [\#2868](https://github.com/cosmos/cosmos-sdk/issues/2868) Added handler for governance tally endpoint - * [\#2907](https://github.com/cosmos/cosmos-sdk/issues/2907) Refactor and fix the way Gaia Lite is started. + * [gaia-lite] [\#2868](https://github.com/cosmos/cosmos-sdk/issues/2868) Added handler for governance tally endpoint + * [\#2907](https://github.com/cosmos/cosmos-sdk/issues/2907) Refactor and fix the way Gaia Lite is started. * Gaia - * [\#2723] Use `cosmosvalcons` Bech32 prefix in `tendermint show-address` - * [\#2742](https://github.com/cosmos/cosmos-sdk/issues/2742) Fix time format of TimeoutCommit override - * [\#2898](https://github.com/cosmos/cosmos-sdk/issues/2898) Remove redundant '$' in docker-compose.yml + * [\#2723] Use `cosmosvalcons` Bech32 prefix in `tendermint show-address` + * [\#2742](https://github.com/cosmos/cosmos-sdk/issues/2742) Fix time format of TimeoutCommit override + * [\#2898](https://github.com/cosmos/cosmos-sdk/issues/2898) Remove redundant '$' in docker-compose.yml * SDK - * [\#2733](https://github.com/cosmos/cosmos-sdk/issues/2733) [x/gov, x/mock/simulation] Fix governance simulation, update x/gov import/export - * [\#2854](https://github.com/cosmos/cosmos-sdk/issues/2854) [x/bank] Remove unused bank.MsgIssue, prevent possible panic - * [\#2884](https://github.com/cosmos/cosmos-sdk/issues/2884) [docs/examples] Fix `basecli version` panic + * [\#2733](https://github.com/cosmos/cosmos-sdk/issues/2733) [x/gov, x/mock/simulation] Fix governance simulation, update x/gov import/export + * [\#2854](https://github.com/cosmos/cosmos-sdk/issues/2854) [x/bank] Remove unused bank.MsgIssue, prevent possible panic + * [\#2884](https://github.com/cosmos/cosmos-sdk/issues/2884) [docs/examples] Fix `basecli version` panic * Tendermint - * [\#2797](https://github.com/tendermint/tendermint/pull/2797) AddressBook requires addresses to have IDs; Do not crap out immediately after sending pex addrs in seed mode + * [\#2797](https://github.com/tendermint/tendermint/pull/2797) AddressBook requires addresses to have IDs; Do not crap out immediately after sending pex addrs in seed mode ## 0.26.0 BREAKING CHANGES * Gaia - * [gaiad init] [\#2602](https://github.com/cosmos/cosmos-sdk/issues/2602) New genesis workflow + * [gaiad init] [\#2602](https://github.com/cosmos/cosmos-sdk/issues/2602) New genesis workflow * SDK - * [simulation] [\#2665](https://github.com/cosmos/cosmos-sdk/issues/2665) only argument to sdk.Invariant is now app + * [simulation] [\#2665](https://github.com/cosmos/cosmos-sdk/issues/2665) only argument to sdk.Invariant is now app * Tendermint - * Upgrade to version 0.26.0 + * Upgrade to version 0.26.0 FEATURES * Gaia CLI (`gaiacli`) - * [cli] [\#2569](https://github.com/cosmos/cosmos-sdk/pull/2569) Add commands to query validator unbondings and redelegations - * [cli] [\#2569](https://github.com/cosmos/cosmos-sdk/pull/2569) Add commands to query validator unbondings and redelegations - * [cli] [\#2524](https://github.com/cosmos/cosmos-sdk/issues/2524) Add support offline mode to `gaiacli tx sign`. Lookups are not performed if the flag `--offline` is on. - * [cli] [\#2558](https://github.com/cosmos/cosmos-sdk/issues/2558) Rename --print-sigs to --validate-signatures. It now performs a complete set of sanity checks and reports to the user. Also added --print-signature-only to print the signature only, not the whole transaction. - * [cli] [\#2704](https://github.com/cosmos/cosmos-sdk/pull/2704) New add-genesis-account convenience command to populate genesis.json with genesis accounts. + * [cli] [\#2569](https://github.com/cosmos/cosmos-sdk/pull/2569) Add commands to query validator unbondings and redelegations + * [cli] [\#2569](https://github.com/cosmos/cosmos-sdk/pull/2569) Add commands to query validator unbondings and redelegations + * [cli] [\#2524](https://github.com/cosmos/cosmos-sdk/issues/2524) Add support offline mode to `gaiacli tx sign`. Lookups are not performed if the flag `--offline` is on. + * [cli] [\#2558](https://github.com/cosmos/cosmos-sdk/issues/2558) Rename --print-sigs to --validate-signatures. It now performs a complete set of sanity checks and reports to the user. Also added --print-signature-only to print the signature only, not the whole transaction. + * [cli] [\#2704](https://github.com/cosmos/cosmos-sdk/pull/2704) New add-genesis-account convenience command to populate genesis.json with genesis accounts. * SDK - * [\#1336](https://github.com/cosmos/cosmos-sdk/issues/1336) Mechanism for SDK Users to configure their own Bech32 prefixes instead of using the default cosmos prefixes. + * [\#1336](https://github.com/cosmos/cosmos-sdk/issues/1336) Mechanism for SDK Users to configure their own Bech32 prefixes instead of using the default cosmos prefixes. IMPROVEMENTS * Gaia - * [\#2637](https://github.com/cosmos/cosmos-sdk/issues/2637) [x/gov] Switched inactive and active proposal queues to an iterator based queue +* [\#2637](https://github.com/cosmos/cosmos-sdk/issues/2637) [x/gov] Switched inactive and active proposal queues to an iterator based queue * SDK - * [\#2573](https://github.com/cosmos/cosmos-sdk/issues/2573) [x/distribution] add accum invariance - * [\#2556](https://github.com/cosmos/cosmos-sdk/issues/2556) [x/mock/simulation] Fix debugging output - * [\#2396](https://github.com/cosmos/cosmos-sdk/issues/2396) [x/mock/simulation] Change parameters to get more slashes - * [\#2617](https://github.com/cosmos/cosmos-sdk/issues/2617) [x/mock/simulation] Randomize all genesis parameters - * [\#2669](https://github.com/cosmos/cosmos-sdk/issues/2669) [x/stake] Added invarant check to make sure validator's power aligns with its spot in the power store. - * [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) [x/mock/simulation] Use a transition matrix for block size - * [\#2660](https://github.com/cosmos/cosmos-sdk/issues/2660) [x/mock/simulation] Staking transactions get tested far more frequently - * [\#2610](https://github.com/cosmos/cosmos-sdk/issues/2610) [x/stake] Block redelegation to and from the same validator - * [\#2652](https://github.com/cosmos/cosmos-sdk/issues/2652) [x/auth] Add benchmark for get and set account - * [\#2685](https://github.com/cosmos/cosmos-sdk/issues/2685) [store] Add general merkle absence proof (also for empty substores) - * [\#2708](https://github.com/cosmos/cosmos-sdk/issues/2708) [store] Disallow setting nil values +* [\#2573](https://github.com/cosmos/cosmos-sdk/issues/2573) [x/distribution] add accum invariance +* [\#2556](https://github.com/cosmos/cosmos-sdk/issues/2556) [x/mock/simulation] Fix debugging output +* [\#2396](https://github.com/cosmos/cosmos-sdk/issues/2396) [x/mock/simulation] Change parameters to get more slashes +* [\#2617](https://github.com/cosmos/cosmos-sdk/issues/2617) [x/mock/simulation] Randomize all genesis parameters +* [\#2669](https://github.com/cosmos/cosmos-sdk/issues/2669) [x/stake] Added invarant check to make sure validator's power aligns with its spot in the power store. +* [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) [x/mock/simulation] Use a transition matrix for block size +* [\#2660](https://github.com/cosmos/cosmos-sdk/issues/2660) [x/mock/simulation] Staking transactions get tested far more frequently +* [\#2610](https://github.com/cosmos/cosmos-sdk/issues/2610) [x/stake] Block redelegation to and from the same validator +* [\#2652](https://github.com/cosmos/cosmos-sdk/issues/2652) [x/auth] Add benchmark for get and set account +* [\#2685](https://github.com/cosmos/cosmos-sdk/issues/2685) [store] Add general merkle absence proof (also for empty substores) +* [\#2708](https://github.com/cosmos/cosmos-sdk/issues/2708) [store] Disallow setting nil values BUG FIXES * Gaia - * [\#2670](https://github.com/cosmos/cosmos-sdk/issues/2670) [x/stake] fixed incorrect `IterateBondedValidators` and split into two functions: `IterateBondedValidators` and `IterateLastBlockConsValidators` - * [\#2691](https://github.com/cosmos/cosmos-sdk/issues/2691) Fix local testnet creation by using a single canonical genesis time - * [\#2648](https://github.com/cosmos/cosmos-sdk/issues/2648) [gaiad] Fix `gaiad export` / `gaiad import` consistency, test in CI +* [\#2670](https://github.com/cosmos/cosmos-sdk/issues/2670) [x/stake] fixed incorrect `IterateBondedValidators` and split into two functions: `IterateBondedValidators` and `IterateLastBlockConsValidators` +* [\#2691](https://github.com/cosmos/cosmos-sdk/issues/2691) Fix local testnet creation by using a single canonical genesis time +* [\#2648](https://github.com/cosmos/cosmos-sdk/issues/2648) [gaiad] Fix `gaiad export` / `gaiad import` consistency, test in CI * SDK - * [\#2625](https://github.com/cosmos/cosmos-sdk/issues/2625) [x/gov] fix AppendTag function usage error - * [\#2677](https://github.com/cosmos/cosmos-sdk/issues/2677) [x/stake, x/distribution] various staking/distribution fixes as found by the simulator - * [\#2674](https://github.com/cosmos/cosmos-sdk/issues/2674) [types] Fix coin.IsLT() impl, coins.IsLT() impl, and renamed coins.Is\* to coins.IsAll\* (see [\#2686](https://github.com/cosmos/cosmos-sdk/issues/2686)) - * [\#2711](https://github.com/cosmos/cosmos-sdk/issues/2711) [x/stake] Add commission data to `MsgCreateValidator` signature bytes. - * Temporarily disable insecure mode for Gaia Lite +* [\#2625](https://github.com/cosmos/cosmos-sdk/issues/2625) [x/gov] fix AppendTag function usage error +* [\#2677](https://github.com/cosmos/cosmos-sdk/issues/2677) [x/stake, x/distribution] various staking/distribution fixes as found by the simulator +* [\#2674](https://github.com/cosmos/cosmos-sdk/issues/2674) [types] Fix coin.IsLT() impl, coins.IsLT() impl, and renamed coins.Is\* to coins.IsAll\* (see [\#2686](https://github.com/cosmos/cosmos-sdk/issues/2686)) +* [\#2711](https://github.com/cosmos/cosmos-sdk/issues/2711) [x/stake] Add commission data to `MsgCreateValidator` signature bytes. +* Temporarily disable insecure mode for Gaia Lite ## 0.25.0 -*October 24th, 2018* +_October 24th, 2018_. BREAKING CHANGES @@ -2891,8 +2897,8 @@ BREAKING CHANGES Bech32 prefixes have been introduced for a validator's consensus address and public key: `cosmosvalcons` and `cosmosvalconspub` respectively. Also, existing Bech32 prefixes have been renamed for accounts and validator operators: - * `cosmosaccaddr` / `cosmosaccpub` => `cosmos` / `cosmospub` - * `cosmosvaladdr` / `cosmosvalpub` => `cosmosvaloper` / `cosmosvaloperpub` + * `cosmosaccaddr` / `cosmosaccpub` => `cosmos` / `cosmospub` + * `cosmosvaladdr` / `cosmosvalpub` => `cosmosvaloper` / `cosmosvaloperpub` * [x/stake] [#1013] TendermintUpdates now uses transient store * [x/stake] [\#2435](https://github.com/cosmos/cosmos-sdk/issues/2435) Remove empty bytes from the ValidatorPowerRank store key * [x/gov] [\#2195](https://github.com/cosmos/cosmos-sdk/issues/2195) Governance uses BFT Time @@ -2901,36 +2907,36 @@ BREAKING CHANGES * [x/slashing] [\#2430](https://github.com/cosmos/cosmos-sdk/issues/2430) Simulate more slashes, check if validator is jailed before jailing * [x/stake] [\#2393](https://github.com/cosmos/cosmos-sdk/issues/2393) Removed `CompleteUnbonding` and `CompleteRedelegation` Msg types, and instead added unbonding/redelegation queues to endblocker * [x/mock/simulation] [\#2501](https://github.com/cosmos/cosmos-sdk/issues/2501) Simulate transactions & invariants for fee distribution, and fix bugs discovered in the process - * [x/auth] Simulate random fee payments - * [cmd/gaia/app] Simulate non-zero inflation - * [x/stake] Call hooks correctly in several cases related to delegation/validator updates - * [x/stake] Check full supply invariants, including yet-to-be-withdrawn fees - * [x/stake] Remove no-longer-in-use store key - * [x/slashing] Call hooks correctly when a validator is slashed - * [x/slashing] Truncate withdrawals (unbonding, redelegation) and burn change - * [x/mock/simulation] Ensure the simulation cannot set a proposer address of nil - * [x/mock/simulation] Add more event logs on begin block / end block for clarity - * [x/mock/simulation] Correctly set validator power in abci.RequestBeginBlock - * [x/minting] Correctly call stake keeper to track inflated supply - * [x/distribution] Sanity check for nonexistent rewards - * [x/distribution] Truncate withdrawals and return change to the community pool - * [x/distribution] Add sanity checks for incorrect accum / total accum relations - * [x/distribution] Correctly calculate total power using Tendermint updates - * [x/distribution] Simulate withdrawal transactions - * [x/distribution] Fix a bug where the fee pool was not correctly tracked on WithdrawDelegatorRewardsAll + * [x/auth] Simulate random fee payments + * [cmd/gaia/app] Simulate non-zero inflation + * [x/stake] Call hooks correctly in several cases related to delegation/validator updates + * [x/stake] Check full supply invariants, including yet-to-be-withdrawn fees + * [x/stake] Remove no-longer-in-use store key + * [x/slashing] Call hooks correctly when a validator is slashed + * [x/slashing] Truncate withdrawals (unbonding, redelegation) and burn change + * [x/mock/simulation] Ensure the simulation cannot set a proposer address of nil + * [x/mock/simulation] Add more event logs on begin block / end block for clarity + * [x/mock/simulation] Correctly set validator power in abci.RequestBeginBlock + * [x/minting] Correctly call stake keeper to track inflated supply + * [x/distribution] Sanity check for nonexistent rewards + * [x/distribution] Truncate withdrawals and return change to the community pool + * [x/distribution] Add sanity checks for incorrect accum / total accum relations + * [x/distribution] Correctly calculate total power using Tendermint updates + * [x/distribution] Simulate withdrawal transactions + * [x/distribution] Fix a bug where the fee pool was not correctly tracked on WithdrawDelegatorRewardsAll * [x/stake] [\#1673](https://github.com/cosmos/cosmos-sdk/issues/1673) Validators are no longer deleted until they can no longer possibly be slashed * [\#1890](https://github.com/cosmos/cosmos-sdk/issues/1890) Start chain with initial state + sequence of transactions - * [cli] Rename `gaiad init gentx` to `gaiad gentx`. - * [cli] Add `--skip-genesis` flag to `gaiad init` to prevent `genesis.json` generation. - * Drop `GenesisTx` in favor of a signed `StdTx` with only one `MsgCreateValidator` message. - * [cli] Port `gaiad init` and `gaiad testnet` to work with `StdTx` genesis transactions. - * [cli] Add `--moniker` flag to `gaiad init` to override moniker when generating `genesis.json` - i.e. it takes effect when running with the `--with-txs` flag, it is ignored otherwise. + * [cli] Rename `gaiad init gentx` to `gaiad gentx`. + * [cli] Add `--skip-genesis` flag to `gaiad init` to prevent `genesis.json` generation. + * Drop `GenesisTx` in favor of a signed `StdTx` with only one `MsgCreateValidator` message. + * [cli] Port `gaiad init` and `gaiad testnet` to work with `StdTx` genesis transactions. + * [cli] Add `--moniker` flag to `gaiad init` to override moniker when generating `genesis.json` - i.e. it takes effect when running with the `--with-txs` flag, it is ignored otherwise. * SDK * [core] [\#2219](https://github.com/cosmos/cosmos-sdk/issues/2219) Update to Tendermint 0.24.0 - * Validator set updates delayed by one block - * BFT timestamp that can safely be used by applications - * Fixed maximum block size enforcement + * Validator set updates delayed by one block + * BFT timestamp that can safely be used by applications + * Fixed maximum block size enforcement * [core] [\#1807](https://github.com/cosmos/cosmos-sdk/issues/1807) Switch from use of rational to decimal * [types] [\#1901](https://github.com/cosmos/cosmos-sdk/issues/1901) Validator interface's GetOwner() renamed to GetOperator() * [x/slashing] [#2122](https://github.com/cosmos/cosmos-sdk/pull/2122) - Implement slashing period @@ -2962,67 +2968,68 @@ BREAKING CHANGES * [types] [\#2456](https://github.com/cosmos/cosmos-sdk/issues/2456) Renamed msg.Name() and msg.Type() to msg.Type() and msg.Route() respectively * Tendermint - * Update tendermint version from v0.23.0 to v0.25.0, notable changes - * Mempool now won't build too large blocks, or too computationally expensive blocks - * Maximum tx sizes and gas are now removed, and are implicitly the blocks maximums - * ABCI validators no longer send the pubkey. The pubkey is only sent in validator updates - * Validator set changes are now delayed by one block - * Block header now includes the next validator sets hash - * BFT time is implemented - * Secp256k1 signature format has changed - * There is now a threshold multisig format - * See the [tendermint changelog](https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md) for other changes. + * Update tendermint version from v0.23.0 to v0.25.0, notable changes + * Mempool now won't build too large blocks, or too computationally expensive blocks + * Maximum tx sizes and gas are now removed, and are implicitly the blocks maximums + * ABCI validators no longer send the pubkey. The pubkey is only sent in validator updates + * Validator set changes are now delayed by one block + * Block header now includes the next validator sets hash + * BFT time is implemented + * Secp256k1 signature format has changed + * There is now a threshold multisig format + * See the [tendermint changelog](https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md) for other changes. FEATURES * Gaia REST API (`gaiacli advanced rest-server`) - * [gaia-lite] Endpoints to query staking pool and params - * [gaia-lite] [\#2110](https://github.com/cosmos/cosmos-sdk/issues/2110) Add support for `simulate=true` requests query argument to endpoints that send txs to run simulations of transactions - * [gaia-lite] [\#966](https://github.com/cosmos/cosmos-sdk/issues/966) Add support for `generate_only=true` query argument to generate offline unsigned transactions - * [gaia-lite] [\#1953](https://github.com/cosmos/cosmos-sdk/issues/1953) Add /sign endpoint to sign transactions generated with `generate_only=true`. - * [gaia-lite] [\#1954](https://github.com/cosmos/cosmos-sdk/issues/1954) Add /broadcast endpoint to broadcast transactions signed by the /sign endpoint. - * [gaia-lite] [\#2113](https://github.com/cosmos/cosmos-sdk/issues/2113) Rename `/accounts/{address}/send` to `/bank/accounts/{address}/transfers`, rename `/accounts/{address}` to `/auth/accounts/{address}`, replace `proposal-id` with `proposalId` in all gov endpoints - * [gaia-lite] [\#2478](https://github.com/cosmos/cosmos-sdk/issues/2478) Add query gov proposal's deposits endpoint - * [gaia-lite] [\#2477](https://github.com/cosmos/cosmos-sdk/issues/2477) Add query validator's outgoing redelegations and unbonding delegations endpoints + * [gaia-lite] Endpoints to query staking pool and params + * [gaia-lite] [\#2110](https://github.com/cosmos/cosmos-sdk/issues/2110) Add support for `simulate=true` requests query argument to endpoints that send txs to run simulations of transactions + * [gaia-lite] [\#966](https://github.com/cosmos/cosmos-sdk/issues/966) Add support for `generate_only=true` query argument to generate offline unsigned transactions + * [gaia-lite] [\#1953](https://github.com/cosmos/cosmos-sdk/issues/1953) Add /sign endpoint to sign transactions generated with `generate_only=true`. + * [gaia-lite] [\#1954](https://github.com/cosmos/cosmos-sdk/issues/1954) Add /broadcast endpoint to broadcast transactions signed by the /sign endpoint. + * [gaia-lite] [\#2113](https://github.com/cosmos/cosmos-sdk/issues/2113) Rename `/accounts/{address}/send` to `/bank/accounts/{address}/transfers`, rename `/accounts/{address}` to `/auth/accounts/{address}`, replace `proposal-id` with `proposalId` in all gov endpoints + * [gaia-lite] [\#2478](https://github.com/cosmos/cosmos-sdk/issues/2478) Add query gov proposal's deposits endpoint + * [gaia-lite] [\#2477](https://github.com/cosmos/cosmos-sdk/issues/2477) Add query validator's outgoing redelegations and unbonding delegations endpoints * Gaia CLI (`gaiacli`) - * [cli] Cmds to query staking pool and params - * [gov][cli] [\#2062](https://github.com/cosmos/cosmos-sdk/issues/2062) added `--proposal` flag to `submit-proposal` that allows a JSON file containing a proposal to be passed in - * [\#2040](https://github.com/cosmos/cosmos-sdk/issues/2040) Add `--bech` to `gaiacli keys show` and respective REST endpoint to + * [cli] Cmds to query staking pool and params + * [gov][cli] [\#2062](https://github.com/cosmos/cosmos-sdk/issues/2062) added `--proposal` flag to `submit-proposal` that allows a JSON file containing a proposal to be passed in + * [\#2040](https://github.com/cosmos/cosmos-sdk/issues/2040) Add `--bech` to `gaiacli keys show` and respective REST endpoint to provide desired Bech32 prefix encoding - * [cli] [\#2047](https://github.com/cosmos/cosmos-sdk/issues/2047) [\#2306](https://github.com/cosmos/cosmos-sdk/pull/2306) Passing --gas=simulate triggers a simulation of the tx before the actual execution. + * [cli] [\#2047](https://github.com/cosmos/cosmos-sdk/issues/2047) [\#2306](https://github.com/cosmos/cosmos-sdk/pull/2306) Passing --gas=simulate triggers a simulation of the tx before the actual execution. The gas estimate obtained via the simulation will be used as gas limit in the actual execution. - * [cli] [\#2047](https://github.com/cosmos/cosmos-sdk/issues/2047) The --gas-adjustment flag can be used to adjust the estimate obtained via the simulation triggered by --gas=simulate. - * [cli] [\#2110](https://github.com/cosmos/cosmos-sdk/issues/2110) Add --dry-run flag to perform a simulation of a transaction without broadcasting it. The --gas flag is ignored as gas would be automatically estimated. - * [cli] [\#2204](https://github.com/cosmos/cosmos-sdk/issues/2204) Support generating and broadcasting messages with multiple signatures via command line: - * [\#966](https://github.com/cosmos/cosmos-sdk/issues/966) Add --generate-only flag to build an unsigned transaction and write it to STDOUT. - * [\#1953](https://github.com/cosmos/cosmos-sdk/issues/1953) New `sign` command to sign transactions generated with the --generate-only flag. - * [\#1954](https://github.com/cosmos/cosmos-sdk/issues/1954) New `broadcast` command to broadcast transactions generated offline and signed with the `sign` command. - * [cli] [\#2220](https://github.com/cosmos/cosmos-sdk/issues/2220) Add `gaiacli config` feature to interactively create CLI config files to reduce the number of required flags - * [stake][cli] [\#1672](https://github.com/cosmos/cosmos-sdk/issues/1672) Introduced + * [cli] [\#2047](https://github.com/cosmos/cosmos-sdk/issues/2047) The --gas-adjustment flag can be used to adjust the estimate obtained via the simulation triggered by --gas=simulate. + * [cli] [\#2110](https://github.com/cosmos/cosmos-sdk/issues/2110) Add --dry-run flag to perform a simulation of a transaction without broadcasting it. The --gas flag is ignored as gas would be automatically estimated. + * [cli] [\#2204](https://github.com/cosmos/cosmos-sdk/issues/2204) Support generating and broadcasting messages with multiple signatures via command line: + * [\#966](https://github.com/cosmos/cosmos-sdk/issues/966) Add --generate-only flag to build an unsigned transaction and write it to STDOUT. + * [\#1953](https://github.com/cosmos/cosmos-sdk/issues/1953) New `sign` command to sign transactions generated with the --generate-only flag. + * [\#1954](https://github.com/cosmos/cosmos-sdk/issues/1954) New `broadcast` command to broadcast transactions generated offline and signed with the `sign` command. + * [cli] [\#2220](https://github.com/cosmos/cosmos-sdk/issues/2220) Add `gaiacli config` feature to interactively create CLI config files to reduce the number of required flags + * [stake][cli] [\#1672](https://github.com/cosmos/cosmos-sdk/issues/1672) Introduced new commission flags for validator commands `create-validator` and `edit-validator`. - * [stake][cli] [\#1890](https://github.com/cosmos/cosmos-sdk/issues/1890) Add `--genesis-format` flag to `gaiacli tx create-validator` to produce transactions in genesis-friendly format. - * [cli][\#2554](https://github.com/cosmos/cosmos-sdk/issues/2554) Make `gaiacli keys show` multisig ready. + * [stake][cli] [\#1890](https://github.com/cosmos/cosmos-sdk/issues/1890) Add `--genesis-format` flag to `gaiacli tx create-validator` to produce transactions in genesis-friendly format. + * [cli][\#2554](https://github.com/cosmos/cosmos-sdk/issues/2554) Make `gaiacli keys show` multisig ready. * Gaia - * [cli] [\#2170](https://github.com/cosmos/cosmos-sdk/issues/2170) added ability to show the node's address via `gaiad tendermint show-address` - * [simulation] [\#2313](https://github.com/cosmos/cosmos-sdk/issues/2313) Reworked `make test_sim_gaia_slow` to `make test_sim_gaia_full`, now simulates from multiple starting seeds in parallel - * [cli] [\#1921] (https://github.com/cosmos/cosmos-sdk/issues/1921) - * New configuration file `gaiad.toml` is now created to host Gaia-specific configuration. - * New --minimum_fees/minimum_fees flag/config option to set a minimum fee. + * [cli] [\#2170](https://github.com/cosmos/cosmos-sdk/issues/2170) added ability to show the node's address via `gaiad tendermint show-address` + * [simulation] [\#2313](https://github.com/cosmos/cosmos-sdk/issues/2313) Reworked `make test_sim_gaia_slow` to `make test_sim_gaia_full`, now simulates from multiple starting seeds in parallel + * [cli] [\#1921](https://github.com/cosmos/cosmos-sdk/issues/1921) + * New configuration file `gaiad.toml` is now created to host Gaia-specific configuration. + * New --minimum_fees/minimum_fees flag/config option to set a minimum fee. * SDK - * [querier] added custom querier functionality, so ABCI query requests can be handled by keepers - * [simulation] [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) allow operations to specify future operations - * [simulation] [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) Add benchmarking capabilities, with makefile commands "test_sim_gaia_benchmark, test_sim_gaia_profile" - * [simulation] [\#2349](https://github.com/cosmos/cosmos-sdk/issues/2349) Add time-based future scheduled operations to simulator - * [x/auth] [\#2376](https://github.com/cosmos/cosmos-sdk/issues/2376) Remove FeePayer() from StdTx - * [x/stake] [\#1672](https://github.com/cosmos/cosmos-sdk/issues/1672) Implement + * [querier] added custom querier functionality, so ABCI query requests can be handled by keepers + * [simulation] [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) allow operations to specify future operations + * [simulation] [\#1924](https://github.com/cosmos/cosmos-sdk/issues/1924) Add benchmarking capabilities, with makefile commands "test_sim_gaia_benchmark, test_sim_gaia_profile" + * [simulation] [\#2349](https://github.com/cosmos/cosmos-sdk/issues/2349) Add time-based future scheduled operations to simulator + * [x/auth] [\#2376](https://github.com/cosmos/cosmos-sdk/issues/2376) Remove FeePayer() from StdTx + * [x/stake] [\#1672](https://github.com/cosmos/cosmos-sdk/issues/1672) Implement basis for the validator commission model. - * [x/auth] Support account removal in the account mapper. + * [x/auth] Support account removal in the account mapper. IMPROVEMENTS + * [tools] Improved terraform and ansible scripts for infrastructure deployment * [tools] Added ansible script to enable process core dumps @@ -3048,7 +3055,7 @@ IMPROVEMENTS * [genesis] [\#2229](https://github.com/cosmos/cosmos-sdk/issues/2229) Ensure that there are no duplicate accounts or validators in the genesis state. * [genesis] [\#2450](https://github.com/cosmos/cosmos-sdk/issues/2450) Validate staking genesis parameters. * Add SDK validation to `config.toml` (namely disabling `create_empty_blocks`) [\#1571](https://github.com/cosmos/cosmos-sdk/issues/1571) - * [\#1941](https://github.com/cosmos/cosmos-sdk/issues/1941)(https://github.com/cosmos/cosmos-sdk/issues/1941) Version is now inferred via `git describe --tags`. + * [\#1941](https://github.com/cosmos/cosmos-sdk/issues/1941) Version is now inferred via `git describe --tags`. * [x/distribution] [\#1671](https://github.com/cosmos/cosmos-sdk/issues/1671) add distribution types and tests * SDK @@ -3080,12 +3087,12 @@ BUG FIXES * [cli] [\#2547](https://github.com/cosmos/cosmos-sdk/issues/2547) Mark --to and --amount as required flags for `gaiacli tx send`. * Gaia - * [x/stake] Return correct Tendermint validator update set on `EndBlocker` by not + * [x/stake] Return correct Tendermint validator update set on `EndBlocker` by not including non previously bonded validators that have zero power. [#2189](https://github.com/cosmos/cosmos-sdk/issues/2189) - * [docs] Fixed light client section links + * [docs] Fixed light client section links * SDK - * [\#1988](https://github.com/cosmos/cosmos-sdk/issues/1988) Make us compile on OpenBSD (disable ledger) [#1988] (https://github.com/cosmos/cosmos-sdk/issues/1988) + * [\#1988](https://github.com/cosmos/cosmos-sdk/issues/1988) Make us compile on OpenBSD (disable ledger) [#1988] () * [\#2105](https://github.com/cosmos/cosmos-sdk/issues/2105) Fix DB Iterator leak, which may leak a go routine. * [ledger] [\#2064](https://github.com/cosmos/cosmos-sdk/issues/2064) Fix inability to sign and send transactions via the LCD by loading a Ledger device at runtime. @@ -3098,223 +3105,236 @@ BUG FIXES ## 0.24.2 -*August 22nd, 2018* +_August 22nd, 2018_. BUG FIXES * Tendermint - - Fix unbounded consensus WAL growth + * Fix unbounded consensus WAL growth ## 0.24.1 -*August 21st, 2018* +_August 21st, 2018_. BUG FIXES * Gaia - - [x/slashing] Evidence tracking now uses validator address instead of validator pubkey + * [x/slashing] Evidence tracking now uses validator address instead of validator pubkey ## 0.24.0 -*August 13th, 2018* +_August 13th, 2018_. BREAKING CHANGES * Gaia REST API (`gaiacli advanced rest-server`) - - [x/stake] [\#1880](https://github.com/cosmos/cosmos-sdk/issues/1880) More REST-ful endpoints (large refactor) - - [x/slashing] [\#1866](https://github.com/cosmos/cosmos-sdk/issues/1866) `/slashing/signing_info` takes cosmosvalpub instead of cosmosvaladdr - - use time.Time instead of int64 for time. See Tendermint v0.23.0 - - Signatures are no longer Amino encoded with prefixes (just encoded as raw + * [x/stake] [\#1880](https://github.com/cosmos/cosmos-sdk/issues/1880) More REST-ful endpoints (large refactor) + * [x/slashing] [\#1866](https://github.com/cosmos/cosmos-sdk/issues/1866) `/slashing/signing_info` takes cosmosvalpub instead of cosmosvaladdr + * use time.Time instead of int64 for time. See Tendermint v0.23.0 + * Signatures are no longer Amino encoded with prefixes (just encoded as raw bytes) - see Tendermint v0.23.0 * Gaia CLI (`gaiacli`) - - [x/stake] change `--keybase-sig` to `--identity` - - [x/stake] [\#1828](https://github.com/cosmos/cosmos-sdk/issues/1828) Force user to specify amount on create-validator command by removing default - - [x/gov] Change `--proposalID` to `--proposal-id` - - [x/stake, x/gov] [\#1606](https://github.com/cosmos/cosmos-sdk/issues/1606) Use `--from` instead of adhoc flags like `--address-validator` + * [x/stake] change `--keybase-sig` to `--identity` + * [x/stake] [\#1828](https://github.com/cosmos/cosmos-sdk/issues/1828) Force user to specify amount on create-validator command by removing default + * [x/gov] Change `--proposalID` to `--proposal-id` + * [x/stake, x/gov] [\#1606](https://github.com/cosmos/cosmos-sdk/issues/1606) Use `--from` instead of adhoc flags like `--address-validator` and `--proposer` to indicate the sender address. - - [\#1551](https://github.com/cosmos/cosmos-sdk/issues/1551) Remove `--name` completely - - Genesis/key creation (`gaiad init`) now supports user-provided key passwords + * [\#1551](https://github.com/cosmos/cosmos-sdk/issues/1551) Remove `--name` completely + * Genesis/key creation (`gaiad init`) now supports user-provided key passwords * Gaia - - [x/stake] Inflation doesn't use rationals in calculation (performance boost) - - [x/stake] Persist a map from `addr->pubkey` in the state since BeginBlock + * [x/stake] Inflation doesn't use rationals in calculation (performance boost) + * [x/stake] Persist a map from `addr->pubkey` in the state since BeginBlock doesn't provide pubkeys. - - [x/gov] [\#1781](https://github.com/cosmos/cosmos-sdk/issues/1781) Added tags sub-package, changed tags to use dash-case - - [x/gov] [\#1688](https://github.com/cosmos/cosmos-sdk/issues/1688) Governance parameters are now stored in globalparams store - - [x/gov] [\#1859](https://github.com/cosmos/cosmos-sdk/issues/1859) Slash validators who do not vote on a proposal - - [x/gov] [\#1914](https://github.com/cosmos/cosmos-sdk/issues/1914) added TallyResult type that gets stored in Proposal after tallying is finished + * [x/gov] [\#1781](https://github.com/cosmos/cosmos-sdk/issues/1781) Added tags sub-package, changed tags to use dash-case + * [x/gov] [\#1688](https://github.com/cosmos/cosmos-sdk/issues/1688) Governance parameters are now stored in globalparams store + * [x/gov] [\#1859](https://github.com/cosmos/cosmos-sdk/issues/1859) Slash validators who do not vote on a proposal + * [x/gov] [\#1914](https://github.com/cosmos/cosmos-sdk/issues/1914) added TallyResult type that gets stored in Proposal after tallying is finished * SDK - - [baseapp] Msgs are no longer run on CheckTx, removed `ctx.IsCheckTx()` - - [baseapp] NewBaseApp constructor takes sdk.TxDecoder as argument instead of wire.Codec - - [types] sdk.NewCoin takes sdk.Int, sdk.NewInt64Coin takes int64 - - [x/auth] Default TxDecoder can be found in `x/auth` rather than baseapp - - [client] [\#1551](https://github.com/cosmos/cosmos-sdk/issues/1551): Refactored `CoreContext` to `TxContext` and `QueryContext` - - Removed all tx related fields and logic (building & signing) to separate + * [baseapp] Msgs are no longer run on CheckTx, removed `ctx.IsCheckTx()` + * [baseapp] NewBaseApp constructor takes sdk.TxDecoder as argument instead of wire.Codec + * [types] sdk.NewCoin takes sdk.Int, sdk.NewInt64Coin takes int64 + * [x/auth] Default TxDecoder can be found in `x/auth` rather than baseapp + * [client] [\#1551](https://github.com/cosmos/cosmos-sdk/issues/1551): Refactored `CoreContext` to `TxContext` and `QueryContext` + * Removed all tx related fields and logic (building & signing) to separate structure `TxContext` in `x/auth/client/context` * Tendermint - - v0.22.5 -> See [Tendermint PR](https://github.com/tendermint/tendermint/pull/1966) - - change all the cryptography imports. - - v0.23.0 -> See + * v0.22.5 -> See [Tendermint PR](https://github.com/tendermint/tendermint/pull/1966) + * change all the cryptography imports. + * v0.23.0 -> See [Changelog](https://github.com/tendermint/tendermint/blob/v0.23.0/CHANGELOG.md#0230) and [SDK PR](https://github.com/cosmos/cosmos-sdk/pull/1927) - - BeginBlock no longer includes crypto.Pubkey - - use time.Time instead of int64 for time. + * BeginBlock no longer includes crypto.Pubkey + * use time.Time instead of int64 for time. FEATURES * Gaia REST API (`gaiacli advanced rest-server`) - - [x/gov] Can now query governance proposals by ProposalStatus + * [x/gov] Can now query governance proposals by ProposalStatus * Gaia CLI (`gaiacli`) - - [x/gov] added `query-proposals` command. Can filter by `depositer`, `voter`, and `status` - - [x/stake] [\#2043](https://github.com/cosmos/cosmos-sdk/issues/2043) Added staking query cli cmds for unbonding-delegations and redelegations + * [x/gov] added `query-proposals` command. Can filter by `depositer`, `voter`, and `status` + * [x/stake] [\#2043](https://github.com/cosmos/cosmos-sdk/issues/2043) Added staking query cli cmds for unbonding-delegations and redelegations * Gaia - - [networks] Added ansible scripts to upgrade seed nodes on a network + * [networks] Added ansible scripts to upgrade seed nodes on a network * SDK - - [x/mock/simulation] Randomized simulation framework - - Modules specify invariants and operations, preferably in an x/[module]/simulation package - - Modules can test random combinations of their own operations - - Applications can integrate operations and invariants from modules together for an integrated simulation - - Simulates Tendermint's algorithm for validator set updates - - Simulates validator signing/downtime with a Markov chain, and occaisional double-signatures - - Includes simulated operations & invariants for staking, slashing, governance, and bank modules - - [store] [\#1481](https://github.com/cosmos/cosmos-sdk/issues/1481) Add transient store - - [baseapp] Initialize validator set on ResponseInitChain - - [baseapp] added BaseApp.Seal - ability to seal baseapp parameters once they've been set - - [cosmos-sdk-cli] New `cosmos-sdk-cli` tool to quickly initialize a new + * [x/mock/simulation] Randomized simulation framework + * Modules specify invariants and operations, preferably in an x/[module]/simulation package + * Modules can test random combinations of their own operations + * Applications can integrate operations and invariants from modules together for an integrated simulation + * Simulates Tendermint's algorithm for validator set updates + * Simulates validator signing/downtime with a Markov chain, and occaisional double-signatures + * Includes simulated operations & invariants for staking, slashing, governance, and bank modules + * [store] [\#1481](https://github.com/cosmos/cosmos-sdk/issues/1481) Add transient store + * [baseapp] Initialize validator set on ResponseInitChain + * [baseapp] added BaseApp.Seal - ability to seal baseapp parameters once they've been set + * [cosmos-sdk-cli] New `cosmos-sdk-cli` tool to quickly initialize a new SDK-based project - - [scripts] added log output monitoring to DataDog using Ansible scripts + * [scripts] added log output monitoring to DataDog using Ansible scripts IMPROVEMENTS * Gaia - - [spec] [\#967](https://github.com/cosmos/cosmos-sdk/issues/967) Inflation and distribution specs drastically improved - - [x/gov] [\#1773](https://github.com/cosmos/cosmos-sdk/issues/1773) Votes on a proposal can now be queried - - [x/gov] Initial governance parameters can now be set in the genesis file - - [x/stake] [\#1815](https://github.com/cosmos/cosmos-sdk/issues/1815) Sped up the processing of `EditValidator` txs. - - [config] [\#1930](https://github.com/cosmos/cosmos-sdk/issues/1930) Transactions indexer indexes all tags by default. - - [ci] [#2057](https://github.com/cosmos/cosmos-sdk/pull/2057) Run `make localnet-start` on every commit and ensure network reaches at least 10 blocks + * [spec] [\#967](https://github.com/cosmos/cosmos-sdk/issues/967) Inflation and distribution specs drastically improved + * [x/gov] [\#1773](https://github.com/cosmos/cosmos-sdk/issues/1773) Votes on a proposal can now be queried + * [x/gov] Initial governance parameters can now be set in the genesis file + * [x/stake] [\#1815](https://github.com/cosmos/cosmos-sdk/issues/1815) Sped up the processing of `EditValidator` txs. + * [config] [\#1930](https://github.com/cosmos/cosmos-sdk/issues/1930) Transactions indexer indexes all tags by default. + * [ci] [#2057](https://github.com/cosmos/cosmos-sdk/pull/2057) Run `make localnet-start` on every commit and ensure network reaches at least 10 blocks * SDK - - [baseapp] [\#1587](https://github.com/cosmos/cosmos-sdk/issues/1587) Allow any alphanumeric character in route - - [baseapp] Allow any alphanumeric character in route - - [tools] Remove `rm -rf vendor/` from `make get_vendor_deps` - - [x/auth] Recover ErrorOutOfGas panic in order to set sdk.Result attributes correctly - - [x/auth] [\#2376](https://github.com/cosmos/cosmos-sdk/issues/2376) No longer runs any signature in a multi-msg, if any account/sequence number is wrong. - - [x/auth] [\#2376](https://github.com/cosmos/cosmos-sdk/issues/2376) No longer charge gas for subtracting fees - - [x/bank] Unit tests are now table-driven - - [tests] Add tests to example apps in docs - - [tests] Fixes ansible scripts to work with AWS too - - [tests] [\#1806](https://github.com/cosmos/cosmos-sdk/issues/1806) CLI tests are now behind the build flag 'cli_test', so go test works on a new repo + * [baseapp] [\#1587](https://github.com/cosmos/cosmos-sdk/issues/1587) Allow any alphanumeric character in route + * [baseapp] Allow any alphanumeric character in route + * [tools] Remove `rm -rf vendor/` from `make get_vendor_deps` + * [x/auth] Recover ErrorOutOfGas panic in order to set sdk.Result attributes correctly + * [x/auth] [\#2376](https://github.com/cosmos/cosmos-sdk/issues/2376) No longer runs any signature in a multi-msg, if any account/sequence number is wrong. + * [x/auth] [\#2376](https://github.com/cosmos/cosmos-sdk/issues/2376) No longer charge gas for subtracting fees + * [x/bank] Unit tests are now table-driven + * [tests] Add tests to example apps in docs + * [tests] Fixes ansible scripts to work with AWS too + * [tests] [\#1806](https://github.com/cosmos/cosmos-sdk/issues/1806) CLI tests are now behind the build flag 'cli_test', so go test works on a new repo BUG FIXES * Gaia CLI (`gaiacli`) - - [\#1766](https://github.com/cosmos/cosmos-sdk/issues/1766) Fixes bad example for keybase identity - - [x/stake] [\#2021](https://github.com/cosmos/cosmos-sdk/issues/2021) Fixed repeated CLI commands in staking + * [\#1766](https://github.com/cosmos/cosmos-sdk/issues/1766) Fixes bad example for keybase identity + * [x/stake] [\#2021](https://github.com/cosmos/cosmos-sdk/issues/2021) Fixed repeated CLI commands in staking * Gaia - - [x/stake] [#2077](https://github.com/cosmos/cosmos-sdk/pull/2077) Fixed invalid cliff power comparison - - [\#1804](https://github.com/cosmos/cosmos-sdk/issues/1804) Fixes gen-tx genesis generation logic temporarily until upstream updates - - [\#1799](https://github.com/cosmos/cosmos-sdk/issues/1799) Fix `gaiad export` - - [\#1839](https://github.com/cosmos/cosmos-sdk/issues/1839) Fixed bug where intra-tx counter wasn't set correctly for genesis validators - - [x/stake] [\#1858](https://github.com/cosmos/cosmos-sdk/issues/1858) Fixed bug where the cliff validator was not updated correctly - - [tests] [\#1675](https://github.com/cosmos/cosmos-sdk/issues/1675) Fix non-deterministic `test_cover` - - [tests] [\#1551](https://github.com/cosmos/cosmos-sdk/issues/1551) Fixed invalid LCD test JSON payload in `doIBCTransfer` - - [basecoin] Fixes coin transaction failure and account query [discussion](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/6) - - [x/gov] [\#1757](https://github.com/cosmos/cosmos-sdk/issues/1757) Fix VoteOption conversion to String - * [x/stake] [#2083] Fix broken invariant of bonded validator power decrease + * [x/stake] [#2077](https://github.com/cosmos/cosmos-sdk/pull/2077) Fixed invalid cliff power comparison + * [\#1804](https://github.com/cosmos/cosmos-sdk/issues/1804) Fixes gen-tx genesis generation logic temporarily until upstream updates + * [\#1799](https://github.com/cosmos/cosmos-sdk/issues/1799) Fix `gaiad export` + * [\#1839](https://github.com/cosmos/cosmos-sdk/issues/1839) Fixed bug where intra-tx counter wasn't set correctly for genesis validators + * [x/stake] [\#1858](https://github.com/cosmos/cosmos-sdk/issues/1858) Fixed bug where the cliff validator was not updated correctly + * [tests] [\#1675](https://github.com/cosmos/cosmos-sdk/issues/1675) Fix non-deterministic `test_cover` + * [tests] [\#1551](https://github.com/cosmos/cosmos-sdk/issues/1551) Fixed invalid LCD test JSON payload in `doIBCTransfer` + * [basecoin] Fixes coin transaction failure and account query [discussion](https://forum.cosmos.network/t/unmarshalbinarybare-expected-to-read-prefix-bytes-75fbfab8-since-it-is-registered-concrete-but-got-0a141dfa/664/6) + * [x/gov] [\#1757](https://github.com/cosmos/cosmos-sdk/issues/1757) Fix VoteOption conversion to String + * [x/stake] [#2083] Fix broken invariant of bonded validator power decrease ## 0.23.1 -*July 27th, 2018* +_July 27th, 2018_. BUG FIXES - * [tendermint] Update to v0.22.8 - - [consensus, blockchain] Register the Evidence interface so it can be + +* [tendermint] Update to v0.22.8 + * [consensus, blockchain] Register the Evidence interface so it can be marshalled/unmarshalled by the blockchain and consensus reactors ## 0.23.0 -*July 25th, 2018* +_July 25th, 2018_. BREAKING CHANGES + * [x/stake] Fixed the period check for the inflation calculation IMPROVEMENTS + * [cli] Improve error messages for all txs when the account doesn't exist * [tendermint] Update to v0.22.6 - - Updates the crypto imports/API (#1966) + * Updates the crypto imports/API (#1966) * [x/stake] Add revoked to human-readable validator BUG FIXES + * [tendermint] Update to v0.22.6 - - Fixes some security vulnerabilities reported in the [Bug Bounty](https://hackerone.com/tendermint) + * Fixes some security vulnerabilities reported in the [Bug Bounty](https://hackerone.com/tendermint) * [\#1797](https://github.com/cosmos/cosmos-sdk/issues/1797) Fix off-by-one error in slashing for downtime * [\#1787](https://github.com/cosmos/cosmos-sdk/issues/1787) Fixed bug where Tally fails due to revoked/unbonding validator * [\#1666](https://github.com/cosmos/cosmos-sdk/issues/1666) Add intra-tx counter to the genesis validators ## 0.22.0 -*July 16th, 2018* +_July 16th, 2018_. BREAKING CHANGES + * [x/gov] Increase VotingPeriod, DepositPeriod, and MinDeposit IMPROVEMENTS + * [gaiad] Default config updates: - - `timeout_commit=5000` so blocks only made every 5s - - `prof_listen_addr=localhost:6060` so profile server is on by default - - `p2p.send_rate` and `p2p.recv_rate` increases 10x (~5MB/s) + * `timeout_commit=5000` so blocks only made every 5s + * `prof_listen_addr=localhost:6060` so profile server is on by default + * `p2p.send_rate` and `p2p.recv_rate` increases 10x (~5MB/s) BUG FIXES + * [server] Fix to actually overwrite default tendermint config ## 0.21.1 -*July 14th, 2018* +_July 14th, 2018_. BUG FIXES + * [build] Added Ledger build support via `LEDGER_ENABLED=true|false` - * True by default except when cross-compiling + * True by default except when cross-compiling ## 0.21.0 -*July 13th, 2018* +_July 13th, 2018_. BREAKING CHANGES + * [x/stake] Specify DelegatorAddress in MsgCreateValidator * [x/stake] Remove the use of global shares in the pool - * Remove the use of `PoolShares` type in `x/stake/validator` type - replace with `Status` `Tokens` fields + * Remove the use of `PoolShares` type in `x/stake/validator` type - replace with `Status` `Tokens` fields * [x/auth] NewAccountMapper takes a constructor instead of a prototype * [keys] Keybase.Update function now takes in a function to get the newpass, rather than the password itself FEATURES + * [baseapp] NewBaseApp now takes option functions as parameters IMPROVEMENTS + * Updated docs folder to accommodate cosmos.network docs project * [store] Added support for tracing multi-store operations via `--trace-store` * [store] Pruning strategy configurable with pruning flag on gaiad start BUG FIXES + * [\#1630](https://github.com/cosmos/cosmos-sdk/issues/1630) - redelegation nolonger removes tokens from the delegator liquid account * [keys] [\#1629](https://github.com/cosmos/cosmos-sdk/issues/1629) - updating password no longer asks for a new password when the first entered password was incorrect * [lcd] importing an account would create a random account * [server] 'gaiad init' command family now writes provided name as the moniker in `config.toml` * [build] Added Ledger build support via `LEDGER_ENABLED=true|false` - * True by default except when cross-compiling + * True by default except when cross-compiling ## 0.20.0 -*July 10th, 2018* +_July 10th, 2018_. BREAKING CHANGES + * msg.GetSignBytes() returns sorted JSON (by key) * msg.GetSignBytes() field changes * `msg_bytes` -> `msgs` @@ -3325,7 +3345,7 @@ BREAKING CHANGES * ED25519 addresses are the first 20-bytes of the SHA256 of the raw 32-byte pubkey (Instead of RIPEMD160) * go-crypto, abci, tmlibs have been merged into Tendermint - * The keys sub-module is now in the SDK + * The keys sub-module is now in the SDK * Various other fixes * [auth] Signers of a transaction now only sign over their own account and sequence number * [auth] Removed MsgChangePubKey @@ -3339,21 +3359,21 @@ BREAKING CHANGES * [keys] Keybase and Ledger support from go-crypto merged into the SDK in the `crypto` folder * [cli] Rearranged commands under subcommands * [x/slashing] Update slashing for unbonding period - * Slash according to power at time of infraction instead of power at + * Slash according to power at time of infraction instead of power at time of discovery - * Iterate through unbonding delegations & redelegations which contributed + * Iterate through unbonding delegations & redelegations which contributed to an infraction, slash them proportional to their stake at the time - * Add REST endpoint to unrevoke a validator previously revoked for downtime - * Add REST endpoint to retrieve liveness signing information for a validator + * Add REST endpoint to unrevoke a validator previously revoked for downtime + * Add REST endpoint to retrieve liveness signing information for a validator * [x/stake] Remove Tick and add EndBlocker * [x/stake] most index keys nolonger hold a value - inputs are rearranged to form the desired key * [x/stake] store-value for delegation, validator, ubd, and red do not hold duplicate information contained store-key * [x/stake] Introduce concept of unbonding for delegations and validators - * `gaiacli stake unbond` replaced with `gaiacli stake begin-unbonding` - * Introduced: - * `gaiacli stake complete-unbonding` - * `gaiacli stake begin-redelegation` - * `gaiacli stake complete-redelegation` + * `gaiacli stake unbond` replaced with `gaiacli stake begin-unbonding` + * Introduced: + * `gaiacli stake complete-unbonding` + * `gaiacli stake begin-redelegation` + * `gaiacli stake complete-redelegation` * [lcd] Switch key creation output to return bech32 * [lcd] Removed shorthand CLI flags (`a`, `c`, `n`, `o`) * [gaiad] genesis transactions now use bech32 addresses / pubkeys @@ -3361,36 +3381,38 @@ BREAKING CHANGES * [gov] VoteOption, ProposalType, and ProposalStatus all marshal to string form in JSON DEPRECATED + * [cli] Deprecated `--name` flag in commands that send txs, in favor of `--from` FEATURES + * [x/gov] Implemented MVP - * Supported proposal types: just binary (pass/fail) TextProposals for now - * Proposals need deposits to be votable; deposits are burned if proposal fails - * Delegators delegate votes to validator by default but can override (for their stake) + * Supported proposal types: just binary (pass/fail) TextProposals for now + * Proposals need deposits to be votable; deposits are burned if proposal fails + * Delegators delegate votes to validator by default but can override (for their stake) * [gaiacli] Ledger support added - - You can now use a Ledger with `gaiacli --ledger` for all key-related commands - - Ledger keys can be named and tracked locally in the key DB + * You can now use a Ledger with `gaiacli --ledger` for all key-related commands + * Ledger keys can be named and tracked locally in the key DB * [gaiacli] You can now attach a simple text-only memo to any transaction, with the `--memo` flag * [gaiacli] added the following flags for commands that post transactions to the chain: - * async -- send the tx without waiting for a tendermint response - * json -- return the output in json format for increased readability - * print-response -- return the tx response. (includes fields like gas cost) + * async -- send the tx without waiting for a tendermint response + * json -- return the output in json format for increased readability + * print-response -- return the tx response. (includes fields like gas cost) * [lcd] Queried TXs now include the tx hash to identify each tx * [mockapp] CompleteSetup() no longer takes a testing parameter * [x/bank] Add benchmarks for signing and delivering a block with a single bank transaction - * Run with `cd x/bank && go test --bench=.` + * Run with `cd x/bank && go test --bench=.` * [tools] make get_tools installs tendermint's linter, and gometalinter * [tools] Switch gometalinter to the stable version * [tools] Add the following linters - * misspell - * gofmt - * go vet -composites=false - * unconvert - * ineffassign - * errcheck - * unparam - * gocyclo + * misspell + * gofmt + * go vet -composites=false + * unconvert + * ineffassign + * errcheck + * unparam + * gocyclo * [tools] Added `make format` command to automate fixing misspell and gofmt errors. * [server] Default config now creates a profiler at port 6060, and increase p2p send/recv rates * [types] Switches internal representation of Int/Uint/Rat to use pointers @@ -3398,13 +3420,15 @@ FEATURES * [gaiad] `unsafe_reset_all` now resets addrbook.json * [democoin] add x/oracle, x/assoc * [tests] created a randomized testing framework. - - Currently bank has limited functionality in the framework - - Auth has its invariants checked within the framework + * Currently bank has limited functionality in the framework + * Auth has its invariants checked within the framework * [tests] Add WaitForNextNBlocksTM helper method * [keys] New keys now have 24 word recovery keys, for heightened security -- [keys] Add a temporary method for exporting the private key + +* [keys] Add a temporary method for exporting the private key IMPROVEMENTS + * [x/bank] Now uses go-wire codec instead of 'encoding/json' * [x/auth] Now uses go-wire codec instead of 'encoding/json' * revised use of endblock and beginblock @@ -3420,6 +3444,7 @@ IMPROVEMENTS * [docs] Added commands for governance CLI on testnet README BUG FIXES + * [x/slashing] [\#1510](https://github.com/cosmos/cosmos-sdk/issues/1510) Unrevoked validators cannot un-revoke themselves * [x/stake] [\#1513](https://github.com/cosmos/cosmos-sdk/issues/1513) Validators slashed to zero power are unbonded and removed from the store * [x/stake] [\#1567](https://github.com/cosmos/cosmos-sdk/issues/1567) Validators decreased in power but not unbonded are now updated in Tendermint @@ -3450,18 +3475,21 @@ BUG FIXES ## 0.19.0 -*June 13, 2018* +_June 13, 2018_. BREAKING CHANGES + * msg.GetSignBytes() now returns bech32-encoded addresses in all cases * [lcd] REST end-points now include gas * sdk.Coin now uses sdk.Int, a big.Int wrapper with 256bit range cap FEATURES + * [x/auth] Added AccountNumbers to BaseAccount and StdTxs to allow for replay protection with account pruning * [lcd] added an endpoint to query for the SDK version of the connected node IMPROVEMENTS + * export command now writes current validator set for Tendermint * [tests] Application module tests now use a mock application * [gaiacli] Fix error message when account isn't found when running gaiacli account @@ -3471,6 +3499,7 @@ IMPROVEMENTS * [x/stake] More stake tests added to test ByPower index FIXES + * Fixes consensus fault on testnet - see postmortem [here](https://github.com/cosmos/cosmos-sdk/issues/1197#issuecomment-396823021) * [x/stake] bonded inflation removed, non-bonded inflation partially implemented * [lcd] Switch to bech32 for addresses on all human readable inputs and outputs @@ -3480,12 +3509,13 @@ FIXES * [x/slashing] Set signInfo.StartHeight correctly for newly bonded validators FEATURES + * [docs] Reorganize documentation * [docs] Update staking spec, create WIP spec for slashing, and fees ## 0.18.0 -*June 9, 2018* +_June 9, 2018_. BREAKING CHANGES @@ -3494,22 +3524,22 @@ BREAKING CHANGES * [stake] `gaiacli query validator` takes and argument instead of using the `--address-candidate` flag * [stake] introduce `gaiacli query delegations` * [stake] staking refactor - * ValidatorsBonded store now take sorted pubKey-address instead of validator owner-address, + * ValidatorsBonded store now take sorted pubKey-address instead of validator owner-address, is sorted like Tendermint by pk's address - * store names more understandable - * removed temporary ToKick store, just needs a local map! - * removed distinction between candidates and validators - * everything is now a validator - * only validators with a status == bonded are actively validating/receiving rewards - * Introduction of Unbonding fields, lowlevel logic throughout (not fully implemented with queue) - * Introduction of PoolShares type within validators, + * store names more understandable + * removed temporary ToKick store, just needs a local map! + * removed distinction between candidates and validators + * everything is now a validator + * only validators with a status == bonded are actively validating/receiving rewards + * Introduction of Unbonding fields, lowlevel logic throughout (not fully implemented with queue) + * Introduction of PoolShares type within validators, replaces three rational fields (BondedShares, UnbondingShares, UnbondedShares * [x/auth] move stuff specific to auth anteHandler to the auth module rather than the types folder. This includes: - * StdTx (and its related stuff i.e. StdSignDoc, etc) - * StdFee - * StdSignature - * Account interface - * Related to this organization, I also: + * StdTx (and its related stuff i.e. StdSignDoc, etc) + * StdFee + * StdSignature + * Account interface + * Related to this organization, I also: * [x/auth] got rid of AccountMapper interface (in favor of the struct already in auth module) * [x/auth] removed the FeeHandler function from the AnteHandler, Replaced with FeeKeeper * [x/auth] Removed GetSignatures() from Tx interface (as different Tx styles might use something different than StdSignature) @@ -3524,9 +3554,9 @@ FEATURES * [x/auth] Added ability to change pubkey to auth module * [baseapp] baseapp now has settable functions for filtering peers by address/port & public key * [sdk] Gas consumption is now measured as transactions are executed - * Transactions which run out of gas stop execution and revert state changes - * A "simulate" query has been added to determine how much gas a transaction will need - * Modules can include their own gas costs for execution of particular message types + * Transactions which run out of gas stop execution and revert state changes + * A "simulate" query has been added to determine how much gas a transaction will need + * Modules can include their own gas costs for execution of particular message types * [stake] Seperation of fee distribution to a new module * [stake] Creation of a validator/delegation generics in `/types` * [stake] Helper Description of the store in x/stake/store.md @@ -3550,48 +3580,28 @@ BUG FIXES * Auto-sequencing now works correctly * [gaiacli] Fix error message when account isn't found when running gaiacli account - -## 0.17.5 - -*June 5, 2018* - -Update to Tendermint v0.19.9 (Fix evidence reactor, mempool deadlock, WAL panic, -memory leak) - -## 0.17.4 - -*May 31, 2018* - -Update to Tendermint v0.19.7 (WAL fixes and more) - -## 0.17.3 - -*May 29, 2018* - -Update to Tendermint v0.19.6 (fix fast-sync halt) - ## 0.17.5 -*June 5, 2018* +_June 5, 2018_. Update to Tendermint v0.19.9 (Fix evidence reactor, mempool deadlock, WAL panic, memory leak) ## 0.17.4 -*May 31, 2018* +_May 31, 2018_. Update to Tendermint v0.19.7 (WAL fixes and more) ## 0.17.3 -*May 29, 2018* +_May 29, 2018_. Update to Tendermint v0.19.6 (fix fast-sync halt) ## 0.17.2 -_May 20, 2018_ +_May 20, 2018_. Update to Tendermint v0.19.5 (reduce WAL use, bound the mempool and some rpcs, improve logging) @@ -3637,8 +3647,8 @@ BREAKING CHANGES * [stake] Delegator bonds now store the height at which they were updated * All module keepers now require a codespace, see basecoin or democoin for usage * Many changes to names throughout - * Type as a prefix naming convention applied (ex. BondMsg -> MsgBond) - * Removed redundancy in names (ex. stake.StakingKeeper -> stake.Keeper) + * Type as a prefix naming convention applied (ex. BondMsg -> MsgBond) + * Removed redundancy in names (ex. stake.StakingKeeper -> stake.Keeper) * Removed SealedAccountMapper * gaiad init now requires use of `--name` flag * Removed Get from Msg interface @@ -3651,9 +3661,9 @@ FEATURES: * Repo is now lint compliant / GoMetaLinter with tendermint-lint integrated into CI * Better key output, pubkey go-amino hex bytes now output by default * gaiad init overhaul - * Create genesis transactions with `gaiad init gen-tx` - * New genesis account keys are automatically added to the client keybase (introduce `--client-home` flag) - * Initialize with genesis txs using `--gen-txs` flag + * Create genesis transactions with `gaiad init gen-tx` + * New genesis account keys are automatically added to the client keybase (introduce `--client-home` flag) + * Initialize with genesis txs using `--gen-txs` flag * Context now has access to the application-configured logger * Add (non-proof) subspace query helper functions * Add more staking query functions: candidates, delegator-bonds @@ -3899,27 +3909,27 @@ the testnet. IMPROVEMENTS: * basecoin - * `basecoin start` supports all flags that `tendermint node` does, such as + * `basecoin start` supports all flags that `tendermint node` does, such as `--rpc.laddr`, `--p2p.seeds`, and `--p2p.skip_upnp` - * fully supports `--log_level` and `--trace` for logger configuration - * merkleeyes no longers spams the logs... unless you want it - * Example: `basecoin start --log_level="merkleeyes:info,state:info,*:error"` - * Example: `basecoin start --log_level="merkleeyes:debug,state:info,*:error"` + * fully supports `--log_level` and `--trace` for logger configuration + * merkleeyes no longers spams the logs... unless you want it + * Example: `basecoin start --log_level="merkleeyes:info,state:info,*:error"` + * Example: `basecoin start --log_level="merkleeyes:debug,state:info,*:error"` * basecli - * `basecli init` is more intelligent and only complains if there really was + * `basecli init` is more intelligent and only complains if there really was a connected chain, not just random files - * support `localhost:46657` or `http://localhost:46657` format for nodes, + * support `localhost:46657` or `http://localhost:46657` format for nodes, not just `tcp://localhost:46657` - * Add `--genesis` to init to specify chain-id and validator hash - * Example: `basecli init --node=localhost:46657 --genesis=$HOME/.basecoin/genesis.json` - * `basecli rpc` has a number of methods to easily accept tendermint rpc, and verifies what it can + * Add `--genesis` to init to specify chain-id and validator hash + * Example: `basecli init --node=localhost:46657 --genesis=$HOME/.basecoin/genesis.json` + * `basecli rpc` has a number of methods to easily accept tendermint rpc, and verifies what it can BUG FIXES: * basecli - * `basecli query account` accepts hex account address with or without `0x` + * `basecli query account` accepts hex account address with or without `0x` prefix - * gives error message when running commands on an unitialized chain, rather + * gives error message when running commands on an unitialized chain, rather than some unintelligable panic ## 0.6.0 (June 22, 2017) @@ -3931,28 +3941,28 @@ BREAKING CHANGES: * ./cmd/commands -> ./cmd/basecoin/commands * basecli - * `basecli proof state get` -> `basecli query key` - * `basecli proof tx get` -> `basecli query tx` - * `basecli proof state get --app=account` -> `basecli query account` - * use `--chain-id` not `--chainid` for consistency - * update to use `--trace` not `--debug` for stack traces on errors - * complete overhaul on how tx and query subcommands are added. (see counter or trackomatron for examples) - * no longer supports counter app (see new countercli) + * `basecli proof state get` -> `basecli query key` + * `basecli proof tx get` -> `basecli query tx` + * `basecli proof state get --app=account` -> `basecli query account` + * use `--chain-id` not `--chainid` for consistency + * update to use `--trace` not `--debug` for stack traces on errors + * complete overhaul on how tx and query subcommands are added. (see counter or trackomatron for examples) + * no longer supports counter app (see new countercli) * basecoin - * `basecoin init` takes an argument, an address to allocate funds to in the genesis - * removed key2.json - * removed all client side functionality from it (use basecli now for proofs) - * no tx subcommand - * no query subcommand - * no account (query) subcommand - * a few other random ones... - * enhanced relay subcommand - * relay start did what relay used to do - * relay init registers both chains on one another (to set it up so relay start just works) + * `basecoin init` takes an argument, an address to allocate funds to in the genesis + * removed key2.json + * removed all client side functionality from it (use basecli now for proofs) + * no tx subcommand + * no query subcommand + * no account (query) subcommand + * a few other random ones... + * enhanced relay subcommand + * relay start did what relay used to do + * relay init registers both chains on one another (to set it up so relay start just works) * docs - * removed `example-plugin`, put `counter` inside `docs/guide` + * removed `example-plugin`, put `counter` inside `docs/guide` * app - * Implements ABCI handshake by proxying merkleeyes.Info() + * Implements ABCI handshake by proxying merkleeyes.Info() IMPROVEMENTS: @@ -3991,19 +4001,19 @@ BREAKING CHANGES: IMPROVEMENTS: * basecoin cli - * integrates tendermint 0.10.0 and unifies cli (init, unsafe_reset_all, ...) - * integrate viper, all command line flags can also be defined in environmental variables or config.toml + * integrates tendermint 0.10.0 and unifies cli (init, unsafe_reset_all, ...) + * integrate viper, all command line flags can also be defined in environmental variables or config.toml * genesis file - * you can define accounts with either address or pub_key - * sorts coins for you, so no silent errors if not in alphabetical order + * you can define accounts with either address or pub_key + * sorts coins for you, so no silent errors if not in alphabetical order * [light-client](https://github.com/tendermint/light-client) integration - * no longer must you trust the node you connect to, prove everything! - * new [basecli command](./cmd/basecli/README.md) - * integrated [key management](https://github.com/tendermint/go-crypto/blob/master/cmd/README.md), stored encrypted locally - * tracks validator set changes and proves everything from one initial validator seed - * `basecli proof state` gets complete proofs for any abci state - * `basecli proof tx` gets complete proof where a tx was stored in the chain - * `basecli proxy` exposes tendermint rpc, but only passes through results after doing complete verification + * no longer must you trust the node you connect to, prove everything! + * new [basecli command](./cmd/basecli/README.md) + * integrated [key management](https://github.com/tendermint/go-crypto/blob/master/cmd/README.md), stored encrypted locally + * tracks validator set changes and proves everything from one initial validator seed + * `basecli proof state` gets complete proofs for any abci state + * `basecli proof tx` gets complete proof where a tx was stored in the chain + * `basecli proxy` exposes tendermint rpc, but only passes through results after doing complete verification BUG FIXES: @@ -4041,7 +4051,7 @@ BREAKING CHANGES: To start just the ABCI app/server, use `basecoin start --without-tendermint`. * Consolidate genesis files so the Basecoin genesis is an object under `app_options` in Tendermint genesis. For instance: -``` +```json { "app_hash": "", "chain_id": "foo_bar_chain", @@ -4117,12 +4127,12 @@ BUG FIXES: ## PreHistory -##### January 14-18, 2017 +### January 14-18, 2017 * Update to Tendermint v0.8.0 * Cleanup a bit and release blog post -##### September 22, 2016 +### September 22, 2016 * Basecoin compiles again diff --git a/CODING_GUIDELINES.md b/CODING_GUIDELINES.md index 79dcf2ebb195..955710a46aba 100644 --- a/CODING_GUIDELINES.md +++ b/CODING_GUIDELINES.md @@ -4,32 +4,32 @@ This document is an extension to [CONTRIBUTING](./CONTRIBUTING.md) and provides ## API & Design -+ Code must be well structured: - + packages must have a limited responsibility (different concerns can go to different packages), - + types must be easy to compose, - + think about maintainbility and testability. -+ "Depend upon abstractions, [not] concretions". -+ Try to limit the number of methods you are exposing. It's easier to expose something later than to hide it. -+ Take advantage of `internal` package concept. -+ Follow agreed-upon design patterns and naming conventions. -+ publicly-exposed functions are named logically, have forward-thinking arguments and return types. -+ Avoid global variables and global configurators. -+ Favor composable and extensible designs. -+ Minimize code duplication. -+ Limit third-party dependencies. +* Code must be well structured: + * packages must have a limited responsibility (different concerns can go to different packages), + * types must be easy to compose, + * think about maintainbility and testability. +* "Depend upon abstractions, [not] concretions". +* Try to limit the number of methods you are exposing. It's easier to expose something later than to hide it. +* Take advantage of `internal` package concept. +* Follow agreed-upon design patterns and naming conventions. +* publicly-exposed functions are named logically, have forward-thinking arguments and return types. +* Avoid global variables and global configurators. +* Favor composable and extensible designs. +* Minimize code duplication. +* Limit third-party dependencies. Performance: -+ Avoid unnecessary operations or memory allocations. +* Avoid unnecessary operations or memory allocations. Security: -+ Pay proper attention to exploits involving: - + gas usage - + transaction verification and signatures - + malleability - + code must be always deterministic -+ Thread safety. If some functionality is not thread-safe, or uses something that is not thread-safe, then clearly indicate the risk on each level. +* Pay proper attention to exploits involving: + * gas usage + * transaction verification and signatures + * malleability + * code must be always deterministic +* Thread safety. If some functionality is not thread-safe, or uses something that is not thread-safe, then clearly indicate the risk on each level. ## Acceptance tests @@ -43,14 +43,14 @@ UAT should be revisited at each stage of the product development: ![acceptance-tests.png](./docs/assets/acceptance-tests.png) -### Why Acceptance Testing? +### Why Acceptance Testing -- Automated acceptance tests catch serious problems that unit or component test suites could never catch. -- Automated acceptance tests deliver business value the users are expecting as they test user scenarios. -- Automated acceptance tests executed and passed on every build help improve the software delivery process. -- Testers, developers, and customers need to work closely to create suitable automated acceptance test suites. +* Automated acceptance tests catch serious problems that unit or component test suites could never catch. +* Automated acceptance tests deliver business value the users are expecting as they test user scenarios. +* Automated acceptance tests executed and passed on every build help improve the software delivery process. +* Testers, developers, and customers need to work closely to create suitable automated acceptance test suites. -### How to define Acceptance Test? +### How to define Acceptance Test The best way to define AT is by starting from the user stories and think about all positive and negative scenarios a user can perform. @@ -58,9 +58,9 @@ Product Developers should collaborate with stakeholders to define AT. Functional A good pattern for defining AT is listing scenarios with [GIVEN-WHEN-THEN](https://martinfowler.com/bliki/GivenWhenThen.html) format where: -- **GIVEN**: A set of initial circumstances (e.g. bank balance) -- **WHEN**: Some event happens (e.g. customer attempts a transfer) -- **THEN**: The expected result as per the defined behavior of the system +* **GIVEN**: A set of initial circumstances (e.g. bank balance) +* **WHEN**: Some event happens (e.g. customer attempts a transfer) +* **THEN**: The expected result as per the defined behavior of the system In other words: we define a use case input, current state and the expected outcome. Example: @@ -79,9 +79,9 @@ In other words: we define a use case input, current state and the expected outco *Reference: [writing acceptance tests](https://openclassrooms.com/en/courses/4544611-write-agile-documentation-user-stories-acceptance-tests/4810081-writing-acceptance-tests)*. -### How and where to add acceptance tests? +### How and where to add acceptance tests -Acceptance tests are written in the Markdown format, using the scenario template described above, and be part of the specification (`xx_test.md` file in _spec_ directory). Example: (`eco-credits/spec/06.test.md`)[https://github.com/regen-network/regen-ledger/blob/7297783577e6cd102c5093365b573163680f36a1/x/ecocredit/spec/06_tests.md] +Acceptance tests are written in the Markdown format, using the scenario template described above, and be part of the specification (`xx_test.md` file in *spec* directory). Example: [`eco-credits/spec/06.test.md`](https://github.com/regen-network/regen-ledger/blob/7297783577e6cd102c5093365b573163680f36a1/x/ecocredit/spec/06_tests.md). Acceptance tests should be defined during the design phase or at an early stage of development. Moreover, they should be defined before writing a module architecture - it will clarify the purpose and usage of the software. Automated tests should cover all acceptance tests scenarios. @@ -90,11 +90,11 @@ Automated tests should cover all acceptance tests scenarios. Make sure your code is well tested: -+ Provide unit tests for every unit of your code if possible. Unit tests are expected to comprise 70%-80% of your tests. -+ Describe the test scenarios you are implementing for integration tests. -+ Create integration tests for queries and msgs. -+ Use both test cases and property / fuzzy testing. We use the [rapid](pgregory.net/rapid) Go library for property-based and fuzzy testing. -+ Do not decrease code test coverage. Explain in a PR if test coverage is decreased. +* Provide unit tests for every unit of your code if possible. Unit tests are expected to comprise 70%-80% of your tests. +* Describe the test scenarios you are implementing for integration tests. +* Create integration tests for queries and msgs. +* Use both test cases and property / fuzzy testing. We use the [rapid](pgregory.net/rapid) Go library for property-based and fuzzy testing. +* Do not decrease code test coverage. Explain in a PR if test coverage is decreased. We expect tests to use `require` or `assert` rather than `t.Skip` or `t.Fail`, unless there is a reason to do otherwise. @@ -122,24 +122,24 @@ for tcIndex, tc := range cases { We are forming a QA team that will support the core Cosmos SDK team and collaborators by: -- Improving the Cosmos SDK QA Processes -- Improving automation in QA and testing -- Defining high-quality metrics -- Maintaining and improving testing frameworks (unit tests, integration tests, and functional tests) -- Defining test scenarios. -- Verifying user experience and defining a high quality. - - We want to have **acceptance tests**! Document and list acceptance lists that are implemented and identify acceptance tests that are still missing. - - Acceptance tests should be specified in `acceptance-tests` directory as Markdown files. -- Supporting other teams with testing frameworks, automation, and User Experience testing. -- Testing chain upgrades for every new breaking change. - - Defining automated tests that assure data integrity after an update. +* Improving the Cosmos SDK QA Processes +* Improving automation in QA and testing +* Defining high-quality metrics +* Maintaining and improving testing frameworks (unit tests, integration tests, and functional tests) +* Defining test scenarios. +* Verifying user experience and defining a high quality. + * We want to have **acceptance tests**! Document and list acceptance lists that are implemented and identify acceptance tests that are still missing. + * Acceptance tests should be specified in `acceptance-tests` directory as Markdown files. +* Supporting other teams with testing frameworks, automation, and User Experience testing. +* Testing chain upgrades for every new breaking change. + * Defining automated tests that assure data integrity after an update. Desired outcomes: -- QA team works with Development Team. -- QA is happening in parallel with Core Cosmos SDK development. -- Releases are more predictable. -- QA reports. Goal is to guide with new tasks and be one of the QA measures. +* QA team works with Development Team. +* QA is happening in parallel with Core Cosmos SDK development. +* Releases are more predictable. +* QA reports. Goal is to guide with new tasks and be one of the QA measures. As a developer, you must help the QA team by providing instructions for User Experience (UX) and functional testing. @@ -147,6 +147,6 @@ As a developer, you must help the QA team by providing instructions for User Exp Once the AT are defined, the QA team will have an overview of the behavior a user can expect and: -- validate the user experience will be good -- validate the implementation conforms the acceptance tests -- by having a broader overview of the use cases, QA team should be able to define **test suites** and test data to efficiently automate Acceptance Tests and reuse the work. +* validate the user experience will be good +* validate the implementation conforms the acceptance tests +* by having a broader overview of the use cases, QA team should be able to define **test suites** and test data to efficiently automate Acceptance Tests and reuse the work. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 168f1419c37b..d0619eac1d4c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,20 +1,27 @@ # Contributing -- [Contributing](#contributing) - - [Dev Calls](#dev-calls) - - [Architecture Decision Records (ADR)](#architecture-decision-records-adr) - - [Development Procedure](#development-procedure) - - [Testing](#testing) - - [Pull Requests](#pull-requests) - - [Pull Request Templates](#pull-request-templates) - - [Requesting Reviews](#requesting-reviews) - - [Updating Documentation](#updating-documentation) - - [Dependencies](#dependencies) - - [Protobuf](#protobuf) - - [Branching Model and Release](#branching-model-and-release) - - [PR Targeting](#pr-targeting) - - [Code Owner Membership](#code-owner-membership) - - [Concept & Feature Approval Process](#concept--feature-approval-process) +* [Contributing](#contributing) + * [Teams Dev Calls](#teams-dev-calls) + * [Architecture Decision Records (ADR)](#architecture-decision-records-adr) + * [Development Procedure](#development-procedure) + * [Testing](#testing) + * [Pull Requests](#pull-requests) + * [Pull Request Templates](#pull-request-templates) + * [Requesting Reviews](#requesting-reviews) + * [Updating Documentation](#updating-documentation) + * [Dependencies](#dependencies) + * [Protobuf](#protobuf) + * [Branching Model and Release](#branching-model-and-release) + * [PR Targeting](#pr-targeting) + * [Code Owner Membership](#code-owner-membership) + * [Concept & Feature Approval Process](#concept--feature-approval-process) + * [Strategy Discovery](#strategy-discovery) + * [Concept Approval](#concept-approval) + * [Time Bound Period](#time-bound-period) + * [Approval Committee & Decision Making](#approval-committee--decision-making) + * [Committee Members](#committee-members) + * [Committee Criteria](#committee-criteria) + * [Implementation & Release Approval](#implementation--release-approval) Thank you for considering making contributions to the Cosmos SDK and related repositories! @@ -23,13 +30,11 @@ discussion or proposing code changes. To ensure a smooth workflow for all contributors, the general procedure for contributing has been established: 1. Start by browsing [new issues](https://github.com/cosmos/cosmos-sdk/issues) and [discussions](https://github.com/cosmos/cosmos-sdk/discussions). If you are looking for something interesting or if you have something in your mind, there is a chance it was has been discussed. - -- Looking for a good place to start contributing? How about checking out some [good first issues](https://github.com/cosmos/cosmos-sdk/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)? - + * Looking for a good place to start contributing? How about checking out some [good first issues](https://github.com/cosmos/cosmos-sdk/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)? 2. Determine whether a GitHub issue or discussion is more appropriate for your needs: -1. If want to propose something new that requires specification or an additional design, or you would like to change a process, start with a [new discussion](https://github.com/cosmos/cosmos-sdk/discussions/new). With discussions, we can better handle the design process using discussion threads. A discussion usually leads to one or more issues. -2. If the issue you want addressed is a specific proposal or a bug, then open a [new issue](https://github.com/cosmos/cosmos-sdk/issues/new/choose). -3. Review existing [issues](https://github.com/cosmos/cosmos-sdk/issues) to find an issue you'd like to help with. + 1. If want to propose something new that requires specification or an additional design, or you would like to change a process, start with a [new discussion](https://github.com/cosmos/cosmos-sdk/discussions/new). With discussions, we can better handle the design process using discussion threads. A discussion usually leads to one or more issues. + 2. If the issue you want addressed is a specific proposal or a bug, then open a [new issue](https://github.com/cosmos/cosmos-sdk/issues/new/choose). + 3. Review existing [issues](https://github.com/cosmos/cosmos-sdk/issues) to find an issue you'd like to help with. 3. Participate in thoughtful discussion on that issue. 4. If you would like to contribute: 1. Ensure that the proposal has been accepted. @@ -55,10 +60,10 @@ The important development announcements are shared on [Discord](https://discord. To synchronize we have few major meetings: -+ Architecture calls: bi-weekly on Fridays at 14:00 UTC (alternating with the grooming meeting below). -+ Grooming / Planning: bi-weekly on Fridays at 14:00 UTC (alternating with the architecture meeting above). -+ Cosmos Community SDK Development Call on the last Wednesday of every month at 17:00 UTC. -+ Cosmos Roadmap Prioritization every 4 weeks on Tuesday at 15:00 UTC (limited participation). +* Architecture calls: bi-weekly on Fridays at 14:00 UTC (alternating with the grooming meeting below). +* Grooming / Planning: bi-weekly on Fridays at 14:00 UTC (alternating with the architecture meeting above). +* Cosmos Community SDK Development Call on the last Wednesday of every month at 17:00 UTC. +* Cosmos Roadmap Prioritization every 4 weeks on Tuesday at 15:00 UTC (limited participation). If you would like to join one of those calls, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Cory Levinson from Regen Network (cory@regen.network). @@ -68,22 +73,22 @@ When proposing an architecture decision for the Cosmos SDK, please start by open ## Development Procedure -- The latest state of development is on `master`. -- `master` must never fail `make lint test test-race`. -- No `--force` onto `master` (except when reverting a broken commit, which should seldom happen). -- Create a branch to start a wok: - - Fork the repo (core developers must create a branch directly in the Cosmos SDK repo), +* The latest state of development is on `master`. +* `master` must never fail `make lint test test-race`. +* No `--force` onto `master` (except when reverting a broken commit, which should seldom happen). +* Create a branch to start a wok: + * Fork the repo (core developers must create a branch directly in the Cosmos SDK repo), branch from the HEAD of `master`, make some commits, and submit a PR to `master`. - - For core developers working within the `cosmos-sdk` repo, follow branch name conventions to ensure a clear + * For core developers working within the `cosmos-sdk` repo, follow branch name conventions to ensure a clear ownership of branches: `{moniker}/{issue#}-branch-name`. - - See [Branching Model](#branching-model-and-release) for more details. -- Be sure to run `make format` before every commit. The easiest way + * See [Branching Model](#branching-model-and-release) for more details. +* Be sure to run `make format` before every commit. The easiest way to do this is have your editor run it for you upon saving a file (most of the editors will do it anyway using a pre-configured setup of the programming language mode). Additionally, be sure that your code is lint compliant by running `make lint-fix`. A convenience git `pre-commit` hook that runs the formatters automatically before each commit is available in the `contrib/githooks/` directory. -- Follow the [CODING GUIDELINES](CODING_GUIDELINES.md), which defines criteria for designing and coding a software. +* Follow the [CODING GUIDELINES](CODING_GUIDELINES.md), which defines criteria for designing and coding a software. Code is merged into master through pull request procedure. @@ -95,8 +100,8 @@ Tests can be executed by running `make test` at the top level of the Cosmos SDK Before submitting a pull request: -- merge the latest master `git merge origin/master`, -- run `make lint test` to ensure that all checks and tests pass. +* merge the latest master `git merge origin/master`, +* run `make lint test` to ensure that all checks and tests pass. Then: @@ -120,8 +125,8 @@ NOTE: when merging, GitHub will squash commits and rebase on top of the master. There are three PR templates. The [default template](./.github/PULL_REQUEST_TEMPLATE.md) is for types `fix`, `feat`, and `refactor`. We also have a [docs template](./.github/PULL_REQUEST_TEMPLATE/docs.md) for documentation changes and an [other template](./.github/PULL_REQUEST_TEMPLATE/other.md) for changes that do not affect production code. When previewing a PR before it has been opened, you can change the template by adding one of the following parameters to the url: -- `template=docs.md` -- `template=other.md` +* `template=docs.md` +* `template=other.md` ### Requesting Reviews @@ -138,24 +143,24 @@ the case of minor changes to [docs](./.github/PULL_REQUEST_TEMPLATE/docs.md) or for all checked items unless they have indicated otherwise by leaving their handle next to specific items. In addition, use the following review explanations: -- `LGTM` without an explicit approval means that the changes look good, but you haven't thoroughly reviewed the reviewer checklist items. -- `Approval` means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you must add your handle next to the items that you have reviewed. In addition, follow these guidelines: - - You must also think through anything which ought to be included but is not - - You must think through whether any added code could be partially combined (DRYed) with existing code - - You must think through any potential security issues or incentive-compatibility flaws introduced by the changes - - Naming must be consistent with conventions and the rest of the codebase - - Code must live in a reasonable location, considering dependency structures (for example, not importing testing modules in production code, or including example code modules in production code). - - If you approve the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template. -- If you sat down with the PR submitter and did a pairing review, add this information in the `Approval` or your PR comments. -- If you are only making "surface level" reviews, submit notes as a `comment` review. +* `LGTM` without an explicit approval means that the changes look good, but you haven't thoroughly reviewed the reviewer checklist items. +* `Approval` means that you have completed some or all of the reviewer checklist items. If you only reviewed selected items, you must add your handle next to the items that you have reviewed. In addition, follow these guidelines: + * You must also think through anything which ought to be included but is not + * You must think through whether any added code could be partially combined (DRYed) with existing code + * You must think through any potential security issues or incentive-compatibility flaws introduced by the changes + * Naming must be consistent with conventions and the rest of the codebase + * Code must live in a reasonable location, considering dependency structures (for example, not importing testing modules in production code, or including example code modules in production code). + * If you approve the PR, you are responsible for any issues mentioned here and any issues that should have been addressed after thoroughly reviewing the reviewer checklist items in the pull request template. +* If you sat down with the PR submitter and did a pairing review, add this information in the `Approval` or your PR comments. +* If you are only making "surface level" reviews, submit notes as a `comment` review. ### Updating Documentation If you open a PR on the Cosmos SDK, it is mandatory to update the relevant documentation in `/docs`. -- If your change relates to the core SDK (baseapp, store, ...), be sure to update the content in `docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders. -- If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), then modify the content in the `docs/run-node/` folder. -- If your changes relate to a module, then be sure to update the module's spec in `x/moduleName/docs/spec/`. +* If your change relates to the core SDK (baseapp, store, ...), be sure to update the content in `docs/basics/`, `docs/core/` and/or `docs/building-modules/` folders. +* If your changes relate to the core of the CLI (not specifically to module's CLI/Rest), then modify the content in the `docs/run-node/` folder. +* If your changes relate to a module, then be sure to update the module's spec in `x/moduleName/docs/spec/`. When writing documentation, follow the [Documentation Writing Guidelines](./docs/DOC_WRITING_GUIDELINES.md). @@ -189,7 +194,7 @@ In order for imports to properly compile in your IDE, you may need to manually s For example, in vscode your `.vscode/settings.json` should look like: -``` +```json { "protoc": { "options": [ @@ -202,7 +207,7 @@ For example, in vscode your `.vscode/settings.json` should look like: ## Branching Model and Release -User-facing repos should adhere to the trunk based development branching model: https://trunkbaseddevelopment.com/. User branches should start with a user name, example: `{moniker}/{issue#}-branch-name`. +User-facing repos should adhere to the trunk based development branching model: . User branches should start with a user name, example: `{moniker}/{issue#}-branch-name`. The Cosmos SDK repository is a [multi Go module](https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository) repository. It means that we have more than one Go module in a single repository. @@ -272,7 +277,7 @@ is broken up into three distinct stages: **Strategy Discovery**, **Concept Appro * After proposal, a time bound period for Request for Comment (RFC) on ADRs commences * ADRs are intended to be iterative, and may be merged into `master` while still in a `Proposed` status -**Time Bound Period** +#### Time Bound Period * Once a PR for an ADR is opened, reviewers are expected to perform a first review within 1 week of pull request being open @@ -286,20 +291,20 @@ the current state of its discussion. If an ADR is taking longer than 4 weeks to reach a final conclusion, the **Concept Approval Committee** should convene to rectify the situation by either: -- unanimously setting a new time bound period for this ADR -- making changes to the Concept Approval Process (as outlined here) -- making changes to the members of the Concept Approval Committee +* unanimously setting a new time bound period for this ADR +* making changes to the Concept Approval Process (as outlined here) +* making changes to the members of the Concept Approval Committee -**Approval Committee & Decision Making** +#### Approval Committee & Decision Making In absence of general consensus, decision making requires 1/2 vote from the two members of the **Concept Approval Committee**. -**Committee Members** +#### Committee Members * Core Members: **Aaron** (Regen), **Bez** (IG) -**Committee Criteria** +#### Committee Criteria Members must: diff --git a/RELEASE_PROCESS.md b/RELEASE_PROCESS.md index b75bb232be97..ca4b7c5ce7f6 100644 --- a/RELEASE_PROCESS.md +++ b/RELEASE_PROCESS.md @@ -8,36 +8,36 @@ A _major release_ is an increment of the first number (eg: `v1.2` → `v2.0.0`) Before making a new _major_ release we do beta and release candidate releases. For example, for release 1.0.0: -``` +```text v1.0.0-beta1 → v1.0.0-beta2 → ... → v1.0.0-rc1 → v1.0.0-rc2 → ... → v1.0.0 ``` -- Release a first beta version on the `master` branch and freeze `master` from receiving any new features. After beta is released, we focus on releasing the release candidate: - - finish audits and reviews - - kick off a large round of simulation testing (e.g. 400 seeds for 2k blocks) - - perform functional tests - - add more tests - - release new beta version as the bugs are discovered and fixed. -- After the team feels that the `master` works fine we create a `release/vY` branch (going forward known a release branch), where `Y` is the version number, with the patch part substituted to `x` (eg: 0.42.x, 1.0.x). Ensure the release branch is protected so that pushes against the release branch are permitted only by the release manager or release coordinator. - - **PRs targeting this branch can be merged _only_ when exceptional circumstances arise** - - update the GitHub mergify integration by adding instructions for automatically backporting commits from `master` to the `release/vY` using the `backport/Y` label. -- In the release branch, prepare a new version section in the `CHANGELOG.md` - - All links must be link-ified: `$ python ./scripts/linkify_changelog.py CHANGELOG.md` - - Copy the entries into a `RELEASE_CHANGELOG.md`, this is needed so the bot knows which entries to add to the release page on GitHub. -- Create a new annotated git tag for a release candidate (eg: `git tag -a v1.1.0-rc1`) in the release branch. - - from this point we unfreeze master. - - the SDK teams collaborate and do their best to run testnets in order to validate the release. - - when bugs are found, create a PR for `master`, and backport fixes to the release branch. - - create new release candidate tags after bugs are fixed. -- After the team feels the release branch is stable and everything works, create a full release: - - update `CHANGELOG.md`. - - create a new annotated git tag (eg `git -a v1.1.0`) in the release branch. - - Create a GitHub release. +* Release a first beta version on the `master` branch and freeze `master` from receiving any new features. After beta is released, we focus on releasing the release candidate: + * finish audits and reviews + * kick off a large round of simulation testing (e.g. 400 seeds for 2k blocks) + * perform functional tests + * add more tests + * release new beta version as the bugs are discovered and fixed. +* After the team feels that the `master` works fine we create a `release/vY` branch (going forward known a release branch), where `Y` is the version number, with the patch part substituted to `x` (eg: 0.42.x, 1.0.x). Ensure the release branch is protected so that pushes against the release branch are permitted only by the release manager or release coordinator. + * **PRs targeting this branch can be merged _only_ when exceptional circumstances arise** + * update the GitHub mergify integration by adding instructions for automatically backporting commits from `master` to the `release/vY` using the `backport/Y` label. +* In the release branch, prepare a new version section in the `CHANGELOG.md` + * All links must be link-ified: `$ python ./scripts/linkify_changelog.py CHANGELOG.md` + * Copy the entries into a `RELEASE_CHANGELOG.md`, this is needed so the bot knows which entries to add to the release page on GitHub. +* Create a new annotated git tag for a release candidate (eg: `git tag -a v1.1.0-rc1`) in the release branch. + * from this point we unfreeze master. + * the SDK teams collaborate and do their best to run testnets in order to validate the release. + * when bugs are found, create a PR for `master`, and backport fixes to the release branch. + * create new release candidate tags after bugs are fixed. +* After the team feels the release branch is stable and everything works, create a full release: + * update `CHANGELOG.md`. + * create a new annotated git tag (eg `git -a v1.1.0`) in the release branch. + * Create a GitHub release. Following _semver_ philosophy, point releases after `v1.0`: -- must not break API -- can break consensus +* must not break API +* can break consensus Before `v1.0`, point release can break both point API and consensus. @@ -57,9 +57,9 @@ Point Release must follow the [Stable Release Policy](#stable-release-policy). After the release branch has all commits required for the next patch release: -- update `CHANGELOG.md`. -- create a new annotated git tag (eg `git -a v1.1.0`) in the release branch. -- Create a GitHub release. +* update `CHANGELOG.md`. +* create a new annotated git tag (eg `git -a v1.1.0`) in the release branch. +* Create a GitHub release. ## Major Release Maintenance @@ -78,7 +78,7 @@ Only the following major release series have a stable release status: ### Patch Releases Once a Cosmos-SDK release has been completed and published, updates for it are released under certain circumstances -and must follow the [Patch Release Procedure](CONTRIBUTING.md#patch-release-procedure)[Point Release Procedure]. +and must follow the [Patch Release Procedure][CONTRIBUTING.md#patch-release-procedure](Point Release Procedure). ### Rationale @@ -109,11 +109,11 @@ ways in stable releases and `master` branch. To smoothen the update to the latest stable release, the SDK includes a set of CLI commands for managing migrations between SDK versions, under the `migrate` subcommand. Only migration scripts between stable releases are included. For the current major release, and later, migrations are supported. -### What qualifies as a Stable Release Update (SRU)? +### What qualifies as a Stable Release Update (SRU) * **High-impact bugs** * Bugs that may directly cause a security vulnerability. - * *Severe regressions* from a Cosmos-SDK's previous release. This includes all sort of issues + * _Severe regressions_ from a Cosmos-SDK's previous release. This includes all sort of issues that may cause the core packages or the `x/` modules unusable. * Bugs that may cause **loss of user's data**. * Other safe cases: @@ -123,7 +123,7 @@ To smoothen the update to the latest stable release, the SDK includes a set of C features to smoothen the migration to successive releases. * Relatively small yet strictly non-breaking CLI improvements. -### What does not qualify as SRU? +### What does not qualify as SRU * State machine changes. * Breaking changes in Protobuf definitions, as specified in [ADR-044](./docs/architecture/adr-044-protobuf-updates-guidelines.md). @@ -132,7 +132,7 @@ To smoothen the update to the latest stable release, the SDK includes a set of C * CLI-breaking changes. * Cosmetic fixes, such as formatting or linter warning fixes. -### What pull requests will be included in stable point-releases? +### What pull requests will be included in stable point-releases Pull requests that fix bugs and add features that fall in the following categories do not require a **Stable Release Exception** to be granted to be included in a stable point-release: @@ -143,32 +143,32 @@ Pull requests that fix bugs and add features that fall in the following categori * Non-breaking features that are strongly requested by the community. * Non-breaking CLI improvements that are strongly requested by the community. -### What pull requests will NOT be automatically included in stable point-releases? +### What pull requests will NOT be automatically included in stable point-releases As rule of thumb, the following changes will **NOT** be automatically accepted into stable point-releases: * **State machine changes**. * **Protobug-breaking changes**, as specified in [ADR-044](./docs/architecture/adr-044-protobuf-updates- guidelines.md). * **Client-breaking changes**, i.e. changes that prevent gRPC, HTTP and RPC clients to continue interacting with the node without any change. -* **API-breaking changes**, i.e. changes that prevent client applications to *build without modifications* to the client application's source code. +* **API-breaking changes**, i.e. changes that prevent client applications to _build without modifications_ to the client application's source code. * **CLI-breaking changes**, i.e. changes that require usage changes for CLI users. - In some circumstances, PRs that don't meet the aforementioned criteria might be raised and asked to be granted a *Stable Release Exception*. + In some circumstances, PRs that don't meet the aforementioned criteria might be raised and asked to be granted a _Stable Release Exception_. ### Stable Release Exception - Procedure 1. Check that the bug is either fixed or not reproducible in `master`. It is, in general, not appropriate to release bug fixes for stable releases without first testing them in `master`. Please apply the label [v0.43](https://github.com/cosmos/cosmos-sdk/milestone/26) to the issue. 2. Add a comment to the issue and ensure it contains the following information (see the bug template below): -* **[Impact]** An explanation of the bug on users and justification for backporting the fix to the stable release. -* A **[Test Case]** section containing detailed instructions on how to reproduce the bug. -* A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a result of the pull request that aims to fix the bug in the target stable release. + * **[Impact]** An explanation of the bug on users and justification for backporting the fix to the stable release. + * A **[Test Case]** section containing detailed instructions on how to reproduce the bug. + * A **[Regression Potential]** section with a clear assessment on how regressions are most likely to manifest as a result of the pull request that aims to fix the bug in the target stable release. -3. **Stable Release Managers** will review and discuss the PR. Once *consensus* surrounding the rationale has been reached and the technical review has successfully concluded, the pull request will be merged in the respective point-release target branch (e.g. `release/v0.43.x`) and the PR included in the point-release's respective milestone (e.g. `v0.43.5`). +3. **Stable Release Managers** will review and discuss the PR. Once _consensus_ surrounding the rationale has been reached and the technical review has successfully concluded, the pull request will be merged in the respective point-release target branch (e.g. `release/v0.43.x`) and the PR included in the point-release's respective milestone (e.g. `v0.43.5`). #### Stable Release Exception - Bug template -``` +```md #### Impact Brief xplanation of the effects of the bug on users and a justification for backporting the fix to the stable release. diff --git a/SECURITY.md b/SECURITY.md index a84dde3ce89b..64eedb3f73b0 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -17,23 +17,23 @@ in for Tendermint and other lower-level libraries (eg. [IAVL](https://github.com ### Core packages -- [`/baseapp`](https://github.com/cosmos/cosmos-sdk/tree/master/baseapp) -- [`/crypto`](https://github.com/cosmos/cosmos-sdk/tree/master/crypto) -- [`/types`](https://github.com/cosmos/cosmos-sdk/tree/master/types) -- [`/store`](https://github.com/cosmos/cosmos-sdk/tree/master/store) +* [`/baseapp`](https://github.com/cosmos/cosmos-sdk/tree/master/baseapp) +* [`/crypto`](https://github.com/cosmos/cosmos-sdk/tree/master/crypto) +* [`/types`](https://github.com/cosmos/cosmos-sdk/tree/master/types) +* [`/store`](https://github.com/cosmos/cosmos-sdk/tree/master/store) ### Modules -- [`x/auth`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth) -- [`x/bank`](https://github.com/cosmos/cosmos-sdk/tree/master/x/bank) -- [`x/capability`](https://github.com/cosmos/cosmos-sdk/tree/master/x/capability) -- [`x/staking`](https://github.com/cosmos/cosmos-sdk/tree/master/x/staking) -- [`x/slashing`](https://github.com/cosmos/cosmos-sdk/tree/master/x/slashing) -- [`x/evidence`](https://github.com/cosmos/cosmos-sdk/tree/master/x/evidence) -- [`x/distribution`](https://github.com/cosmos/cosmos-sdk/tree/master/x/distribution) -- [`x/ibc`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc) -- [`x/ibc-transfer`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc-transfer) -- [`x/mint`](https://github.com/cosmos/cosmos-sdk/tree/master/x/mint) +* [`x/auth`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth) +* [`x/bank`](https://github.com/cosmos/cosmos-sdk/tree/master/x/bank) +* [`x/capability`](https://github.com/cosmos/cosmos-sdk/tree/master/x/capability) +* [`x/staking`](https://github.com/cosmos/cosmos-sdk/tree/master/x/staking) +* [`x/slashing`](https://github.com/cosmos/cosmos-sdk/tree/master/x/slashing) +* [`x/evidence`](https://github.com/cosmos/cosmos-sdk/tree/master/x/evidence) +* [`x/distribution`](https://github.com/cosmos/cosmos-sdk/tree/master/x/distribution) +* [`x/ibc`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc) +* [`x/ibc-transfer`](https://github.com/cosmos/cosmos-sdk/tree/master/x/ibc-transfer) +* [`x/mint`](https://github.com/cosmos/cosmos-sdk/tree/master/x/mint) We are interested in bugs in other modules, however the above are most likely to have significant vulnerabilities, due to the complexity / nuance involved. We @@ -42,16 +42,16 @@ the code. ### How we process Tx parameters -- Integer operations on tx parameters, especially `sdk.Int` / `sdk.Dec` -- Gas calculation & parameter choices -- Tx signature verification (see [`x/auth/ante`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth/ante)) -- Possible Node DoS vectors (perhaps due to gas weighting / non constant timing) +* Integer operations on tx parameters, especially `sdk.Int` / `sdk.Dec` +* Gas calculation & parameter choices +* Tx signature verification (see [`x/auth/ante`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth/ante)) +* Possible Node DoS vectors (perhaps due to gas weighting / non constant timing) ### Handling private keys -- HD key derivation, local and Ledger, and all key-management functionality -- Side-channel attack vectors with our implementations - - e.g. key exfiltration based on time or memory-access patterns when decrypting privkey +* HD key derivation, local and Ledger, and all key-management functionality +* Side-channel attack vectors with our implementations + * e.g. key exfiltration based on time or memory-access patterns when decrypting privkey ## Disclosure Process @@ -83,7 +83,7 @@ Communications to partners usually include the following details: An example notice looks like: -``` +```text Dear Cosmos SDK partners, A critical security vulnerability has been identified in Cosmos SDK vX.X.X. diff --git a/contrib/githooks/README.md b/contrib/githooks/README.md index 0d67d8da0378..6d9b88562307 100644 --- a/contrib/githooks/README.md +++ b/contrib/githooks/README.md @@ -2,7 +2,7 @@ Installation: -``` +```sh git config core.hooksPath contrib/githooks ``` @@ -13,7 +13,7 @@ to correctly format the `.go` files included in the commit, provided that all the aforementioned commands are installed and available in the user's search `$PATH` environment variable: -``` +```sh go get golang.org/x/tools/cmd/goimports go get github.com/golangci/misspell/cmd/misspell@master ``` diff --git a/contrib/images/simd-dlv/README.md b/contrib/images/simd-dlv/README.md index 86d09372a43d..dcca3cde5c8b 100644 --- a/contrib/images/simd-dlv/README.md +++ b/contrib/images/simd-dlv/README.md @@ -15,14 +15,17 @@ Both `simd-env` and `simd-dlv` work and run the same, except that `simd-dlv` use ## How to use The command to start a local network in debug mode is: + ```shell # make localnet-debug ``` The command to stop the local network and destroy its containers is: + ```shell # make localnet-stop ``` + __note: this works the same for both `localnet-start` and `localnet-debug`__ Now, by default only `simdnode0` is run in debug mode, but you can run any of the other nodes in debug mode by changing the `DEBUG` environment variable to `1` in `docker-compose.yml`. diff --git a/contrib/rosetta/README.md b/contrib/rosetta/README.md index c34c31fa3ac6..60c5059c1e28 100644 --- a/contrib/rosetta/README.md +++ b/contrib/rosetta/README.md @@ -6,10 +6,10 @@ This directory contains the files required to run the rosetta CI. It builds `sim Builds: -- cosmos-sdk simapp node, with prefixed data directory, keys etc. This is required to test historical balances. -- faucet is required so we can test construction API, it was literally impossible to put there a deterministic address to request funds for -- rosetta is the rosetta node used by rosetta-cli to interact with the cosmos-sdk app -- test_rosetta runs the rosetta-cli test against construction API and data API +* cosmos-sdk simapp node, with prefixed data directory, keys etc. This is required to test historical balances. +* faucet is required so we can test construction API, it was literally impossible to put there a deterministic address to request funds for +* rosetta is the rosetta node used by rosetta-cli to interact with the cosmos-sdk app +* test_rosetta runs the rosetta-cli test against construction API and data API ## configuration @@ -25,5 +25,5 @@ The docker image for ./rosetta-cli/Dockerfile is on [docker hub](https://hub.doc ## Notes -- Keyring password is 12345678 -- data.sh creates node data, it's required in case consensus breaking changes are made to quickly recreate replicable node data for rosetta +* Keyring password is 12345678 +* data.sh creates node data, it's required in case consensus breaking changes are made to quickly recreate replicable node data for rosetta diff --git a/cosmovisor/CHANGELOG.md b/cosmovisor/CHANGELOG.md index ce3e201d2560..e2b24548af7b 100644 --- a/cosmovisor/CHANGELOG.md +++ b/cosmovisor/CHANGELOG.md @@ -38,37 +38,39 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features -+ [\#10285](https://github.com/cosmos/cosmos-sdk/pull/10316) Added `run` action. -+ [\#10533](https://github.com/cosmos/cosmos-sdk/pull/10649) Added environmental variable `DAEMON_BACKUP_DIR` to allow node to set a custom backup directory. +* [\#10285](https://github.com/cosmos/cosmos-sdk/pull/10316) Added `run` action. +* [\#10533](https://github.com/cosmos/cosmos-sdk/pull/10649) Added environmental variable `DAEMON_BACKUP_DIR` to allow node to set a custom backup directory. + ### Deprecated -+ [\#10285](https://github.com/cosmos/cosmos-sdk/pull/10316) Running `cosmovisor` without the `run` argument. +* [\#10285](https://github.com/cosmos/cosmos-sdk/pull/10316) Running `cosmovisor` without the `run` argument. ### Bug Fixes -+ [\#10458](https://github.com/cosmos/cosmos-sdk/pull/10458) Fix version when using 'go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0' to install cosmovisor. +* [\#10458](https://github.com/cosmos/cosmos-sdk/pull/10458) Fix version when using 'go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v1.0.0' to install cosmovisor. ## v1.0.0 2021-09-30 ### Features -+ [\#8590](https://github.com/cosmos/cosmos-sdk/pull/8590) File watcher for cosmovisor. Instead of parsing logs from stdin and stderr, we watch the `/data/upgrade-info.json` file updates using polling mechanism. -+ [\#9999](https://github.com/cosmos/cosmos-sdk/pull/10103) Added `version` command that returns the cosmovisor version and the application version. -+ [\#9973](https://github.com/cosmos/cosmos-sdk/pull/10056) Added support for pre-upgrade command in Cosmovisor to be called before the binary is upgraded. Added new environmental variable `DAEMON_PREUPGRADE_MAX_RETRIES` that holds the maximum number of times to reattempt pre-upgrade before failing. -+ [\#10126](https://github.com/cosmos/cosmos-sdk/pull/10229) Added `help`. +* [\#8590](https://github.com/cosmos/cosmos-sdk/pull/8590) File watcher for cosmovisor. Instead of parsing logs from stdin and stderr, we watch the `/data/upgrade-info.json` file updates using polling mechanism. +* [\#9999](https://github.com/cosmos/cosmos-sdk/pull/10103) Added `version` command that returns the cosmovisor version and the application version. +* [\#9973](https://github.com/cosmos/cosmos-sdk/pull/10056) Added support for pre-upgrade command in Cosmovisor to be called before the binary is upgraded. Added new environmental variable `DAEMON_PREUPGRADE_MAX_RETRIES` that holds the maximum number of times to reattempt pre-upgrade before failing. +* [\#10126](https://github.com/cosmos/cosmos-sdk/pull/10229) Added `help`. ### Improvements -+ [\#10018](https://github.com/cosmos/cosmos-sdk/pull/10018) Strict boolean argument parsing: cosmovisor will fail if user will not set correctly a boolean variable. Correct values are: "true", "false", "" (not setting) - all case not sensitive. -+ [\#10036](https://github.com/cosmos/cosmos-sdk/pull/10036) Improve logs when downloading the binary. -+ [\#10217](https://github.com/cosmos/cosmos-sdk/pull/10217) Replacing logging to use zerolog. +* [\#10018](https://github.com/cosmos/cosmos-sdk/pull/10018) Strict boolean argument parsing: cosmovisor will fail if user will not set correctly a boolean variable. Correct values are: "true", "false", "" (not setting) - all case not sensitive. +* [\#10036](https://github.com/cosmos/cosmos-sdk/pull/10036) Improve logs when downloading the binary. +* [\#10217](https://github.com/cosmos/cosmos-sdk/pull/10217) Replacing logging to use zerolog. ### CLI Breaking -+ [\#10128](https://github.com/cosmos/cosmos-sdk/pull/10128) Change default value of `DAEMON_RESTART_AFTER_UPGRADE` to `true`. + +* [\#10128](https://github.com/cosmos/cosmos-sdk/pull/10128) Change default value of `DAEMON_RESTART_AFTER_UPGRADE` to `true`. ## v0.1 2021-08-06 -This is the first release and we started this changelog on 2021-07-01. See the (README)[https://github.com/cosmos/cosmos-sdk/blob/release/cosmovisor/v0.1.x/cosmovisor/CHANGELOG.md] file for the full list of features. +This is the first release and we started this changelog on 2021-07-01. See the [README](https://github.com/cosmos/cosmos-sdk/blob/release/cosmovisor/v0.1.x/cosmovisor/CHANGELOG.md) file for the full list of features. ## Features diff --git a/cosmovisor/README.md b/cosmovisor/README.md index 2cbcdc4edc32..bffb5ee33743 100644 --- a/cosmovisor/README.md +++ b/cosmovisor/README.md @@ -2,7 +2,7 @@ `cosmovisor` is a small process manager for Cosmos SDK application binaries that monitors the governance module for incoming chain upgrade proposals. If it sees a proposal that gets approved, `cosmovisor` can automatically download the new binary, stop the current binary, switch from the old binary to the new one, and finally restart the node with the new binary. -#### Design +## Design Cosmovisor is designed to be used as a wrapper for a `Cosmos SDK` app: @@ -27,13 +27,13 @@ Release branches have the following format `release/cosmovisor/vA.B.x`, where A To install the latest version of `cosmovisor`, run the following command: -``` +```sh go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@latest ``` To install a previous version, you can specify the version. IMPORTANT: Chains that use Cosmos-SDK v0.44.3 or earlier (eg v0.44.2) and want to use auto-download feature MUST use Cosmovisor v0.1.0 -``` +```sh go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v0.1.0 ``` @@ -41,7 +41,7 @@ You can run `cosmovisor --version` to check the Cosmovisor version (works only w You can also install from source by pulling the cosmos-sdk repository and switching to the correct version and building as follows: -``` +```sh git clone git@github.com:cosmos/cosmos-sdk cd cosmos-sdk git checkout cosmovisor/vx.x.x @@ -50,7 +50,7 @@ make cosmovisor This will build cosmovisor in `/cosmovisor` directory. Afterwards you may want to put it into your machine's PATH like as follows: -``` +```sh cp cosmovisor/cosmovisor ~/go/bin/cosmovisor ``` @@ -82,7 +82,7 @@ All arguments passed to `cosmovisor run` will be passed to the application binar `$DAEMON_HOME/cosmovisor` is expected to belong completely to `cosmovisor` and the subprocesses that are controlled by it. The folder content is organized as follows: -``` +```text . ├── current -> genesis or upgrades/ ├── genesis @@ -99,7 +99,7 @@ The `cosmovisor/` directory incudes a subdirectory for each version of the appli Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries*. The `cosmovisor` binary itself can be stored in any typical location (e.g. `/usr/local/bin`). The application will continue to store its data in the default data directory (e.g. `$HOME/.gaiad`) or the data directory specified with the `--home` flag. `$DAEMON_HOME` is independent of the data directory and can be set to any location. If you set `$DAEMON_HOME` to the same directory as the data directory, you will end up with a configuation like the following: -``` +```text .gaiad ├── config ├── data @@ -110,11 +110,11 @@ Please note that `$DAEMON_HOME/cosmovisor` only stores the *application binaries The system administrator is responsible for: -- installing the `cosmovisor` binary -- configuring the host's init system (e.g. `systemd`, `launchd`, etc.) -- appropriately setting the environmental variables -- manually installing the `genesis` folder -- manually installing the `upgrades/` folders +* installing the `cosmovisor` binary +* configuring the host's init system (e.g. `systemd`, `launchd`, etc.) +* appropriately setting the environmental variables +* manually installing the `genesis` folder +* manually installing the `upgrades/` folders `cosmovisor` will set the `current` link to point to `genesis` at first start (i.e. when no `current` link exists) and then handle switching binaries at the correct points in time so that the system administrator can prepare days in advance and relax at upgrade time. @@ -127,10 +127,10 @@ The `DAEMON` specific code and operations (e.g. tendermint config, the applicati `cosmovisor` is polling the `$DAEMON_HOME/data/upgrade-info.json` file for new upgrade instructions. The file is created by the x/upgrade module in `BeginBlocker` when an upgrade is detected and the blockchain reaches the upgrade height. The following heuristic is applied to detect the upgrade: -+ When starting, `cosmovisor` doesn't know much about currently running upgrade, except the binary which is `current/bin/`. It tries to read the `current/update-info.json` file to get information about the current upgrade name. -+ If neither `cosmovisor/current/upgrade-info.json` nor `data/upgrade-info.json` exist, then `cosmovisor` will wait for `data/upgrade-info.json` file to trigger an upgrade. -+ If `cosmovisor/current/upgrade-info.json` doesn't exist but `data/upgrade-info.json` exists, then `cosmovisor` assumes that whatever is in `data/upgrade-info.json` is a valid upgrade request. In this case `cosmovisor` tries immediately to make an upgrade according to the `name` attribute in `data/upgrade-info.json`. -+ Otherwise, `cosmovisor` waits for changes in `upgrade-info.json`. As soon as a new upgrade name is recorded in the file, `cosmovisor` will trigger an upgrade mechanism. +* When starting, `cosmovisor` doesn't know much about currently running upgrade, except the binary which is `current/bin/`. It tries to read the `current/update-info.json` file to get information about the current upgrade name. +* If neither `cosmovisor/current/upgrade-info.json` nor `data/upgrade-info.json` exist, then `cosmovisor` will wait for `data/upgrade-info.json` file to trigger an upgrade. +* If `cosmovisor/current/upgrade-info.json` doesn't exist but `data/upgrade-info.json` exists, then `cosmovisor` assumes that whatever is in `data/upgrade-info.json` is a valid upgrade request. In this case `cosmovisor` tries immediately to make an upgrade according to the `name` attribute in `data/upgrade-info.json`. +* Otherwise, `cosmovisor` waits for changes in `upgrade-info.json`. As soon as a new upgrade name is recorded in the file, `cosmovisor` will trigger an upgrade mechanism. When the upgrade mechanism is triggered, `cosmovisor` will: @@ -147,48 +147,48 @@ If `DAEMON_ALLOW_DOWNLOAD_BINARIES` is set to `true`, and no local binary can be 1. Store an os/architecture -> binary URI map in the upgrade plan info field as JSON under the `"binaries"` key. For example: -```json -{ - "binaries": { - "linux/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f" - } -} -``` - -You can include multiple binaries at once to ensure more than one environment will receive the correct binaries: - -```json -{ - "binaries": { - "linux/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f", - "linux/arm64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f", - "darwin/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f" + ```json + { + "binaries": { + "linux/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f" + } } -} -``` + ``` -When submitting this as a proposal ensure there are no spaces. An example command using `gaiad` could look like: + You can include multiple binaries at once to ensure more than one environment will receive the correct binaries: -``` -> gaiad tx gov submit-proposal software-upgrade Vega \ ---title Vega \ ---deposit 100uatom \ ---upgrade-height 7368420 \ ---upgrade-info '{"binaries":{"linux/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-linux-amd64","linux/arm64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-linux-arm64","darwin/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-darwin-amd64"}}' \ ---description "upgrade to Vega" \ ---gas 400000 \ ---from user \ ---chain-id test \ ---home test/val2 \ ---node tcp://localhost:36657 \ ---yes -``` + ```json + { + "binaries": { + "linux/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f", + "linux/arm64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f", + "darwin/amd64":"https://example.com/gaia.zip?checksum=sha256:aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f" + } + } + ``` + + When submitting this as a proposal ensure there are no spaces. An example command using `gaiad` could look like: + + ```sh + > gaiad tx gov submit-proposal software-upgrade Vega \ + --title Vega \ + --deposit 100uatom \ + --upgrade-height 7368420 \ + --upgrade-info '{"binaries":{"linux/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-linux-amd64","linux/arm64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-linux-arm64","darwin/amd64":"https://github.com/cosmos/gaia/releases/download/v6.0.0-rc1/gaiad-v6.0.0-rc1-darwin-amd64"}}' \ + --description "upgrade to Vega" \ + --gas 400000 \ + --from user \ + --chain-id test \ + --home test/val2 \ + --node tcp://localhost:36657 \ + --yes + ``` 2. Store a link to a file that contains all information in the above format (e.g. if you want to specify lots of binaries, changelog info, etc. without filling up the blockchain). For example: -``` -https://example.com/testnet-1001-info.json?checksum=sha256:deaaa99fda9407c4dbe1d04bd49bab0cc3c1dd76fa392cd55a9425be074af01e -``` + ```text + https://example.com/testnet-1001-info.json?checksum=sha256:deaaa99fda9407c4dbe1d04bd49bab0cc3c1dd76fa392cd55a9425be074af01e + ``` When `cosmovisor` is triggered to download the new binary, `cosmovisor` will parse the `"binaries"` field, download the new binary with [go-getter](https://github.com/hashicorp/go-getter), and unpack the new binary in the `upgrades/` folder so that it can be run as if it was installed manually. @@ -196,7 +196,7 @@ Note that for this mechanism to provide strong security guarantees, all URLs sho To properly create a sha256 checksum on linux, you can use the `sha256sum` utility. For example: -``` +```sh sha256sum ./testdata/repo/zip_directory/autod.zip ``` @@ -208,24 +208,25 @@ You can also use `sha512sum` if you would prefer to use longer hashes, or `md5su The following instructions provide a demonstration of `cosmovisor` using the simulation application (`simapp`) shipped with the Cosmos SDK's source code. The following commands are to be run from within the `cosmos-sdk` repository. -#### Chain Setup + +### Chain Setup Let's create a new chain using the `v0.44` version of simapp (the Cosmos SDK demo app): -``` +```sh git checkout v0.44.6 make build ``` Clean `~/.simapp` (never do this in a production environment): -``` +```sh ./build/simd unsafe-reset-all ``` Set up app config: -``` +```sh ./build/simd config chain-id test ./build/simd config keyring-backend test ./build/simd config broadcast-mode block @@ -235,19 +236,19 @@ Initialize the node and overwrite any previous genesis file (never do this in a -``` +```sh ./build/simd init test --chain-id test --overwrite ``` Set the minimum gas price to `0stake` in `~/.simapp/config/app.toml`: -``` +```sh minimum-gas-prices = "0stake" ``` For the sake of this demonstration, amend `voting_period` in `genesis.json` to a reduced time of 20 seconds (`20s`): -``` +```sh cat <<< $(jq '.app_state.gov.voting_params.voting_period = "20s"' $HOME/.simapp/config/genesis.json) > $HOME/.simapp/config/genesis.json ``` @@ -256,7 +257,7 @@ Create a validator, and setup genesis transaction: -``` +```sh ./build/simd keys add validator ./build/simd add-genesis-account validator 1000000000stake --keyring-backend test ./build/simd gentx validator 1000000stake --chain-id test @@ -267,27 +268,28 @@ Create a validator, and setup genesis transaction: Set the required environment variables: -``` +```sh export DAEMON_NAME=simd export DAEMON_HOME=$HOME/.simapp ``` Set the optional environment variable to trigger an automatic app restart: -``` +```sh export DAEMON_RESTART_AFTER_UPGRADE=true ``` Create the folder for the genesis binary and copy the `simd` binary: -``` +```sh mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin cp ./build/simd $DAEMON_HOME/cosmovisor/genesis/bin ``` Now you can run cosmovisor with simapp v0.44: -``` + +```sh cosmovisor run start ``` @@ -300,13 +302,13 @@ Next, we can add a migration - which is defined using `x/upgrade` [upgrade plan] Build the new version `simd` binary: -``` +```sh make build ``` Create the folder for the upgrade binary and copy the `simd` binary: -``` +```sh mkdir -p $DAEMON_HOME/cosmovisor/upgrades/test1/bin cp ./build/simd $DAEMON_HOME/cosmovisor/upgrades/test1/bin ``` @@ -314,7 +316,7 @@ cp ./build/simd $DAEMON_HOME/cosmovisor/upgrades/test1/bin Open a new terminal window and submit an upgrade proposal along with a deposit and a vote (these commands must be run within 20 seconds of each other): -``` +```sh ./build/simd tx gov submit-proposal software-upgrade test1 --title upgrade --description upgrade --upgrade-height 200 --from validator --yes ./build/simd tx gov deposit 1 10000000stake --from validator --yes ./build/simd tx gov vote 1 yes --from validator --yes diff --git a/cosmovisor/RELEASE_NOTES.md b/cosmovisor/RELEASE_NOTES.md index c32d17870dce..ab412e551c9b 100644 --- a/cosmovisor/RELEASE_NOTES.md +++ b/cosmovisor/RELEASE_NOTES.md @@ -26,8 +26,8 @@ verification command which can potentially solve this issue. ## Other updates -+ Changed default value of `DAEMON_RESTART_AFTER_UPGRADE` to `true`. -+ Added `version` command, which prints both the Cosmovisor and the associated app version. -+ Added `help` command, which prints the Cosmovisor help without passing it to the associated version. This is an exception, because normally, Cosmovisor passes all arguments to the associated app. +* Changed default value of `DAEMON_RESTART_AFTER_UPGRADE` to `true`. +* Added `version` command, which prints both the Cosmovisor and the associated app version. +* Added `help` command, which prints the Cosmovisor help without passing it to the associated version. This is an exception, because normally, Cosmovisor passes all arguments to the associated app. For more details, please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/cosmovisor/v1.0.0/cosmovisor/CHANGELOG.md). diff --git a/crypto/bcrypt_readme.md b/crypto/bcrypt_readme.md index 5180e50bd007..8dc963424e2a 100644 --- a/crypto/bcrypt_readme.md +++ b/crypto/bcrypt_readme.md @@ -1,5 +1,4 @@ -Security parameter choice -------------------------- +# Security parameter choice The present Bcrypt security parameter used is 12, which should take about a quarter of a second on midrange consumer hardware (see [Benchmarking](#benchmarking) section below). @@ -7,8 +6,7 @@ For some background into security parameter considerations, see [here](https://a Given our security model, where an attacker would need to already have access to a victim's computer and copy the `~/.gaiacli` directory (as opposed to e.g. web authentication), this parameter choice seems sufficient for the time being. Bcrypt always generates a 448-bit key, so the security in practice is determined by the length & complexity of a user's password and the time taken to generate a Bcrypt key from their password (which we can choose with the security parameter). Users would be well-advised to use difficult-to-guess passwords. -Benchmarking ------------- +## Benchmarking To run Bcrypt benchmarks: diff --git a/crypto/keys/secp256k1/internal/secp256k1/README.md b/crypto/keys/secp256k1/internal/secp256k1/README.md index d899ca27005a..c999fb31be0c 100644 --- a/crypto/keys/secp256k1/internal/secp256k1/README.md +++ b/crypto/keys/secp256k1/internal/secp256k1/README.md @@ -1,3 +1,5 @@ -This package is copied from https://github.com/ethereum/go-ethereum/tree/729bf365b5f17325be9107b63b233da54100eec6/crypto/secp256k1 +# secp256k1 + +This package is copied from Unlike the rest of go-ethereum it is MIT licensed so compatible with our Apache2.0 license. We opt to copy in here rather than depend on go-ethereum to avoid issues with vendoring of the GPL parts of that repository by downstream. diff --git a/doc/proto-docs.md b/doc/proto-docs.md index 82684d30ff9c..32c76e260cb2 100644 --- a/doc/proto-docs.md +++ b/doc/proto-docs.md @@ -1,16 +1,14 @@ # Protobuf Documentation + ## Table of Contents -- [cosmos/base/query/v1beta1/pagination.proto](#cosmos/base/query/v1beta1/pagination.proto) - - [PageRequest](#cosmos.base.query.v1beta1.PageRequest) - - [PageResponse](#cosmos.base.query.v1beta1.PageResponse) - -- [Scalar Value Types](#scalar-value-types) - - +* [cosmos/base/query/v1beta1/pagination.proto](#cosmosbasequeryv1beta1paginationproto) + * [PageRequest](#pagerequest) + * [PageResponse](#pageresponse) +* [Scalar Value Types](#scalar-value-types)

Top

@@ -22,6 +20,7 @@ ### PageRequest + PageRequest is to be embedded in gRPC request messages for efficient pagination. Ex: @@ -49,6 +48,7 @@ Since: cosmos-sdk 0.43 | ### PageResponse + PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest. diff --git a/docs/DOCS_README.md b/docs/DOCS_README.md index 1388356a3b48..5e6af356bb64 100644 --- a/docs/DOCS_README.md +++ b/docs/DOCS_README.md @@ -4,22 +4,22 @@ If you want to open a PR in Cosmos SDK to update the documentation, please follo ## Internationalization -- Translations for documentation live in a `docs//` folder, where `` is the language code for a specific language. For example, `zh` for Chinese, `ko` for Korean, `ru` for Russian, etc. -- Each `docs//` folder must follow the same folder structure within `docs/`, but only content in the following folders needs to be translated and included in the respective `docs//` folder: - - `docs/basics/` - - `docs/building-modules/` - - `docs/core/` - - `docs/ibc/` - - `docs/intro/` - - `docs/migrations/` - - `docs/run-node/` -- Each `docs//` folder must also have a `README.md` that includes a translated version of both the layout and content within the root-level [`README.md`](https://github.com/cosmos/cosmos-sdk/tree/master/docs/README.md). The layout defined in the `README.md` is used to build the homepage. -- Always translate content living on `master` unless you are revising documentation for a specific release. Translated documentation like the root-level documentation is semantically versioned. -- For additional configuration options, please see [VuePress Internationalization](https://vuepress.vuejs.org/guide/i18n.html). +* Translations for documentation live in a `docs//` folder, where `` is the language code for a specific language. For example, `zh` for Chinese, `ko` for Korean, `ru` for Russian, etc. +* Each `docs//` folder must follow the same folder structure within `docs/`, but only content in the following folders needs to be translated and included in the respective `docs//` folder: + * `docs/basics/` + * `docs/building-modules/` + * `docs/core/` + * `docs/ibc/` + * `docs/intro/` + * `docs/migrations/` + * `docs/run-node/` +* Each `docs//` folder must also have a `README.md` that includes a translated version of both the layout and content within the root-level [`README.md`](https://github.com/cosmos/cosmos-sdk/tree/master/docs/README.md). The layout defined in the `README.md` is used to build the homepage. +* Always translate content living on `master` unless you are revising documentation for a specific release. Translated documentation like the root-level documentation is semantically versioned. +* For additional configuration options, please see [VuePress Internationalization](https://vuepress.vuejs.org/guide/i18n.html). ## Docs Build Workflow -The documentation for Cosmos SDK is hosted at https://docs.cosmos.network/ and built from the files in the `/docs` directory. +The documentation for Cosmos SDK is hosted at and built from the files in the `/docs` directory. ### How It Works @@ -47,17 +47,17 @@ Relative links should be used nearly everywhere, having discovered and weighed t Where is the other file, relative to the current one? -- works both on GitHub and for the VuePress build -- confusing / annoying to have things like: `../../../../myfile.md` -- requires more updates when files are re-shuffled +* works both on GitHub and for the VuePress build +* confusing / annoying to have things like: `../../../../myfile.md` +* requires more updates when files are re-shuffled ### Absolute Where is the other file, given the root of the repo? -- works on GitHub, doesn't work for the VuePress build -- this is much nicer: `/docs/hereitis/myfile.md` -- if you move that file around, the links inside it are preserved (but not to it, of course) +* works on GitHub, doesn't work for the VuePress build +* this is much nicer: `/docs/hereitis/myfile.md` +* if you move that file around, the links inside it are preserved (but not to it, of course) ### Full @@ -84,7 +84,7 @@ Install the theme and all dependencies. npm run serve ``` -Run `pre` and `post` hooks and start a hot-reloading web-server. See output of this command for the URL (it is often https://localhost:8080). +Run `pre` and `post` hooks and start a hot-reloading web-server. See output of this command for the URL (it is often ). To build documentation as a static website run `npm run build`. You will find the website in `.vuepress/dist` directory. diff --git a/docs/DOC_WRITING_GUIDELINES.md b/docs/DOC_WRITING_GUIDELINES.md index 424da301ff31..ebedb46ad6b0 100644 --- a/docs/DOC_WRITING_GUIDELINES.md +++ b/docs/DOC_WRITING_GUIDELINES.md @@ -2,13 +2,13 @@ ## Best Practices -+ Check the spelling and grammar, even if you have to copy and paste from an external source. -+ Use simple sentences. Easy-to-read sentences mean the reader can quickly use the guidance you share. -+ Try to express your thoughts in a concise and clean way. -+ Don't abuse `code` format when writing in plain English. -+ Follow Google developer documentation [style guide](https://developers.google.com/style). -+ Check the meaning of words in Microsoft's [A-Z word list and term collections](https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms) (use the search input!). -+ RFC keywords should be used in technical documents (uppercase) and we recommend to use them in user documentation (lowercase). The RFC keywords are: "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). +* Check the spelling and grammar, even if you have to copy and paste from an external source. +* Use simple sentences. Easy-to-read sentences mean the reader can quickly use the guidance you share. +* Try to express your thoughts in a concise and clean way. +* Don't abuse `code` format when writing in plain English. +* Follow Google developer documentation [style guide](https://developers.google.com/style). +* Check the meaning of words in Microsoft's [A-Z word list and term collections](https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/accessibility-terms) (use the search input!). +* RFC keywords should be used in technical documents (uppercase) and we recommend to use them in user documentation (lowercase). The RFC keywords are: "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). ## Technical Writing Course diff --git a/docs/README.md b/docs/README.md index 9c5acc729eef..2e9e03f2cbba 100644 --- a/docs/README.md +++ b/docs/README.md @@ -47,26 +47,26 @@ aside: false ## Get Started -- **[Cosmos SDK Intro](./intro/overview.md)**: High-level overview of the Cosmos SDK. -- **[Starport](https://docs.starport.network/)**: A developer-friendly interface to the Cosmos SDK to scaffold, launch, and maintain any crypto application on a sovereign and secured blockchain. -- **[SDK Tutorials](https://tutorials.cosmos.network/)**: Tutorials that showcase how to build Cosmos SDK-based blockchains from scratch and explain the basic Cosmos SDK principles in the process. +* **[Cosmos SDK Intro](./intro/overview.md)**: High-level overview of the Cosmos SDK. +* **[Starport](https://docs.starport.network/)**: A developer-friendly interface to the Cosmos SDK to scaffold, launch, and maintain any crypto application on a sovereign and secured blockchain. +* **[SDK Tutorials](https://tutorials.cosmos.network/)**: Tutorials that showcase how to build Cosmos SDK-based blockchains from scratch and explain the basic Cosmos SDK principles in the process. ## Reference Docs -- **[Basics](./basics/)**: Basic concepts of the Cosmos SDK, including the standard anatomy of an application, the transaction lifecycle, and accounts management. -- **[Core](./core/)**: Core concepts of the Cosmos SDK, including `baseapp`, the `store`, or the `server`. -- **[Building Modules](./building-modules/)**: Important concepts for module developers like `message`, `keeper`, and `querier`. -- **[IBC](./ibc/)**: IBC protocol integration and concepts. -- **[Running a Node, API, CLI](./run-node/)**: How to run a node and interact with the node using the CLI and the API. -- **[Migrations](./migrations/)**: Migration guides for updating to newer versions of Cosmos SDK. +* **[Basics](./basics/)**: Basic concepts of the Cosmos SDK, including the standard anatomy of an application, the transaction lifecycle, and accounts management. +* **[Core](./core/)**: Core concepts of the Cosmos SDK, including `baseapp`, the `store`, or the `server`. +* **[Building Modules](./building-modules/)**: Important concepts for module developers like `message`, `keeper`, and `querier`. +* **[IBC](./ibc/)**: IBC protocol integration and concepts. +* **[Running a Node, API, CLI](./run-node/)**: How to run a node and interact with the node using the CLI and the API. +* **[Migrations](./migrations/)**: Migration guides for updating to newer versions of Cosmos SDK. ## Other Resources -- **[Module Directory](../x/)**: Cosmos SDK module implementations and their respective documentation. -- **[Specifications](./spec/)**: Specifications of modules and other parts of the Cosmos SDK. -- **[Cosmos SDK API Reference](https://godoc.org/github.com/cosmos/cosmos-sdk)**: Godocs of the Cosmos SDK. -- **[REST and RPC Endpoints](https://cosmos.network/rpc/)**: List of endpoints to interact with a `gaia` full-node. -- **[Rosetta API](./run-node/rosetta.md)**: Rosetta API integration. +* **[Module Directory](../x/)**: Cosmos SDK module implementations and their respective documentation. +* **[Specifications](./spec/)**: Specifications of modules and other parts of the Cosmos SDK. +* **[Cosmos SDK API Reference](https://godoc.org/github.com/cosmos/cosmos-sdk)**: Godocs of the Cosmos SDK. +* **[REST and RPC Endpoints](https://cosmos.network/rpc/)**: List of endpoints to interact with a `gaia` full-node. +* **[Rosetta API](./run-node/rosetta.md)**: Rosetta API integration. ## Cosmos Hub diff --git a/docs/architecture/PROCESS.md b/docs/architecture/PROCESS.md index 209beb0f72d1..528301a67b39 100644 --- a/docs/architecture/PROCESS.md +++ b/docs/architecture/PROCESS.md @@ -26,7 +26,7 @@ ADR creation is an **iterative** process. Instead of trying to solve all decisio Status has two components: -``` +```text {CONSENSUS STATUS} {IMPLEMENTATION STATUS} ``` @@ -34,7 +34,7 @@ IMPLEMENTATION STATUS is either `Implemented` or `Not Implemented`. #### Consensus Status -``` +```text DRAFT -> PROPOSED -> LAST CALL yyyy-mm-dd -> ACCEPTED | REJECTED -> SUPERSEDED by ADR-xxx \ | \ | @@ -42,15 +42,15 @@ DRAFT -> PROPOSED -> LAST CALL yyyy-mm-dd -> ACCEPTED | REJECTED -> SUPERSEDED b 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 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. +* `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 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. +* 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 index 03b22eb33f21..444179124a9c 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -19,11 +19,11 @@ You can read more about the ADR concept in this [blog post](https://product.reve 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 +* 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 @@ -36,7 +36,7 @@ If recorded decisions turned out to be lacking, convene a discussion, record the Read about the [PROCESS](./PROCESS.md). -#### Use RFC 2119 Keywords +### 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). @@ -44,41 +44,41 @@ When writing ADRs, follow the same best practices for writing RFCs. When writing ### Accepted -- [ADR 002: SDK Documentation Structure](./adr-002-docs-structure.md) -- [ADR 004: Split Denomination Keys](./adr-004-split-denomination-keys.md) -- [ADR 006: Secret Store Replacement](./adr-006-secret-store-replacement.md) -- [ADR 009: Evidence Module](./adr-009-evidence-module.md) -- [ADR 010: Modular AnteHandler](./adr-010-modular-antehandler.md) -- [ADR 019: Protocol Buffer State Encoding](./adr-019-protobuf-state-encoding.md) -- [ADR 020: Protocol Buffer Transaction Encoding](./adr-020-protobuf-transaction-encoding.md) -- [ADR 021: Protocol Buffer Query Encoding](./adr-021-protobuf-query-encoding.md) -- [ADR 023: Protocol Buffer Naming and Versioning](./adr-023-protobuf-naming.md) -- [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) -- [ADR 030: Message Authorization Module](./adr-030-authz-module.md) -- [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) +* [ADR 002: SDK Documentation Structure](./adr-002-docs-structure.md) +* [ADR 004: Split Denomination Keys](./adr-004-split-denomination-keys.md) +* [ADR 006: Secret Store Replacement](./adr-006-secret-store-replacement.md) +* [ADR 009: Evidence Module](./adr-009-evidence-module.md) +* [ADR 010: Modular AnteHandler](./adr-010-modular-antehandler.md) +* [ADR 019: Protocol Buffer State Encoding](./adr-019-protobuf-state-encoding.md) +* [ADR 020: Protocol Buffer Transaction Encoding](./adr-020-protobuf-transaction-encoding.md) +* [ADR 021: Protocol Buffer Query Encoding](./adr-021-protobuf-query-encoding.md) +* [ADR 023: Protocol Buffer Naming and Versioning](./adr-023-protobuf-naming.md) +* [ADR 029: Fee Grant Module](./adr-029-fee-grant-module.md) +* [ADR 030: Message Authorization Module](./adr-030-authz-module.md) +* [ADR 031: Protobuf Msg Services](./adr-031-msg-service.md) ### Proposed -- [ADR 003: Dynamic Capability Store](./adr-003-dynamic-capability-store.md) -- [ADR 011: Generalize Genesis Accounts](./adr-011-generalize-genesis-accounts.md) -- [ADR 012: State Accessors](./adr-012-state-accessors.md) -- [ADR 013: Metrics](./adr-013-metrics.md) -- [ADR 016: Validator Consensus Key Rotation](./adr-016-validator-consensus-key-rotation.md) -- [ADR 017: Historical Header Module](./adr-017-historical-header-module.md) -- [ADR 018: Extendable Voting Periods](./adr-018-extendable-voting-period.md) -- [ADR 022: Custom baseapp panic handling](./adr-022-custom-panic-handling.md) -- [ADR 024: Coin Metadata](./adr-024-coin-metadata.md) -- [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) -- [ADR 028: Public Key Addresses](./adr-028-public-key-addresses.md) -- [ADR 032: Typed Events](./adr-032-typed-events.md) -- [ADR 033: Inter-module RPC](./adr-033-protobuf-inter-module-comm.md) -- [ADR 035: Rosetta API Support](./adr-035-rosetta-api-support.md) -- [ADR 037: Governance Split Votes](./adr-037-gov-split-vote.md) -- [ADR 038: State Listening](./adr-038-state-listening.md) -- [ADR 039: Epoched Staking](./adr-039-epoched-staking.md) -- [ADR 040: Storage and SMT State Commitments](./adr-040-storage-and-smt-state-commitments.md) -- [ADR 046: Module Params](./adr-046-module-params.md) +* [ADR 003: Dynamic Capability Store](./adr-003-dynamic-capability-store.md) +* [ADR 011: Generalize Genesis Accounts](./adr-011-generalize-genesis-accounts.md) +* [ADR 012: State Accessors](./adr-012-state-accessors.md) +* [ADR 013: Metrics](./adr-013-metrics.md) +* [ADR 016: Validator Consensus Key Rotation](./adr-016-validator-consensus-key-rotation.md) +* [ADR 017: Historical Header Module](./adr-017-historical-header-module.md) +* [ADR 018: Extendable Voting Periods](./adr-018-extendable-voting-period.md) +* [ADR 022: Custom baseapp panic handling](./adr-022-custom-panic-handling.md) +* [ADR 024: Coin Metadata](./adr-024-coin-metadata.md) +* [ADR 027: Deterministic Protobuf Serialization](./adr-027-deterministic-protobuf-serialization.md) +* [ADR 028: Public Key Addresses](./adr-028-public-key-addresses.md) +* [ADR 032: Typed Events](./adr-032-typed-events.md) +* [ADR 033: Inter-module RPC](./adr-033-protobuf-inter-module-comm.md) +* [ADR 035: Rosetta API Support](./adr-035-rosetta-api-support.md) +* [ADR 037: Governance Split Votes](./adr-037-gov-split-vote.md) +* [ADR 038: State Listening](./adr-038-state-listening.md) +* [ADR 039: Epoched Staking](./adr-039-epoched-staking.md) +* [ADR 040: Storage and SMT State Commitments](./adr-040-storage-and-smt-state-commitments.md) +* [ADR 046: Module Params](./adr-046-module-params.md) ### Draft -- [ADR 044: Guidelines for Updating Protobuf Definitions](./adr-044-protobuf-updates-guidelines.md) +* [ADR 044: Guidelines for Updating Protobuf Definitions](./adr-044-protobuf-updates-guidelines.md) diff --git a/docs/architecture/adr-002-docs-structure.md b/docs/architecture/adr-002-docs-structure.md index dd104acd7714..ba59ecd044b7 100644 --- a/docs/architecture/adr-002-docs-structure.md +++ b/docs/architecture/adr-002-docs-structure.md @@ -6,14 +6,14 @@ There is a need for a scalable structure of the Cosmos SDK documentation. Curren Ideally, we would have: -- All docs related to dev frameworks or tools live in their respective github repos (sdk repo would contain sdk docs, hub repo would contain hub docs, lotion repo would contain lotion docs, etc.) -- All other docs (faqs, whitepaper, high-level material about Cosmos) would live on the website. +* All docs related to dev frameworks or tools live in their respective github repos (sdk repo would contain sdk docs, hub repo would contain hub docs, lotion repo would contain lotion docs, etc.) +* All other docs (faqs, whitepaper, high-level material about Cosmos) would live on the website. ## Decision Re-structure the `/docs` folder of the Cosmos SDK github repo as follows: -``` +```text docs/ ├── README ├── intro/ @@ -39,21 +39,21 @@ docs/ The files in each sub-folders do not matter and will likely change. What matters is the sectioning: -- `README`: Landing page of the docs. -- `intro`: Introductory material. Goal is to have a short explainer of the Cosmos SDK and then channel people to the resource they need. The [Cosmos SDK tutorial](https://github.com/cosmos/sdk-application-tutorial/) will be highlighted, as well as the `godocs`. -- `concepts`: Contains high-level explanations of the abstractions of the Cosmos SDK. It does not contain specific code implementation and does not need to be updated often. **It is not an API specification of the interfaces**. API spec is the `godoc`. -- `clients`: Contains specs and info about the various Cosmos SDK clients. -- `spec`: Contains specs of modules, and others. -- `modules`: Contains links to `godocs` and the spec of the modules. -- `architecture`: Contains architecture-related docs like the present one. -- `translations`: Contains different translations of the documentation. +* `README`: Landing page of the docs. +* `intro`: Introductory material. Goal is to have a short explainer of the Cosmos SDK and then channel people to the resource they need. The [Cosmos SDK tutorial](https://github.com/cosmos/sdk-application-tutorial/) will be highlighted, as well as the `godocs`. +* `concepts`: Contains high-level explanations of the abstractions of the Cosmos SDK. It does not contain specific code implementation and does not need to be updated often. **It is not an API specification of the interfaces**. API spec is the `godoc`. +* `clients`: Contains specs and info about the various Cosmos SDK clients. +* `spec`: Contains specs of modules, and others. +* `modules`: Contains links to `godocs` and the spec of the modules. +* `architecture`: Contains architecture-related docs like the present one. +* `translations`: Contains different translations of the documentation. Website docs sidebar will only include the following sections: -- `README` -- `intro` -- `concepts` -- `clients` +* `README` +* `intro` +* `concepts` +* `clients` `architecture` need not be displayed on the website. @@ -65,22 +65,22 @@ Accepted ### Positive -- Much clearer organisation of the Cosmos SDK docs. -- The `/docs` folder now only contains Cosmos SDK and gaia related material. Later, it will only contain Cosmos SDK related material. -- Developers only have to update `/docs` folder when they open a PR (and not `/examples` for example). -- Easier for developers to find what they need to update in the docs thanks to reworked architecture. -- Cleaner vuepress build for website docs. -- Will help build an executable doc (cf https://github.com/cosmos/cosmos-sdk/issues/2611) +* Much clearer organisation of the Cosmos SDK docs. +* The `/docs` folder now only contains Cosmos SDK and gaia related material. Later, it will only contain Cosmos SDK related material. +* Developers only have to update `/docs` folder when they open a PR (and not `/examples` for example). +* Easier for developers to find what they need to update in the docs thanks to reworked architecture. +* Cleaner vuepress build for website docs. +* Will help build an executable doc (cf ) ### Neutral -- We need to move a bunch of deprecated stuff to `/_attic` folder. -- We need to integrate content in `docs/sdk/docs/core` in `concepts`. -- We need to move all the content that currently lives in `docs` and does not fit in new structure (like `lotion`, intro material, whitepaper) to the website repository. -- Update `DOCS_README.md` +* We need to move a bunch of deprecated stuff to `/_attic` folder. +* We need to integrate content in `docs/sdk/docs/core` in `concepts`. +* We need to move all the content that currently lives in `docs` and does not fit in new structure (like `lotion`, intro material, whitepaper) to the website repository. +* Update `DOCS_README.md` ## References -- https://github.com/cosmos/cosmos-sdk/issues/1460 -- https://github.com/cosmos/cosmos-sdk/pull/2695 -- https://github.com/cosmos/cosmos-sdk/issues/2611 +* +* +* diff --git a/docs/architecture/adr-003-dynamic-capability-store.md b/docs/architecture/adr-003-dynamic-capability-store.md index b392404e0eba..4ec3f1a615fc 100644 --- a/docs/architecture/adr-003-dynamic-capability-store.md +++ b/docs/architecture/adr-003-dynamic-capability-store.md @@ -2,8 +2,8 @@ ## Changelog -- 12 December 2019: Initial version -- 02 April 2020: Memory Store Revisions +* 12 December 2019: Initial version +* 02 April 2020: Memory Store Revisions ## Context @@ -326,14 +326,14 @@ Proposed. ### Positive -- Dynamic capability support. -- Allows CapabilityKeeper to return same capability pointer from go-map while reverting any writes to the persistent `KVStore` and in-memory `MemoryStore` on tx failure. +* Dynamic capability support. +* Allows CapabilityKeeper to return same capability pointer from go-map while reverting any writes to the persistent `KVStore` and in-memory `MemoryStore` on tx failure. ### Negative -- Requires an additional keeper. -- Some overlap with existing `StoreKey` system (in the future they could be combined, since this is a superset functionality-wise). -- Requires an extra level of indirection in the reverse mapping, since MemoryStore must map to index which must then be used as key in a go map to retrieve the actual capability +* Requires an additional keeper. +* Some overlap with existing `StoreKey` system (in the future they could be combined, since this is a superset functionality-wise). +* Requires an extra level of indirection in the reverse mapping, since MemoryStore must map to index which must then be used as key in a go map to retrieve the actual capability ### Neutral @@ -341,4 +341,4 @@ Proposed. ## References -- [Original discussion](https://github.com/cosmos/cosmos-sdk/pull/5230#discussion_r343978513) +* [Original discussion](https://github.com/cosmos/cosmos-sdk/pull/5230#discussion_r343978513) diff --git a/docs/architecture/adr-004-split-denomination-keys.md b/docs/architecture/adr-004-split-denomination-keys.md index ae192c63226c..5083e7bcb389 100644 --- a/docs/architecture/adr-004-split-denomination-keys.md +++ b/docs/architecture/adr-004-split-denomination-keys.md @@ -2,10 +2,10 @@ ## Changelog -- 2020-01-08: Initial version -- 2020-01-09: Alterations to handle vesting accounts -- 2020-01-14: Updates from review feedback -- 2020-01-30: Updates from implementation +* 2020-01-08: Initial version +* 2020-01-09: Alterations to handle vesting accounts +* 2020-01-14: Updates from review feedback +* 2020-01-30: Updates from implementation ### Glossary @@ -38,11 +38,11 @@ vesting coins (which is safe since these cannot contain arbitrary denominations) The following APIs will be added to the `x/bank` keeper: -- `GetAllBalances(ctx Context, addr AccAddress) Coins` -- `GetBalance(ctx Context, addr AccAddress, denom string) Coin` -- `SetBalance(ctx Context, addr AccAddress, coin Coin)` -- `LockedCoins(ctx Context, addr AccAddress) Coins` -- `SpendableCoins(ctx Context, addr AccAddress) Coins` +* `GetAllBalances(ctx Context, addr AccAddress) Coins` +* `GetBalance(ctx Context, addr AccAddress, denom string) Coin` +* `SetBalance(ctx Context, addr AccAddress, coin Coin)` +* `LockedCoins(ctx Context, addr AccAddress) Coins` +* `SpendableCoins(ctx Context, addr AccAddress) Coins` Additional APIs may be added to facilitate iteration and auxiliary functionality not essential to core functionality or persistence. @@ -100,13 +100,13 @@ Accepted. ### Positive -- O(1) reads & writes of balances (with respect to the number of denominations for +* O(1) reads & writes of balances (with respect to the number of denominations for which an account has non-zero balances). Note, this does not relate to the actual I/O cost, rather the total number of direct reads needed. ### Negative -- Slightly less efficient reads/writes when reading & writing all balances of a +* Slightly less efficient reads/writes when reading & writing all balances of a single account in a transaction. ### Neutral @@ -115,6 +115,6 @@ None in particular. ## References -- Ref: https://github.com/cosmos/cosmos-sdk/issues/4982 -- Ref: https://github.com/cosmos/cosmos-sdk/issues/5467 -- Ref: https://github.com/cosmos/cosmos-sdk/issues/5492 +* Ref: +* Ref: +* Ref: diff --git a/docs/architecture/adr-006-secret-store-replacement.md b/docs/architecture/adr-006-secret-store-replacement.md index 0b1d88d9e397..fe2e25467887 100644 --- a/docs/architecture/adr-006-secret-store-replacement.md +++ b/docs/architecture/adr-006-secret-store-replacement.md @@ -2,10 +2,10 @@ ## Changelog -- July 29th, 2019: Initial draft -- September 11th, 2019: Work has started -- November 4th: Cosmos SDK changes merged in -- November 18th: Gaia changes merged in +* July 29th, 2019: Initial draft +* September 11th, 2019: Work has started +* November 4th: Cosmos SDK changes merged in +* November 18th: Gaia changes merged in ## Context @@ -47,8 +47,8 @@ Running tests locally on a Mac require numerous repetitive password entries. ## References -- #4754 Switch secret store to the keyring secret store (original PR by @poldsam) [__CLOSED__] -- #5029 Add support for github.com/99designs/keyring-backed keybases [__MERGED__] -- #5097 Add keys migrate command [__MERGED__] -- #5180 Drop on-disk keybase in favor of keyring [_PENDING_REVIEW_] -- cosmos/gaia#164 Drop on-disk keybase in favor of keyring (gaia's changes) [_PENDING_REVIEW_] +* #4754 Switch secret store to the keyring secret store (original PR by @poldsam) [__CLOSED__] +* #5029 Add support for github.com/99designs/keyring-backed keybases [__MERGED__] +* #5097 Add keys migrate command [__MERGED__] +* #5180 Drop on-disk keybase in favor of keyring [_PENDING_REVIEW_] +* cosmos/gaia#164 Drop on-disk keybase in favor of keyring (gaia's changes) [_PENDING_REVIEW_] diff --git a/docs/architecture/adr-007-specialization-groups.md b/docs/architecture/adr-007-specialization-groups.md index 8055fc5a2115..58f78abf5aab 100644 --- a/docs/architecture/adr-007-specialization-groups.md +++ b/docs/architecture/adr-007-specialization-groups.md @@ -2,7 +2,7 @@ ## Changelog -- 2019 Jul 31: Initial Draft +* 2019 Jul 31: Initial Draft ## Context @@ -26,22 +26,22 @@ governance proposals include a field for issue type. A specialization group can be broadly broken down into the following functions (herein containing examples): -- Membership Admittance -- Membership Acceptance -- Membership Revocation - - (probably) Without Penalty - - member steps down (self-Revocation) - - replaced by new member from governance - - (probably) With Penalty - - due to breach of soft-agreement (determined through governance) - - due to breach of hard-agreement (determined by code) -- Execution of Duties - - Special transactions which only execute for members of a specialization +* Membership Admittance +* Membership Acceptance +* Membership Revocation + * (probably) Without Penalty + * member steps down (self-Revocation) + * replaced by new member from governance + * (probably) With Penalty + * due to breach of soft-agreement (determined through governance) + * due to breach of hard-agreement (determined by code) +* Execution of Duties + * Special transactions which only execute for members of a specialization group (for example, dCERT members voting to turn off transaction routes in an emergency scenario) -- Compensation - - Group compensation (further distribution decided by the specialization group) - - Individual compensation for all constituents of a group from the +* Compensation + * Group compensation (further distribution decided by the specialization group) + * Individual compensation for all constituents of a group from the greater community Membership admittance to a specialization group could take place over a wide @@ -163,15 +163,15 @@ type SpecializationGroup interface { ### Positive -- increases specialization capabilities of a blockchain -- improve abstractions in `x/gov/` such that they can be used with specialization groups +* increases specialization capabilities of a blockchain +* improve abstractions in `x/gov/` such that they can be used with specialization groups ### Negative -- could be used to increase centralization within a community +* could be used to increase centralization within a community ### Neutral ## References -- [dCERT ADR](./adr-008-dCERT-group.md) +* [dCERT ADR](./adr-008-dCERT-group.md) diff --git a/docs/architecture/adr-008-dCERT-group.md b/docs/architecture/adr-008-dCERT-group.md index a6f0dfb198c8..2b2d2b8260e1 100644 --- a/docs/architecture/adr-008-dCERT-group.md +++ b/docs/architecture/adr-008-dCERT-group.md @@ -2,7 +2,7 @@ ## Changelog -- 2019 Jul 31: Initial Draft +* 2019 Jul 31: Initial Draft ## Context @@ -35,22 +35,22 @@ The dCERT group is proposed to include an implementation of a `SpecializationGro as defined in [ADR 007](./adr-007-specialization-groups.md). This will include the implementation of: -- continuous voting -- slashing due to breach of soft contract -- revoking a member due to breach of soft contract -- emergency disband of the entire dCERT group (ex. for colluding maliciously) -- compensation stipend from the community pool or other means decided by +* continuous voting +* slashing due to breach of soft contract +* revoking a member due to breach of soft contract +* emergency disband of the entire dCERT group (ex. for colluding maliciously) +* compensation stipend from the community pool or other means decided by governance This system necessitates the following new parameters: -- blockly stipend allowance per dCERT member -- maximum number of dCERT members -- required staked slashable tokens for each dCERT member -- quorum for suspending a particular member -- proposal wager for disbanding the dCERT group -- stabilization period for dCERT member transition -- circuit break dCERT privileges enabled +* blockly stipend allowance per dCERT member +* maximum number of dCERT members +* required staked slashable tokens for each dCERT member +* quorum for suspending a particular member +* proposal wager for disbanding the dCERT group +* stabilization period for dCERT member transition +* circuit break dCERT privileges enabled These parameters are expected to be implemented through the param keeper such that governance may change them at any given point. @@ -60,27 +60,27 @@ that governance may change them at any given point. An `Electionator` object is to be implemented as continuous voting and with the following specifications: -- All delegation addresses may submit votes at any point which updates their +* All delegation addresses may submit votes at any point which updates their preferred representation on the dCERT group. -- Preferred representation may be arbitrarily split between addresses (ex. 50% +* Preferred representation may be arbitrarily split between addresses (ex. 50% to John, 25% to Sally, 25% to Carol) -- In order for a new member to be added to the dCERT group they must +* In order for a new member to be added to the dCERT group they must send a transaction accepting their admission at which point the validity of their admission is to be confirmed. - - A sequence number is assigned when a member is added to dCERT group. + * A sequence number is assigned when a member is added to dCERT group. If a member leaves the dCERT group and then enters back, a new sequence number is assigned. -- Addresses which control the greatest amount of preferred-representation are +* Addresses which control the greatest amount of preferred-representation are eligible to join the dCERT group (up the _maximum number of dCERT members_). If the dCERT group is already full and new member is admitted, the existing dCERT member with the lowest amount of votes is kicked from the dCERT group. - - In the split situation where the dCERT group is full but a vying candidate + * In the split situation where the dCERT group is full but a vying candidate has the same amount of vote as an existing dCERT member, the existing member should maintain its position. - - In the split situation where somebody must be kicked out but the two + * In the split situation where somebody must be kicked out but the two addresses with the smallest number of votes have the same number of votes, the address with the smallest sequence number maintains its position. -- A stabilization period can be optionally included to reduce the +* A stabilization period can be optionally included to reduce the "flip-flopping" of the dCERT membership tail members. If a stabilization period is provided which is greater than 0, when members are kicked due to insufficient support, a queue entry is created which documents which member is @@ -128,9 +128,9 @@ capable of shutting down the exploitable message routes. Active dCERT members -- change of the description of the dCERT group -- circuit break a message route -- vote to suspend a dCERT member. +* change of the description of the dCERT group +* circuit break a message route +* vote to suspend a dCERT member. Here circuit-breaking refers to the capability to disable a groups of messages, This could for instance mean: "disable all staking-delegation messages", or @@ -157,12 +157,12 @@ they should all be severely slashed. ### Positive -- Potential to reduces the number of parties to coordinate with during an emergency -- Reduction in possibility of disclosing sensitive information to malicious parties +* Potential to reduces the number of parties to coordinate with during an emergency +* Reduction in possibility of disclosing sensitive information to malicious parties ### Negative -- Centralization risks +* Centralization risks ### Neutral diff --git a/docs/architecture/adr-009-evidence-module.md b/docs/architecture/adr-009-evidence-module.md index f6f47170c9f1..ded04a142028 100644 --- a/docs/architecture/adr-009-evidence-module.md +++ b/docs/architecture/adr-009-evidence-module.md @@ -2,8 +2,8 @@ ## Changelog -- 2019 July 31: Initial draft -- 2019 October 24: Initial implementation +* 2019 July 31: Initial draft +* 2019 October 24: Initial implementation ## Status @@ -27,14 +27,14 @@ chain so that the equivocating validator(s) can be slashed. We will implement an evidence module in the Cosmos SDK supporting the following functionality: -- Provide developers with the abstractions and interfaces necessary to define +* Provide developers with the abstractions and interfaces necessary to define custom evidence messages, message handlers, and methods to slash and penalize accordingly for misbehavior. -- Support the ability to route evidence messages to handlers in any module to +* Support the ability to route evidence messages to handlers in any module to determine the validity of submitted misbehavior. -- Support the ability, through governance, to modify slashing penalties of any +* Support the ability, through governance, to modify slashing penalties of any evidence type. -- Querier implementation to support querying params, evidence types, params, and +* Querier implementation to support querying params, evidence types, params, and all submitted valid misbehavior. ### Types @@ -160,23 +160,23 @@ type GenesisState struct { ### Positive -- Allows the state machine to process misbehavior submitted on-chain and penalize +* Allows the state machine to process misbehavior submitted on-chain and penalize validators based on agreed upon slashing parameters. -- Allows evidence types to be defined and handled by any module. This further allows +* Allows evidence types to be defined and handled by any module. This further allows slashing and jailing to be defined by more complex mechanisms. -- Does not solely rely on Tendermint to submit evidence. +* Does not solely rely on Tendermint to submit evidence. ### Negative -- No easy way to introduce new evidence types through governance on a live chain +* No easy way to introduce new evidence types through governance on a live chain due to the inability to introduce the new evidence type's corresponding handler ### Neutral -- Should we persist infractions indefinitely? Or should we rather rely on events? +* Should we persist infractions indefinitely? Or should we rather rely on events? ## References -- [ICS](https://github.com/cosmos/ics) -- [IBC Architecture](https://github.com/cosmos/ics/blob/master/ibc/1_IBC_ARCHITECTURE.md) -- [Tendermint Fork Accountability](https://github.com/tendermint/spec/blob/7b3138e69490f410768d9b1ffc7a17abc23ea397/spec/consensus/fork-accountability.md) +* [ICS](https://github.com/cosmos/ics) +* [IBC Architecture](https://github.com/cosmos/ics/blob/master/ibc/1_IBC_ARCHITECTURE.md) +* [Tendermint Fork Accountability](https://github.com/tendermint/spec/blob/7b3138e69490f410768d9b1ffc7a17abc23ea397/spec/consensus/fork-accountability.md) diff --git a/docs/architecture/adr-010-modular-antehandler.md b/docs/architecture/adr-010-modular-antehandler.md index c0be2c4d8e64..1558afab8ed3 100644 --- a/docs/architecture/adr-010-modular-antehandler.md +++ b/docs/architecture/adr-010-modular-antehandler.md @@ -2,8 +2,8 @@ ## Changelog -- 2019 Aug 31: Initial draft -- 2021 Sep 14: Superseded by ADR-045 +* 2019 Aug 31: Initial draft +* 2021 Sep 14: Superseded by ADR-045 ## Status @@ -284,7 +284,7 @@ Since pros and cons are written for each approach, it is omitted from this secti ## References -- [#4572](https://github.com/cosmos/cosmos-sdk/issues/4572): Modular AnteHandler Issue -- [#4582](https://github.com/cosmos/cosmos-sdk/pull/4583): Initial Implementation of Per-Module AnteHandler Approach -- [Weave Decorator Code](https://github.com/iov-one/weave/blob/master/handler.go#L35) -- [Weave Design Videos](https://vimeo.com/showcase/6189877) +* [#4572](https://github.com/cosmos/cosmos-sdk/issues/4572): Modular AnteHandler Issue +* [#4582](https://github.com/cosmos/cosmos-sdk/pull/4583): Initial Implementation of Per-Module AnteHandler Approach +* [Weave Decorator Code](https://github.com/iov-one/weave/blob/master/handler.go#L35) +* [Weave Design Videos](https://vimeo.com/showcase/6189877) diff --git a/docs/architecture/adr-011-generalize-genesis-accounts.md b/docs/architecture/adr-011-generalize-genesis-accounts.md index 60964f95b90c..92a704ba6ea9 100644 --- a/docs/architecture/adr-011-generalize-genesis-accounts.md +++ b/docs/architecture/adr-011-generalize-genesis-accounts.md @@ -2,7 +2,7 @@ ## Changelog -- 2019-08-30: initial draft +* 2019-08-30: initial draft ## Context @@ -145,8 +145,8 @@ This will be moved to `auth`. We will leave it to projects to write their own co Under the new scheme, module and vesting account types need some minor updates: -- Type registration on `auth`'s codec (shown above) -- A `Validate` method for each `Account` concrete type +* Type registration on `auth`'s codec (shown above) +* A `Validate` method for each `Account` concrete type ## Status @@ -156,15 +156,15 @@ Proposed ### Positive -- custom accounts can be used without needing to fork `genaccounts` -- reduction in lines of code +* custom accounts can be used without needing to fork `genaccounts` +* reduction in lines of code ### Negative ### Neutral -- `genaccounts` module no longer exists -- accounts in genesis files are stored under `accounts` in `auth` rather than in the `genaccounts` module. +* `genaccounts` module no longer exists +* accounts in genesis files are stored under `accounts` in `auth` rather than in the `genaccounts` module. -`add-genesis-account` cli command now in `auth` ## References diff --git a/docs/architecture/adr-012-state-accessors.md b/docs/architecture/adr-012-state-accessors.md index 8b2a9b3f430f..93600000ff1c 100644 --- a/docs/architecture/adr-012-state-accessors.md +++ b/docs/architecture/adr-012-state-accessors.md @@ -2,7 +2,7 @@ ## Changelog -- 2019 Sep 04: Initial draft +* 2019 Sep 04: Initial draft ## Context @@ -125,9 +125,9 @@ Where the `key` argument in core method is typed. Some of the properties of the accessor types are: -- State access happens only when a function which takes a `Context` as an argument is invoked -- Accessor type structs give rights to access the state only that the struct is referring, no other -- Marshalling/Unmarshalling happens implicitly within the core methods +* State access happens only when a function which takes a `Context` as an argument is invoked +* Accessor type structs give rights to access the state only that the struct is referring, no other +* Marshalling/Unmarshalling happens implicitly within the core methods ## Status @@ -137,19 +137,19 @@ Proposed ### Positive -- Serialization will be done automatically -- Shorter code size, less boilerplate, better UX -- References to the state can be transferred safely -- Explicit scope of accessing +* Serialization will be done automatically +* Shorter code size, less boilerplate, better UX +* References to the state can be transferred safely +* Explicit scope of accessing ### Negative -- Serialization format will be hidden -- Different architecture from the current, but the use of accessor types can be opt-in -- Type-specific types (e.g. `Boolean` and `Integer`) have to be defined manually +* Serialization format will be hidden +* Different architecture from the current, but the use of accessor types can be opt-in +* Type-specific types (e.g. `Boolean` and `Integer`) have to be defined manually ### Neutral ## References -- [#4554](https://github.com/cosmos/cosmos-sdk/issues/4554) +* [#4554](https://github.com/cosmos/cosmos-sdk/issues/4554) diff --git a/docs/architecture/adr-013-metrics.md b/docs/architecture/adr-013-metrics.md index cf27d89648ce..33849b56caf0 100644 --- a/docs/architecture/adr-013-metrics.md +++ b/docs/architecture/adr-013-metrics.md @@ -2,7 +2,7 @@ ## Changelog -- 20-01-2020: Initial Draft +* 20-01-2020: Initial Draft ## Status @@ -148,7 +148,7 @@ func (k BaseKeeper) MintCoins(ctx sdk.Context, moduleName string, amt sdk.Coins) ### Positive -- Exposure into the performance and behavior of an application +* Exposure into the performance and behavior of an application ### Negative diff --git a/docs/architecture/adr-014-proportional-slashing.md b/docs/architecture/adr-014-proportional-slashing.md index f7a063930253..63cd04dee307 100644 --- a/docs/architecture/adr-014-proportional-slashing.md +++ b/docs/architecture/adr-014-proportional-slashing.md @@ -2,9 +2,9 @@ ## Changelog -- 2019-10-15: Initial draft -- 2020-05-25: Removed correlation root slashing -- 2020-07-01: Updated to include S-curve function instead of linear +* 2019-10-15: Initial draft +* 2020-05-25: Removed correlation root slashing +* 2020-07-01: Updated to include S-curve function instead of linear ## Context @@ -16,13 +16,13 @@ In Proof of Stake-based chains, centralization of consensus power amongst a smal To solve this problem, we will implement a procedure called Proportional Slashing. The desire is that the larger a validator is, the more they should be slashed. The first naive attempt is to make a validator's slash percent proportional to their share of consensus voting power. -``` +```text slash_amount = k * power // power is the faulting validator's voting power and k is some on-chain constant ``` However, this will incentivize validators with large amounts of stake to split up their voting power amongst accounts (sybil attack), so that if they fault, they all get slashed at a lower percent. The solution to this is to take into account not just a validator's own voting percentage, but also the voting percentage of all the other validators who get slashed in a specified time frame. -``` +```text slash_amount = k * (power_1 + power_2 + ... + power_n) // where power_i is the voting power of the ith validator faulting in the specified time frame and k is some on-chain constant ``` @@ -51,7 +51,7 @@ Griefing, the act of intentionally getting oneself slashed in order to make anot In the slashing module, we will add two queues that will track all of the recent slash events. For double sign faults, we will define "recent slashes" as ones that have occurred within the last `unbonding period`. For liveness faults, we will define "recent slashes" as ones that have occurred withing the last `jail period`. -``` +```go type SlashEvent struct { Address sdk.ValAddress ValidatorVotingPercent sdk.Dec @@ -75,11 +75,11 @@ Proposed ### Positive -- Increases decentralization by disincentivizing delegating to large validators -- Incentivizes Decorrelation of Validators -- More severely punishes attacks than accidental faults -- More flexibility in slashing rates parameterization +* Increases decentralization by disincentivizing delegating to large validators +* Incentivizes Decorrelation of Validators +* More severely punishes attacks than accidental faults +* More flexibility in slashing rates parameterization ### Negative -- More computationally expensive than current implementation. Will require more data about "recent slashing events" to be stored on chain. +* More computationally expensive than current implementation. Will require more data about "recent slashing events" to be stored on chain. diff --git a/docs/architecture/adr-016-validator-consensus-key-rotation.md b/docs/architecture/adr-016-validator-consensus-key-rotation.md index 6cc1e5ce7a20..4ee797e55a8f 100644 --- a/docs/architecture/adr-016-validator-consensus-key-rotation.md +++ b/docs/architecture/adr-016-validator-consensus-key-rotation.md @@ -2,12 +2,12 @@ ## Changelog -- 2019 Oct 23: Initial draft -- 2019 Nov 28: Add key rotation fee +* 2019 Oct 23: Initial draft +* 2019 Nov 28: Add key rotation fee ## Context -Validator consensus key rotation feature has been discussed and requested for a long time, for the sake of safer validator key management policy (e.g. https://github.com/tendermint/tendermint/issues/1136). So, we suggest one of the simplest form of validator consensus key rotation implementation mostly onto Cosmos SDK. +Validator consensus key rotation feature has been discussed and requested for a long time, for the sake of safer validator key management policy (e.g. ). So, we suggest one of the simplest form of validator consensus key rotation implementation mostly onto Cosmos SDK. We don't need to make any update on consensus logic in Tendermint because Tendermint does not have any mapping information of consensus key and validator operator key, meaning that from Tendermint point of view, a consensus key rotation of a validator is simply a replacement of a consensus key to another. @@ -17,37 +17,37 @@ Also, it should be noted that this ADR includes only the simplest form of consen ### Pseudo procedure for consensus key rotation -- create new random consensus key. -- create and broadcast a transaction with a `MsgRotateConsPubKey` that states the new consensus key is now coupled with the validator operator with signature from the validator's operator key. -- old consensus key becomes unable to participate on consensus immediately after the update of key mapping state on-chain. -- start validating with new consensus key. -- validators using HSM and KMS should update the consensus key in HSM to use the new rotated key after the height `h` when `MsgRotateConsPubKey` committed to the blockchain. +* create new random consensus key. +* create and broadcast a transaction with a `MsgRotateConsPubKey` that states the new consensus key is now coupled with the validator operator with signature from the validator's operator key. +* old consensus key becomes unable to participate on consensus immediately after the update of key mapping state on-chain. +* start validating with new consensus key. +* validators using HSM and KMS should update the consensus key in HSM to use the new rotated key after the height `h` when `MsgRotateConsPubKey` committed to the blockchain. ### Considerations -- consensus key mapping information management strategy - - store history of each key mapping changes in the kvstore. - - the state machine can search corresponding consensus key paired with given validator operator for any arbitrary height in a recent unbonding period. - - the state machine does not need any historical mapping information which is past more than unbonding period. -- key rotation costs related to LCD and IBC - - LCD and IBC will have traffic/computation burden when there exists frequent power changes - - In current Tendermint design, consensus key rotations are seen as power changes from LCD or IBC perspective - - Therefore, to minimize unnecessary frequent key rotation behavior, we limited maximum number of rotation in recent unbonding period and also applied exponentially increasing rotation fee -- limits - - a validator cannot rotate its consensus key more than `MaxConsPubKeyRotations` time for any unbonding period, to prevent spam. - - parameters can be decided by governance and stored in genesis file. -- key rotation fee - - a validator should pay `KeyRotationFee` to rotate the consensus key which is calculated as below - - `KeyRotationFee` = (max(`VotingPowerPercentage` *100, 1)* `InitialKeyRotationFee`) * 2^(number of rotations in `ConsPubKeyRotationHistory` in recent unbonding period) -- evidence module - - evidence module can search corresponding consensus key for any height from slashing keeper so that it can decide which consensus key is supposed to be used for given height. -- abci.ValidatorUpdate - - tendermint already has ability to change a consensus key by ABCI communication(`ValidatorUpdate`). - - validator consensus key update can be done via creating new + delete old by change the power to zero. - - therefore, we expect we even do not need to change tendermint codebase at all to implement this feature. -- new genesis parameters in `staking` module - - `MaxConsPubKeyRotations` : maximum number of rotation can be executed by a validator in recent unbonding period. default value 10 is suggested(11th key rotation will be rejected) - - `InitialKeyRotationFee` : the initial key rotation fee when no key rotation has happened in recent unbonding period. default value 1atom is suggested(1atom fee for the first key rotation in recent unbonding period) +* consensus key mapping information management strategy + * store history of each key mapping changes in the kvstore. + * the state machine can search corresponding consensus key paired with given validator operator for any arbitrary height in a recent unbonding period. + * the state machine does not need any historical mapping information which is past more than unbonding period. +* key rotation costs related to LCD and IBC + * LCD and IBC will have traffic/computation burden when there exists frequent power changes + * In current Tendermint design, consensus key rotations are seen as power changes from LCD or IBC perspective + * Therefore, to minimize unnecessary frequent key rotation behavior, we limited maximum number of rotation in recent unbonding period and also applied exponentially increasing rotation fee +* limits + * a validator cannot rotate its consensus key more than `MaxConsPubKeyRotations` time for any unbonding period, to prevent spam. + * parameters can be decided by governance and stored in genesis file. +* key rotation fee + * a validator should pay `KeyRotationFee` to rotate the consensus key which is calculated as below + * `KeyRotationFee` = (max(`VotingPowerPercentage` *100, 1)* `InitialKeyRotationFee`) * 2^(number of rotations in `ConsPubKeyRotationHistory` in recent unbonding period) +* evidence module + * evidence module can search corresponding consensus key for any height from slashing keeper so that it can decide which consensus key is supposed to be used for given height. +* abci.ValidatorUpdate + * tendermint already has ability to change a consensus key by ABCI communication(`ValidatorUpdate`). + * validator consensus key update can be done via creating new + delete old by change the power to zero. + * therefore, we expect we even do not need to change tendermint codebase at all to implement this feature. +* new genesis parameters in `staking` module + * `MaxConsPubKeyRotations` : maximum number of rotation can be executed by a validator in recent unbonding period. default value 10 is suggested(11th key rotation will be rejected) + * `InitialKeyRotationFee` : the initial key rotation fee when no key rotation has happened in recent unbonding period. default value 1atom is suggested(1atom fee for the first key rotation in recent unbonding period) ### Workflow @@ -63,14 +63,14 @@ Also, it should be noted that this ADR includes only the simplest form of consen 3. `handleMsgRotateConsPubKey` gets `MsgRotateConsPubKey`, calls `RotateConsPubKey` with emits event 4. `RotateConsPubKey` - - checks if `NewPubKey` is not duplicated on `ValidatorsByConsAddr` - - checks if the validator is does not exceed parameter `MaxConsPubKeyRotations` by iterating `ConsPubKeyRotationHistory` - - checks if the signing account has enough balance to pay `KeyRotationFee` - - pays `KeyRotationFee` to community fund - - overwrites `NewPubKey` in `validator.ConsPubKey` - - deletes old `ValidatorByConsAddr` - - `SetValidatorByConsAddr` for `NewPubKey` - - Add `ConsPubKeyRotationHistory` for tracking rotation + * checks if `NewPubKey` is not duplicated on `ValidatorsByConsAddr` + * checks if the validator is does not exceed parameter `MaxConsPubKeyRotations` by iterating `ConsPubKeyRotationHistory` + * checks if the signing account has enough balance to pay `KeyRotationFee` + * pays `KeyRotationFee` to community fund + * overwrites `NewPubKey` in `validator.ConsPubKey` + * deletes old `ValidatorByConsAddr` + * `SetValidatorByConsAddr` for `NewPubKey` + * Add `ConsPubKeyRotationHistory` for tracking rotation ```go type ConsPubKeyRotationHistory struct { @@ -98,7 +98,7 @@ Also, it should be noted that this ADR includes only the simplest form of consen 6. at `previousVotes` Iteration logic of `AllocateTokens`, `previousVote` using `OldConsPubKey` match up with `ConsPubKeyRotationHistory`, and replace validator for token allocation 7. Migrate `ValidatorSigningInfo` and `ValidatorMissedBlockBitArray` from `OldConsPubKey` to `NewConsPubKey` -- Note : All above features shall be implemented in `staking` module. +* Note : All above features shall be implemented in `staking` module. ## Status @@ -108,18 +108,18 @@ Proposed ### Positive -- Validators can immediately or periodically rotate their consensus key to have better security policy -- improved security against Long-Range attacks (https://nearprotocol.com/blog/long-range-attacks-and-a-new-fork-choice-rule) given a validator throws away the old consensus key(s) +* Validators can immediately or periodically rotate their consensus key to have better security policy +* improved security against Long-Range attacks () given a validator throws away the old consensus key(s) ### Negative -- Slash module needs more computation because it needs to lookup corresponding consensus key of validators for each height -- frequent key rotations will make light client bisection less efficient +* Slash module needs more computation because it needs to lookup corresponding consensus key of validators for each height +* frequent key rotations will make light client bisection less efficient ### Neutral ## References -- on tendermint repo : https://github.com/tendermint/tendermint/issues/1136 -- on cosmos-sdk repo : https://github.com/cosmos/cosmos-sdk/issues/5231 -- about multiple consensus keys : https://github.com/tendermint/tendermint/issues/1758#issuecomment-545291698 +* on tendermint repo : +* on cosmos-sdk repo : +* about multiple consensus keys : diff --git a/docs/architecture/adr-017-historical-header-module.md b/docs/architecture/adr-017-historical-header-module.md index 8c5a1f6cd65e..b97b46d4f3e9 100644 --- a/docs/architecture/adr-017-historical-header-module.md +++ b/docs/architecture/adr-017-historical-header-module.md @@ -2,8 +2,8 @@ ## Changelog -- 26 November 2019: Start of first version -- 2 December 2019: Final draft of first version +* 26 November 2019: Start of first version +* 2 December 2019: Final draft of first version ## Context @@ -44,13 +44,13 @@ Implementation of this ADR will require changes to the Cosmos SDK. It will not r ### Positive -- Easy retrieval of headers & state roots for recent past heights by modules anywhere in the Cosmos SDK. -- No RPC calls to Tendermint required. -- No ABCI alterations required. +* Easy retrieval of headers & state roots for recent past heights by modules anywhere in the Cosmos SDK. +* No RPC calls to Tendermint required. +* No ABCI alterations required. ### Negative -- Duplicates `n` headers data in Tendermint & the application (additional disk usage) - in the long term, an approach such as [this](https://github.com/tendermint/tendermint/issues/4210) might be preferable. +* Duplicates `n` headers data in Tendermint & the application (additional disk usage) - in the long term, an approach such as [this](https://github.com/tendermint/tendermint/issues/4210) might be preferable. ### Neutral @@ -58,4 +58,4 @@ Implementation of this ADR will require changes to the Cosmos SDK. It will not r ## References -- [ICS 2: "Consensus state introspection"](https://github.com/cosmos/ibc/tree/master/spec/core/ics-002-client-semantics#consensus-state-introspection) +* [ICS 2: "Consensus state introspection"](https://github.com/cosmos/ibc/tree/master/spec/core/ics-002-client-semantics#consensus-state-introspection) diff --git a/docs/architecture/adr-018-extendable-voting-period.md b/docs/architecture/adr-018-extendable-voting-period.md index edd392b5e739..2c6a30e80da9 100644 --- a/docs/architecture/adr-018-extendable-voting-period.md +++ b/docs/architecture/adr-018-extendable-voting-period.md @@ -2,7 +2,7 @@ ## Changelog -- 1 January 2020: Start of first version +* 1 January 2020: Start of first version ## Context @@ -18,8 +18,8 @@ Thus, we propose the following mechanism: ### Params -- The current gov param `VotingPeriod` is to be replaced by a `MinVotingPeriod` param. This is the the default voting period that all governance proposal voting periods start with. -- There is a new gov param called `MaxVotingPeriodExtension`. +* The current gov param `VotingPeriod` is to be replaced by a `MinVotingPeriod` param. This is the the default voting period that all governance proposal voting periods start with. +* There is a new gov param called `MaxVotingPeriodExtension`. ### Mechanism @@ -50,17 +50,17 @@ Proposed ### Positive -- More complex/contentious governance proposals will have more time to properly digest and deliberate +* More complex/contentious governance proposals will have more time to properly digest and deliberate ### Negative -- Governance process becomes more complex and requires more understanding to interact with effectively -- Can no longer predict when a governance proposal will end. Can't assume order in which governance proposals will end. +* Governance process becomes more complex and requires more understanding to interact with effectively +* Can no longer predict when a governance proposal will end. Can't assume order in which governance proposals will end. ### Neutral -- The minimum voting period can be made shorter +* The minimum voting period can be made shorter ## References -- [Cosmos Forum post where idea first originated](https://forum.cosmos.network/t/proposal-draft-reduce-governance-voting-period-to-7-days/3032/9) +* [Cosmos Forum post where idea first originated](https://forum.cosmos.network/t/proposal-draft-reduce-governance-voting-period-to-7-days/3032/9) diff --git a/docs/architecture/adr-019-protobuf-state-encoding.md b/docs/architecture/adr-019-protobuf-state-encoding.md index 657e5b386e12..f8e05c7d0707 100644 --- a/docs/architecture/adr-019-protobuf-state-encoding.md +++ b/docs/architecture/adr-019-protobuf-state-encoding.md @@ -2,12 +2,12 @@ ## Changelog -- 2020 Feb 15: Initial Draft -- 2020 Feb 24: Updates to handle messages with interface fields -- 2020 Apr 27: Convert usages of `oneof` for interfaces to `Any` -- 2020 May 15: Describe `cosmos_proto` extensions and amino compatibility -- 2020 Dec 4: Move and rename `MarshalAny` and `UnmarshalAny` into the `codec.Codec` interface. -- 2021 Feb 24: Remove mentions of `HybridCodec`, which has been abandoned in [#6843](https://github.com/cosmos/cosmos-sdk/pull/6843). +* 2020 Feb 15: Initial Draft +* 2020 Feb 24: Updates to handle messages with interface fields +* 2020 Apr 27: Convert usages of `oneof` for interfaces to `Any` +* 2020 May 15: Describe `cosmos_proto` extensions and amino compatibility +* 2020 Dec 4: Move and rename `MarshalAny` and `UnmarshalAny` into the `codec.Codec` interface. +* 2021 Feb 24: Remove mentions of `HybridCodec`, which has been abandoned in [#6843](https://github.com/cosmos/cosmos-sdk/pull/6843). ## Status @@ -28,9 +28,9 @@ From the Amino docs: Amino also aims to have the following goals (not a complete list): -- Binary bytes must be decode-able with a schema. -- Schema must be upgradeable. -- The encoder and decoder logic must be reasonably simple. +* Binary bytes must be decode-able with a schema. +* Schema must be upgradeable. +* The encoder and decoder logic must be reasonably simple. However, we believe that Amino does not fulfill these goals completely and does not fully meet the needs of a truly flexible cross-language and multi-client compatible encoding protocol in the Cosmos SDK. @@ -42,13 +42,13 @@ largely reflected in the performance of simulations and application transaction Thus, we need to adopt an encoding protocol that meets the following criteria for state serialization: -- Language agnostic -- Platform agnostic -- Rich client support and thriving ecosystem -- High performance -- Minimal encoded message size -- Codegen-based over reflection-based -- Supports backward and forward compatibility +* Language agnostic +* Platform agnostic +* Rich client support and thriving ecosystem +* High performance +* Minimal encoded message size +* Codegen-based over reflection-based +* Supports backward and forward compatibility Note, migrating away from Amino should be viewed as a two-pronged approach, state and client encoding. This ADR focuses on state serialization in the Cosmos SDK state machine. A corresponding ADR will be @@ -62,8 +62,8 @@ applications wishing to continue to use Amino. We will provide this mechanism by accept a codec interface, `Marshaler`, instead of a concrete Amino codec. Furthermore, the Cosmos SDK will provide two concrete implementations of the `Marshaler` interface: `AminoCodec` and `ProtoCodec`. -- `AminoCodec`: Uses Amino for both binary and JSON encoding. -- `ProtoCodec`: Uses Protobuf for both binary and JSON encoding. +* `AminoCodec`: Uses Amino for both binary and JSON encoding. +* `ProtoCodec`: Uses Protobuf for both binary and JSON encoding. Modules will use whichever codec that is instantiated in the app. By default, the Cosmos SDK's `simapp` instantiates a `ProtoCodec` as the concrete implementation of `Marshaler`, inside the `MakeTestEncodingConfig` @@ -320,11 +320,11 @@ have been registered properly with Amino). In order for this functionality to work: -- **all legacy code must use `*codec.LegacyAmino` instead of `*amino.Codec` which is +* **all legacy code must use `*codec.LegacyAmino` instead of `*amino.Codec` which is now a wrapper which properly handles `Any`** -- **all new code should use `Marshaler` which is compatible with both amino and +* **all new code should use `Marshaler` which is compatible with both amino and protobuf** -- Also, before v0.39, `codec.LegacyAmino` will be renamed to `codec.LegacyAmino`. +* Also, before v0.39, `codec.LegacyAmino` will be renamed to `codec.LegacyAmino`. ### Why Wasn't X Chosen Instead @@ -361,19 +361,19 @@ seamless. ### Positive -- Significant performance gains. -- Supports backward and forward type compatibility. -- Better support for cross-language clients. +* Significant performance gains. +* Supports backward and forward type compatibility. +* Better support for cross-language clients. ### Negative -- Learning curve required to understand and implement Protobuf messages. -- Slightly larger message size due to use of `Any`, although this could be offset +* Learning curve required to understand and implement Protobuf messages. +* Slightly larger message size due to use of `Any`, although this could be offset by a compression layer in the future ### Neutral ## References -1. https://github.com/cosmos/cosmos-sdk/issues/4977 -2. https://github.com/cosmos/cosmos-sdk/issues/5444 +1. +2. diff --git a/docs/architecture/adr-020-protobuf-transaction-encoding.md b/docs/architecture/adr-020-protobuf-transaction-encoding.md index e50fe6704fa9..c28c71610dae 100644 --- a/docs/architecture/adr-020-protobuf-transaction-encoding.md +++ b/docs/architecture/adr-020-protobuf-transaction-encoding.md @@ -2,19 +2,19 @@ ## Changelog -- 2020 March 06: Initial Draft -- 2020 March 12: API Updates -- 2020 April 13: Added details on interface `oneof` handling -- 2020 April 30: Switch to `Any` -- 2020 May 14: Describe public key encoding -- 2020 June 08: Store `TxBody` and `AuthInfo` as bytes in `SignDoc`; Document `TxRaw` as broadcast and storage type. -- 2020 August 07: Use ADR 027 for serializing `SignDoc`. -- 2020 August 19: Move sequence field from `SignDoc` to `SignerInfo`, as discussed in [#6966](https://github.com/cosmos/cosmos-sdk/issues/6966). -- 2020 September 25: Remove `PublicKey` type in favor of `secp256k1.PubKey`, `ed25519.PubKey` and `multisig.LegacyAminoPubKey`. -- 2020 October 15: Add `GetAccount` and `GetAccountWithHeight` methods to the `AccountRetriever` interface. -- 2021 Feb 24: The Cosmos SDK does not use Tendermint's `PubKey` interface anymore, but its own `cryptotypes.PubKey`. Updates to reflect this. -- 2021 May 3: Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec`. -- 2021 June 10: Add `clientCtx.Codec: codec.Codec`. +* 2020 March 06: Initial Draft +* 2020 March 12: API Updates +* 2020 April 13: Added details on interface `oneof` handling +* 2020 April 30: Switch to `Any` +* 2020 May 14: Describe public key encoding +* 2020 June 08: Store `TxBody` and `AuthInfo` as bytes in `SignDoc`; Document `TxRaw` as broadcast and storage type. +* 2020 August 07: Use ADR 027 for serializing `SignDoc`. +* 2020 August 19: Move sequence field from `SignDoc` to `SignerInfo`, as discussed in [#6966](https://github.com/cosmos/cosmos-sdk/issues/6966). +* 2020 September 25: Remove `PublicKey` type in favor of `secp256k1.PubKey`, `ed25519.PubKey` and `multisig.LegacyAminoPubKey`. +* 2020 October 15: Add `GetAccount` and `GetAccountWithHeight` methods to the `AccountRetriever` interface. +* 2021 Feb 24: The Cosmos SDK does not use Tendermint's `PubKey` interface anymore, but its own `cryptotypes.PubKey`. Updates to reflect this. +* 2021 May 3: Rename `clientCtx.JSONMarshaler` to `clientCtx.JSONCodec`. +* 2021 June 10: Add `clientCtx.Codec: codec.Codec`. ## Status @@ -168,9 +168,9 @@ attempt to upstream important improvements to `Tx`. All of the signing modes below aim to provide the following guarantees: -- **No Malleability**: `TxBody` and `AuthInfo` cannot change once the transaction +* **No Malleability**: `TxBody` and `AuthInfo` cannot change once the transaction is signed -- **Predictable Gas**: if I am signing a transaction where I am paying a fee, +* **Predictable Gas**: if I am signing a transaction where I am paying a fee, the final gas is fully dependent on what I am signing These guarantees give the maximum amount confidence to message signers that @@ -181,9 +181,9 @@ manipulation of `Tx`s by intermediaries can't result in any meaningful changes. The "direct" signing behavior is to sign the raw `TxBody` bytes as broadcast over the wire. This has the advantages of: -- requiring the minimum additional client capabilities beyond a standard protocol +* requiring the minimum additional client capabilities beyond a standard protocol buffers implementation -- leaving effectively zero holes for transaction malleability (i.e. there are no +* leaving effectively zero holes for transaction malleability (i.e. there are no subtle differences between the signing and encoding formats which could potentially be exploited by an attacker) @@ -219,10 +219,10 @@ Signature verifiers do: 1. Deserialize a `TxRaw` and pull out `body` and `auth_info`. 2. Create a list of required signer addresses from the messages. 3. For each required signer: - - Pull account number and sequence from the state. - - Obtain the public key either from state or `AuthInfo`'s `signer_infos`. - - Create a `SignDoc` and serialize it using [ADR 027](./adr-027-deterministic-protobuf-serialization.md). - - Verify the signature at the the same list position against the serialized `SignDoc`. + * Pull account number and sequence from the state. + * Obtain the public key either from state or `AuthInfo`'s `signer_infos`. + * Create a `SignDoc` and serialize it using [ADR 027](./adr-027-deterministic-protobuf-serialization.md). + * Verify the signature at the the same list position against the serialized `SignDoc`. #### `SIGN_MODE_LEGACY_AMINO` @@ -263,14 +263,14 @@ by `SIGN_MODE_TEXTUAL` when it is implemented. Unknown fields in protobuf messages should generally be rejected by transaction processors because: -- important data may be present in the unknown fields, that if ignored, will +* important data may be present in the unknown fields, that if ignored, will cause unexpected behavior for clients -- they present a malleability vulnerability where attackers can bloat tx size +* they present a malleability vulnerability where attackers can bloat tx size by adding random uninterpreted data to unsigned content (i.e. the master `Tx`, not `TxBody`) There are also scenarios where we may choose to safely ignore unknown fields -(https://github.com/cosmos/cosmos-sdk/issues/6078#issuecomment-624400188) to +() to provide graceful forwards compatibility with newer clients. We propose that field numbers with bit 11 set (for most use cases this is @@ -279,9 +279,9 @@ ignored if unknown. To handle this we will need a unknown field filter that: -- always rejects unknown fields in unsigned content (i.e. top-level `Tx` and +* always rejects unknown fields in unsigned content (i.e. top-level `Tx` and unsigned parts of `AuthInfo` if present based on the signing mode) -- rejects unknown fields in all messages (including nested `Any`s) other than +* rejects unknown fields in all messages (including nested `Any`s) other than fields with bit 11 set This will likely need to be a custom protobuf parser pass that takes message bytes @@ -379,7 +379,7 @@ can gracefully transition away from Amino JSON. ### `SIGN_MODE_DIRECT_AUX` -(\*Documented as option (3) in https://github.com/cosmos/cosmos-sdk/issues/6078#issuecomment-628026933) +(\*Documented as option (3) in ) We could add a mode `SIGN_MODE_DIRECT_AUX` to support scenarios where multiple signatures @@ -408,27 +408,27 @@ To generate a signature in `SIGN_MODE_DIRECT_AUX` these steps would be followed: 1. Encode `SignDocAux` (with the same requirement that fields must be serialized in order): -```proto -// types/types.proto -message SignDocAux { - bytes body_bytes = 1; - // PublicKey is included in SignDocAux : - // 1. as a special case for multisig public keys. For multisig public keys, - // the signer should use the top-level multisig public key they are signing - // against, not their own public key. This is to prevent against a form - // of malleability where a signature could be taken out of context of the - // multisig key that was intended to be signed for - // 2. to guard against scenario where configuration information is encoded - // in public keys (it has been proposed) such that two keys can generate - // the same signature but have different security properties - // - // By including it here, the composer of AuthInfo cannot reference the - // a public key variant the signer did not intend to use - PublicKey public_key = 2; - string chain_id = 3; - uint64 account_number = 4; -} -``` + ```proto + // types/types.proto + message SignDocAux { + bytes body_bytes = 1; + // PublicKey is included in SignDocAux : + // 1. as a special case for multisig public keys. For multisig public keys, + // the signer should use the top-level multisig public key they are signing + // against, not their own public key. This is to prevent against a form + // of malleability where a signature could be taken out of context of the + // multisig key that was intended to be signed for + // 2. to guard against scenario where configuration information is encoded + // in public keys (it has been proposed) such that two keys can generate + // the same signature but have different security properties + // + // By including it here, the composer of AuthInfo cannot reference the + // a public key variant the signer did not intend to use + PublicKey public_key = 2; + string chain_id = 3; + uint64 account_number = 4; + } + ``` 2. Sign the encoded `SignDocAux` bytes 3. Send their signature and `SignerInfo` to primary signer who will then @@ -437,7 +437,7 @@ message SignDocAux { ### `SIGN_MODE_DIRECT_RELAXED` -(_Documented as option (1)(a) in https://github.com/cosmos/cosmos-sdk/issues/6078#issuecomment-628026933_) +(_Documented as option (1)(a) in _) This is a variation of `SIGN_MODE_DIRECT` where multiple signers wouldn't need to coordinate public keys and signing modes in advance. It would involve an alternate @@ -449,14 +449,14 @@ too burdensome. ### Positive -- Significant performance gains. -- Supports backward and forward type compatibility. -- Better support for cross-language clients. -- Multiple signing modes allow for greater protocol evolution +* Significant performance gains. +* Supports backward and forward type compatibility. +* Better support for cross-language clients. +* Multiple signing modes allow for greater protocol evolution ### Negative -- `google.protobuf.Any` type URLs increase transaction size although the effect +* `google.protobuf.Any` type URLs increase transaction size although the effect may be negligible or compression may be able to mitigate it. ### Neutral diff --git a/docs/architecture/adr-021-protobuf-query-encoding.md b/docs/architecture/adr-021-protobuf-query-encoding.md index 443b506101f1..9037d14a8055 100644 --- a/docs/architecture/adr-021-protobuf-query-encoding.md +++ b/docs/architecture/adr-021-protobuf-query-encoding.md @@ -2,7 +2,7 @@ ## Changelog -- 2020 March 27: Initial Draft +* 2020 March 27: Initial Draft ## Status diff --git a/docs/architecture/adr-022-custom-panic-handling.md b/docs/architecture/adr-022-custom-panic-handling.md index aec42f861ccc..645b9eb4fe5c 100644 --- a/docs/architecture/adr-022-custom-panic-handling.md +++ b/docs/architecture/adr-022-custom-panic-handling.md @@ -2,8 +2,8 @@ ## Changelog -- 2020 Apr 24: Initial Draft -- 2021 Sep 14: Superseded by ADR-045 +* 2020 Apr 24: Initial Draft +* 2021 Sep 14: Superseded by ADR-045 ## Status @@ -196,23 +196,23 @@ This method would prepend handlers to an existing chain. ### Positive -- Developers of Cosmos SDK based projects can add custom panic handlers to: +* Developers of Cosmos SDK based projects can add custom panic handlers to: * add error context for custom panic sources (panic inside of custom keepers); * emit `panic()`: passthrough recovery object to the Tendermint core; * other necessary handling; -- Developers can use standard Cosmos SDK `BaseApp` implementation, rather that rewriting it in their projects; -- Proposed solution doesn't break the current "standard" `runTx()` flow; +* Developers can use standard Cosmos SDK `BaseApp` implementation, rather that rewriting it in their projects; +* Proposed solution doesn't break the current "standard" `runTx()` flow; ### Negative -- Introduces changes to the execution model design. +* Introduces changes to the execution model design. ### Neutral -- `OutOfGas` error handler becomes one of the middlewares; -- Default panic handler becomes one of the middlewares; +* `OutOfGas` error handler becomes one of the middlewares; +* Default panic handler becomes one of the middlewares; ## References -- [PR-6053 with proposed solution](https://github.com/cosmos/cosmos-sdk/pull/6053) -- [Similar solution. ADR-010 Modular AnteHandler](https://github.com/cosmos/cosmos-sdk/blob/v0.38.3/docs/architecture/adr-010-modular-antehandler.md) +* [PR-6053 with proposed solution](https://github.com/cosmos/cosmos-sdk/pull/6053) +* [Similar solution. ADR-010 Modular AnteHandler](https://github.com/cosmos/cosmos-sdk/blob/v0.38.3/docs/architecture/adr-010-modular-antehandler.md) diff --git a/docs/architecture/adr-023-protobuf-naming.md b/docs/architecture/adr-023-protobuf-naming.md index f4425243e158..4360befded06 100644 --- a/docs/architecture/adr-023-protobuf-naming.md +++ b/docs/architecture/adr-023-protobuf-naming.md @@ -2,8 +2,8 @@ ## Changelog -- 2020 April 27: Initial Draft -- 2020 August 5: Update guidelines +* 2020 April 27: Initial Draft +* 2020 August 5: Update guidelines ## Status @@ -132,13 +132,13 @@ The following guidelines are recommended for marking packages as alpha or beta: * marking something as `alpha` or `beta` should be a last resort and just putting something in the stable package (i.e. `v1` or `v2`) should be preferred -* a package *should* be marked as `alpha` *if and only if* there are active discussions to remove +* a package _should_ be marked as `alpha` _if and only if_ there are active discussions to remove or significantly alter the package in the near future -* a package *should* be marked as `beta` *if and only if* there is an active discussion to +* a package _should_ be marked as `beta` _if and only if_ there is an active discussion to significantly refactor/rework the functionality in the near future but not remove it -* modules *can and should* have types in both stable (i.e. `v1` or `v2`) and unstable (`alpha` or `beta`) packages. +* modules _can and should_ have types in both stable (i.e. `v1` or `v2`) and unstable (`alpha` or `beta`) packages. -*`alpha` and `beta` should not be used to avoid responsibility for maintaining compatibility.* +_`alpha` and `beta` should not be used to avoid responsibility for maintaining compatibility._ Whenever code is released into the wild, especially on a blockchain, there is a high cost to changing things. In some cases, for instance with immutable smart contracts, a breaking change may be impossible to fix. diff --git a/docs/architecture/adr-024-coin-metadata.md b/docs/architecture/adr-024-coin-metadata.md index 5195a9c40008..3c55f80f0d4d 100644 --- a/docs/architecture/adr-024-coin-metadata.md +++ b/docs/architecture/adr-024-coin-metadata.md @@ -2,7 +2,7 @@ ## Changelog -- 05/19/2020: Initial draft +* 05/19/2020: Initial draft ## Status @@ -93,9 +93,9 @@ As an example, the ATOM's metadata can be defined as follows: Given the above metadata, a client may infer the following things: -- 4.3atom = 4.3 * (10^6) = 4,300,000uatom -- The string "atom" can be used as a display name in a list of tokens. -- The balance 4300000 can be displayed as 4,300,000uatom or 4,300matom or 4.3atom. +* 4.3atom = 4.3 * (10^6) = 4,300,000uatom +* The string "atom" can be used as a display name in a list of tokens. +* The balance 4300000 can be displayed as 4,300,000uatom or 4,300matom or 4.3atom. The `display` denomination 4.3atom is a good default if the authors of the client don't make an explicit decision to choose a different representation. @@ -124,13 +124,13 @@ via an endpoint, we may consider supporting automatic conversion of a given unit ### Positive -- Provides clients, wallet providers and block explorers with additional data on +* Provides clients, wallet providers and block explorers with additional data on asset denomination to improve UX and remove any need to make assumptions on denomination units. ### Negative -- A small amount of required additional storage in the `x/bank` module. The amount +* A small amount of required additional storage in the `x/bank` module. The amount of additional storage should be minimal as the amount of total assets should not be large. diff --git a/docs/architecture/adr-027-deterministic-protobuf-serialization.md b/docs/architecture/adr-027-deterministic-protobuf-serialization.md index 41c8d2fc10f6..8a20435a3f04 100644 --- a/docs/architecture/adr-027-deterministic-protobuf-serialization.md +++ b/docs/architecture/adr-027-deterministic-protobuf-serialization.md @@ -2,8 +2,8 @@ ## Changelog -- 2020-08-07: Initial Draft -- 2020-09-01: Further clarify rules +* 2020-08-07: Initial Draft +* 2020-09-01: Further clarify rules ## Status @@ -126,12 +126,12 @@ default value). There are three main implementation strategies, ordered from the least to the most custom development: -- **Use a protobuf serializer that follows the above rules by default.** E.g. +* **Use a protobuf serializer that follows the above rules by default.** E.g. [gogoproto](https://pkg.go.dev/github.com/gogo/protobuf/gogoproto) is known to be compliant by in most cases, but not when certain annotations such as `nullable = false` are used. It might also be an option to configure an existing serializer accordingly. -- **Normalize default values before encoding them.** If your serializer follows +* **Normalize default values before encoding them.** If your serializer follows rule 1. and 2. and allows you to explicitly unset fields for serialization, you can normalize default values to unset. This can be done when working with [protobuf.js](https://www.npmjs.com/package/protobufjs): @@ -146,7 +146,7 @@ most custom development: }).finish(); ``` -- **Use a hand-written serializer for the types you need.** If none of the above +* **Use a hand-written serializer for the types you need.** If none of the above ways works for you, you can write a serializer yourself. For SignDoc this would look something like this in Go, building on existing protobuf utilities: @@ -231,14 +231,14 @@ backlinks: [] must result in the serialization -``` +```text 0a1b54686520776f726c64206e65656473206368616e676520f09f8cb318e8bebec8bc2e280138024a084e696365206f6e654a095468616e6b20796f75 ``` When inspecting the serialized document, you see that every second field is omitted: -``` +```sh $ echo 0a1b54686520776f726c64206e65656473206368616e676520f09f8cb318e8bebec8bc2e280138024a084e696365206f6e654a095468616e6b20796f75 | xxd -r -p | protoc --decode_raw 1: "The world needs change \360\237\214\263" 3: 1596806111080 @@ -255,20 +255,20 @@ for all protobuf documents we need in the context of Cosmos SDK signing. ### Positive -- Well defined rules that can be verified independent of a reference +* Well defined rules that can be verified independent of a reference implementation -- Simple enough to keep the barrier to implement transaction signing low -- It allows us to continue to use 0 and other empty values in SignDoc, avoiding +* Simple enough to keep the barrier to implement transaction signing low +* It allows us to continue to use 0 and other empty values in SignDoc, avoiding the need to work around 0 sequences. This does not imply the change from - https://github.com/cosmos/cosmos-sdk/pull/6949 should not be merged, but not + should not be merged, but not too important anymore. ### Negative -- When implementing transaction signing, the encoding rules above must be +* When implementing transaction signing, the encoding rules above must be understood and implemented. -- The need for rule number 3. adds some complexity to implementations. -- Some data structures may require custom code for serialization. Thus +* The need for rule number 3. adds some complexity to implementations. +* Some data structures may require custom code for serialization. Thus the code is not very portable - it will require additional work for each client implementing serialization to properly handle custom data structures. @@ -283,32 +283,32 @@ the need of implementing a custom serializer that adheres to this standard (and ## References -- 1 _When a message is serialized, there is no guaranteed order for +* 1 _When a message is serialized, there is no guaranteed order for how its known or unknown fields should be written. Serialization order is an implementation detail and the details of any particular implementation may change in the future. Therefore, protocol buffer parsers must be able to parse fields in any order._ from - https://developers.google.com/protocol-buffers/docs/encoding#order -- 2 https://developers.google.com/protocol-buffers/docs/encoding#signed_integers -- 3 _Note that for scalar message fields, once a message is parsed + +* 2 +* 3 _Note that for scalar message fields, once a message is parsed there's no way of telling whether a field was explicitly set to the default value (for example whether a boolean was set to false) or just not set at all: you should bear this in mind when defining your message types. For example, don't have a boolean that switches on some behavior when set to false if you don't want that behavior to also happen by default._ from - https://developers.google.com/protocol-buffers/docs/proto3#default -- 4 _When a message is parsed, if the encoded message does not + +* 4 _When a message is parsed, if the encoded message does not contain a particular singular element, the corresponding field in the parsed object is set to the default value for that field._ from - https://developers.google.com/protocol-buffers/docs/proto3#default -- 5 _Also note that if a scalar message field is set to its default, + +* 5 _Also note that if a scalar message field is set to its default, the value will not be serialized on the wire._ from - https://developers.google.com/protocol-buffers/docs/proto3#default -- 6 _For enums, the default value is the first defined enum value, + +* 6 _For enums, the default value is the first defined enum value, which must be 0._ from - https://developers.google.com/protocol-buffers/docs/proto3#default -- 7 _For message fields, the field is not set. Its exact value is + +* 7 _For message fields, the field is not set. Its exact value is language-dependent._ from - https://developers.google.com/protocol-buffers/docs/proto3#default -- Encoding rules and parts of the reasoning taken from + +* Encoding rules and parts of the reasoning taken from [canonical-proto3 Aaron Craelius](https://github.com/regen-network/canonical-proto3) diff --git a/docs/architecture/adr-028-public-key-addresses.md b/docs/architecture/adr-028-public-key-addresses.md index 51ccc4390d75..9cf49f8db007 100644 --- a/docs/architecture/adr-028-public-key-addresses.md +++ b/docs/architecture/adr-028-public-key-addresses.md @@ -2,8 +2,8 @@ ## Changelog -- 2020/08/18: Initial version -- 2021/01/15: Analysis and algorithm update +* 2020/08/18: Initial version +* 2021/01/15: Analysis and algorithm update ## Status @@ -29,12 +29,12 @@ a security break of one account type shouldn't impact the security of other acco One initial proposal was extending the address length and adding prefixes for different types of addresses. -@ethanfrey explained an alternate approach originally used in https://github.com/iov-one/weave: +@ethanfrey explained an alternate approach originally used in : > I spent quite a bit of time thinking about this issue while building weave... The other cosmos Sdk. > Basically I define a condition to be a type and format as human readable string with some binary data appended. This condition is hashed into an Address (again at 20 bytes). The use of this prefix makes it impossible to find a preimage for a given address with a different condition (eg ed25519 vs secp256k1). -> This is explained in depth here https://weave.readthedocs.io/en/latest/design/permissions.html -> And the code is here, look mainly at the top where we process conditions. https://github.com/iov-one/weave/blob/master/conditions.go +> This is explained in depth here +> And the code is here, look mainly at the top where we process conditions. And explained how this approach should be sufficiently collision resistant: @@ -53,15 +53,15 @@ This disqualifies the initial proposal. In the issue we discussed various modifications: -+ Choice of the hash function. -+ Move the prefix out of the hash function: `keyTypePrefix + sha256(keybytes)[:20]` [post-hash-prefix-proposal]. -+ Use double hashing: `sha256(keyTypePrefix + sha256(keybytes)[:20])`. -+ Increase to keybytes hash slice from 20 byte to 32 or 40 bytes. We concluded that 32 bytes, produced by a good hash functions is future secure. +* Choice of the hash function. +* Move the prefix out of the hash function: `keyTypePrefix + sha256(keybytes)[:20]` [post-hash-prefix-proposal]. +* Use double hashing: `sha256(keyTypePrefix + sha256(keybytes)[:20])`. +* Increase to keybytes hash slice from 20 byte to 32 or 40 bytes. We concluded that 32 bytes, produced by a good hash functions is future secure. ### Requirements -+ Support currently used tools - we don't want to break an ecosystem, or add a long adaptation period. Ref: https://github.com/cosmos/cosmos-sdk/issues/8041 -+ Try to keep the address length small - addresses are widely used in state, both as part of a key and object value. +* Support currently used tools - we don't want to break an ecosystem, or add a long adaptation period. Ref: +* Try to keep the address length small - addresses are widely used in state, both as part of a key and object value. ### Scope @@ -82,8 +82,8 @@ We define the following account types, for which we define the address function: Currently (Jan 2021), the only officially supported Cosmos SDK user accounts are `secp256k1` basic accounts and legacy amino multisig. They are used in existing Cosmos SDK zones. They use the following address formats: -- secp256k1: `ripemd160(sha256(pk_bytes))[:20]` -- legacy amino multisig: `sha256(aminoCdc.Marshal(pk))[:20]` +* secp256k1: `ripemd160(sha256(pk_bytes))[:20]` +* legacy amino multisig: `sha256(aminoCdc.Marshal(pk))[:20]` We don't want to change existing addresses. So the addresses for these two key types will remain the same. @@ -118,8 +118,8 @@ We use the `address.Hash` function for generating addresses for all accounts rep * simple public keys: `address.Hash(keyType, pubkey)` -+ aggregated keys (eg: BLS): `address.Hash(keyType, aggregatedPubKey)` -+ modules: `address.Hash("module", moduleName)` +* aggregated keys (eg: BLS): `address.Hash(keyType, aggregatedPubKey)` +* modules: `address.Hash("module", moduleName)` ### Composed Addresses @@ -196,13 +196,13 @@ func Module(moduleName string, key []byte) []byte{ **Example** A lending BTC pool address would be: -``` +```go btcPool := address.Module("lending", btc.Addrress()}) ``` If we want to create an address for a module account depending on more than one key, we can concatenate them: -``` +```go btcAtomAMM := address.Module("amm", btc.Addrress() + atom.Address()}) ``` @@ -220,7 +220,7 @@ Note: `Module` is a special case of the more general _derived_ address, where we **Example** For a cosmwasm smart-contract address we could use the following construction: -``` +```go smartContractAddr := Derived(Module("cosmwasm", smartContractsNamespace), []{smartContractKey}) ``` @@ -252,21 +252,21 @@ This ADR is compatible with what was committed and directly supported in the Cos ### Positive -- a simple algorithm for generating addresses for new public keys, complex accounts and modules -- the algorithm generalizes _native composed keys_ -- increased security and collision resistance of addresses -- the approach is extensible for future use-cases - one can use other address types, as long as they don't conflict with the address length specified here (20 or 32 bytes). -- support new account types. +* a simple algorithm for generating addresses for new public keys, complex accounts and modules +* the algorithm generalizes _native composed keys_ +* increased security and collision resistance of addresses +* the approach is extensible for future use-cases - one can use other address types, as long as they don't conflict with the address length specified here (20 or 32 bytes). +* support new account types. ### Negative -- addresses do not communicate key type, a prefixed approach would have done this -- addresses are 60% longer and will consume more storage space -- requires a refactor of KVStore store keys to handle variable length addresses +* addresses do not communicate key type, a prefixed approach would have done this +* addresses are 60% longer and will consume more storage space +* requires a refactor of KVStore store keys to handle variable length addresses ### Neutral -- protobuf message names are used as key type prefixes +* protobuf message names are used as key type prefixes ## Further Discussions @@ -280,50 +280,50 @@ End of Dec 2020 we had a session with [Alan Szepieniec](https://scholar.google.b Alan general observations: -+ we don’t need 2-preimage resistance -+ we need 32bytes address space for collision resistance -+ when an attacker can control an input for object with an address then we have a problem with birthday attack -+ there is an issue with smart-contracts for hashing -+ sha2 mining can be use to breaking address pre-image +* we don’t need 2-preimage resistance +* we need 32bytes address space for collision resistance +* when an attacker can control an input for object with an address then we have a problem with birthday attack +* there is an issue with smart-contracts for hashing +* sha2 mining can be use to breaking address pre-image Hashing algorithm -+ any attack breaking blake3 will break blake2 -+ Alan is pretty confident about the current security analysis of the blake hash algorithm. It was a finalist, and the author is well known in security analysis. +* any attack breaking blake3 will break blake2 +* Alan is pretty confident about the current security analysis of the blake hash algorithm. It was a finalist, and the author is well known in security analysis. Algorithm: -+ Alan recommends to hash the prefix: `address(pub_key) = hash(hash(key_type) + pub_key)[:32]`, main benefits: - + we are free to user arbitrary long prefix names - + we still don’t risk collisions - + switch tables -+ discussion about penalization -> about adding prefix post hash -+ Aaron asked about post hash prefixes (`address(pub_key) = key_type + hash(pub_key)`) and differences. Alan noted that this approach has longer address space and it’s stronger. +* Alan recommends to hash the prefix: `address(pub_key) = hash(hash(key_type) + pub_key)[:32]`, main benefits: + * we are free to user arbitrary long prefix names + * we still don’t risk collisions + * switch tables +* discussion about penalization -> about adding prefix post hash +* Aaron asked about post hash prefixes (`address(pub_key) = key_type + hash(pub_key)`) and differences. Alan noted that this approach has longer address space and it’s stronger. Algorithm for complex / composed keys: -+ merging tree like addresses with same algorithm are fine +* merging tree like addresses with same algorithm are fine Module addresses: Should module addresses have different size to differentiate it? -+ we will need to set a pre-image prefix for module addresse to keept them in 32-byte space: `hash(hash('module') + module_key)` -+ Aaron observation: we already need to deal with variable length (to not break secp256k1 keys). +* we will need to set a pre-image prefix for module addresse to keept them in 32-byte space: `hash(hash('module') + module_key)` +* Aaron observation: we already need to deal with variable length (to not break secp256k1 keys). Discssion about arithmetic hash function for ZKP -+ Posseidon / Rescue -+ Problem: much bigger risk because we don’t know much techniques and history of crypto-analysis of arithmetic constructions. It’s still a new ground and area of active research. +* Posseidon / Rescue +* Problem: much bigger risk because we don’t know much techniques and history of crypto-analysis of arithmetic constructions. It’s still a new ground and area of active research. Post quantum signature size -+ Alan suggestion: Falcon: speed / size ration - very good. -+ Aaron - should we think about it? +* Alan suggestion: Falcon: speed / size ration - very good. +* Aaron - should we think about it? Alan: based on early extrapolation this thing will get able to break EC cryptography in 2050 . But that’s a lot of uncertainty. But there is magic happening with recurions / linking / simulation and that can speedup the progress. Other ideas -+ Let’s say we use same key and two different address algorithms for 2 different use cases. Is it still safe to use it? Alan: if we want to hide the public key (which is not our use case), then it’s less secure but there are fixes. +* Let’s say we use same key and two different address algorithms for 2 different use cases. Is it still safe to use it? Alan: if we want to hide the public key (which is not our use case), then it’s less secure but there are fixes. ### References -+ [Notes](https://hackmd.io/_NGWI4xZSbKzj1BkCqyZMw) +* [Notes](https://hackmd.io/_NGWI4xZSbKzj1BkCqyZMw) diff --git a/docs/architecture/adr-029-fee-grant-module.md b/docs/architecture/adr-029-fee-grant-module.md index f6e9a4883c3d..c2799c476a2a 100644 --- a/docs/architecture/adr-029-fee-grant-module.md +++ b/docs/architecture/adr-029-fee-grant-module.md @@ -2,8 +2,8 @@ ## Changelog -- 2020/08/18: Initial Draft -- 2021/05/05: Removed height based expiration support and simplified naming. +* 2020/08/18: Initial Draft +* 2021/05/05: Removed height based expiration support and simplified naming. ## Status @@ -137,17 +137,17 @@ set and correctly deduct fees based on fee allowances. ### Positive -- improved UX for use cases where it is cumbersome to maintain an account balance just for fees +* improved UX for use cases where it is cumbersome to maintain an account balance just for fees ### Negative ### Neutral -- a new field must be added to the transaction `Fee` message and a new `AnteDecorator` must be +* a new field must be added to the transaction `Fee` message and a new `AnteDecorator` must be created to use it ## References -- Blog article describing initial work: https://medium.com/regen-network/hacking-the-cosmos-cosmwasm-and-key-management-a08b9f561d1b -- Initial public specification: https://gist.github.com/aaronc/b60628017352df5983791cad30babe56 -- Original subkeys proposal from B-harvest which influenced this design: https://github.com/cosmos/cosmos-sdk/issues/4480 +* Blog article describing initial work: +* Initial public specification: +* Original subkeys proposal from B-harvest which influenced this design: diff --git a/docs/architecture/adr-030-authz-module.md b/docs/architecture/adr-030-authz-module.md index ff6286c2d888..62ba1885ccaf 100644 --- a/docs/architecture/adr-030-authz-module.md +++ b/docs/architecture/adr-030-authz-module.md @@ -2,10 +2,10 @@ ## Changelog -- 2019-11-06: Initial Draft -- 2020-10-12: Updated Draft -- 2020-11-13: Accepted -- 2020-05-06: proto API updates, use `sdk.Msg` instead of `sdk.ServiceMsg` (the latter concept was removed from Cosmos SDK) +* 2019-11-06: Initial Draft +* 2020-10-12: Updated Draft +* 2020-11-13: Accepted +* 2020-05-06: proto API updates, use `sdk.Msg` instead of `sdk.ServiceMsg` (the latter concept was removed from Cosmos SDK) ## Status @@ -20,9 +20,9 @@ on behalf of that account to other accounts. The concrete use cases which motivated this module include: -- the desire to delegate the ability to vote on proposals to other accounts besides the account which one has +* the desire to delegate the ability to vote on proposals to other accounts besides the account which one has delegated stake -- "sub-keys" functionality, as originally proposed in [\#4480](https://github.com/cosmos/cosmos-sdk/issues/4480) which +* "sub-keys" functionality, as originally proposed in [\#4480](https://github.com/cosmos/cosmos-sdk/issues/4480) which is a term used to describe the functionality provided by this module together with the `fee_grant` module from [ADR 029](./adr-029-fee-grant-module.md) and the [group module](https://github.com/regen-network/cosmos-modules/tree/master/incubator/group). @@ -232,9 +232,9 @@ message GenericAuthorization { ### Positive -- Users will be able to authorize arbitrary actions on behalf of their accounts to other +* Users will be able to authorize arbitrary actions on behalf of their accounts to other users, improving key management for many use cases -- The solution is more generic than previously considered approaches and the +* The solution is more generic than previously considered approaches and the `Authorization` interface approach can be extended to cover other use cases by SDK users @@ -244,6 +244,6 @@ SDK users ## References -- Initial Hackatom implementation: https://github.com/cosmos-gaians/cosmos-sdk/tree/hackatom/x/delegation -- Post-Hackatom spec: https://gist.github.com/aaronc/b60628017352df5983791cad30babe56#delegation-module -- B-Harvest subkeys spec: https://github.com/cosmos/cosmos-sdk/issues/4480 +* Initial Hackatom implementation: +* Post-Hackatom spec: +* B-Harvest subkeys spec: diff --git a/docs/architecture/adr-031-msg-service.md b/docs/architecture/adr-031-msg-service.md index ff92c617bb5a..eabf243d2591 100644 --- a/docs/architecture/adr-031-msg-service.md +++ b/docs/architecture/adr-031-msg-service.md @@ -2,8 +2,8 @@ ## Changelog -- 2020-10-05: Initial Draft -- 2021-04-21: Remove `ServiceMsg`s to follow Protobuf `Any`'s spec, see [#9063](https://github.com/cosmos/cosmos-sdk/issues/9063). +* 2020-10-05: Initial Draft +* 2021-04-21: Remove `ServiceMsg`s to follow Protobuf `Any`'s spec, see [#9063](https://github.com/cosmos/cosmos-sdk/issues/9063). ## Status @@ -41,7 +41,7 @@ This isn’t really documented anywhere and clients would need to know the inter of the Cosmos SDK to parse that value and return it to users. Also, there may be cases where we want to use these return values programatically. -For instance, https://github.com/cosmos/cosmos-sdk/issues/7093 proposes a method for +For instance, proposes a method for doing inter-module Ocaps using the `Msg` router. A well-defined return type would improve the developer UX for this approach. @@ -183,20 +183,20 @@ Finally, closing a module to client API opens desirable OCAP patterns discussed ### Pros -- communicates return type clearly -- manual handler registration and return type marshaling is no longer needed, just implement the interface and register it -- communication interface is automatically generated, the developer can now focus only on the state transition methods - this would improve the UX of [\#7093](https://github.com/cosmos/cosmos-sdk/issues/7093) approach (1) if we chose to adopt that -- generated client code could be useful for clients and tests -- dramatically reduces and simplifies the code +* communicates return type clearly +* manual handler registration and return type marshaling is no longer needed, just implement the interface and register it +* communication interface is automatically generated, the developer can now focus only on the state transition methods - this would improve the UX of [\#7093](https://github.com/cosmos/cosmos-sdk/issues/7093) approach (1) if we chose to adopt that +* generated client code could be useful for clients and tests +* dramatically reduces and simplifies the code ### Cons -- using `service` definitions outside the context of gRPC could be confusing (but doesn’t violate the proto3 spec) +* using `service` definitions outside the context of gRPC could be confusing (but doesn’t violate the proto3 spec) ## References -- [Initial Github Issue \#7122](https://github.com/cosmos/cosmos-sdk/issues/7122) -- [proto 3 Language Guide: Defining Services](https://developers.google.com/protocol-buffers/docs/proto3#services) -- [Initial pre-`Any` `Msg` designs](https://docs.google.com/document/d/1eEgYgvgZqLE45vETjhwIw4VOqK-5hwQtZtjVbiXnIGc) -- [ADR 020](./adr-020-protobuf-transaction-encoding.md) -- [ADR 021](./adr-021-protobuf-query-encoding.md) +* [Initial Github Issue \#7122](https://github.com/cosmos/cosmos-sdk/issues/7122) +* [proto 3 Language Guide: Defining Services](https://developers.google.com/protocol-buffers/docs/proto3#services) +* [Initial pre-`Any` `Msg` designs](https://docs.google.com/document/d/1eEgYgvgZqLE45vETjhwIw4VOqK-5hwQtZtjVbiXnIGc) +* [ADR 020](./adr-020-protobuf-transaction-encoding.md) +* [ADR 021](./adr-021-protobuf-query-encoding.md) diff --git a/docs/architecture/adr-032-typed-events.md b/docs/architecture/adr-032-typed-events.md index 0d96054f51c6..1e769f4501c1 100644 --- a/docs/architecture/adr-032-typed-events.md +++ b/docs/architecture/adr-032-typed-events.md @@ -2,13 +2,13 @@ ## Changelog -- 28-Sept-2020: Initial Draft +* 28-Sept-2020: Initial Draft ## Authors -- Anil Kumar (@anilcse) -- Jack Zampolin (@jackzampolin) -- Adam Bozanich (@boz) +* Anil Kumar (@anilcse) +* Jack Zampolin (@jackzampolin) +* Adam Bozanich (@boz) ## Status @@ -34,7 +34,7 @@ This proposal is specifically about how to consume these events as a client of t ## Decision -__Step-1__: Implement additional functionality in the `types` package: `EmitTypedEvent` and `ParseTypedEvent` functions +**Step-1**: Implement additional functionality in the `types` package: `EmitTypedEvent` and `ParseTypedEvent` functions ```go // types/events.go @@ -111,7 +111,7 @@ Here, the `EmitTypedEvent` is a method on `EventManager` which takes typed event When we subscribe to emitted events on the tendermint websocket, they are emitted in the form of an `abci.Event`. `ParseTypedEvent` parses the event back to it's original proto message. -__Step-2__: Add proto definitions for typed events for msgs in each module: +**Step-2**: Add proto definitions for typed events for msgs in each module: For example, let's take `MsgSubmitProposal` of `gov` module and implement this event's type. @@ -128,7 +128,7 @@ message EventSubmitProposal { } ``` -__Step-3__: Refactor event emission to use the typed event created and emit using `sdk.EmitTypedEvent`: +**Step-3**: Refactor event emission to use the typed event created and emit using `sdk.EmitTypedEvent`: ```go // x/gov/handler.go @@ -145,7 +145,7 @@ func handleMsgSubmitProposal(ctx sdk.Context, keeper keeper.Keeper, msg types.Ms } ``` -#### How to subscribe to these typed events in `Client` +### How to subscribe to these typed events in `Client` > NOTE: Full code example below @@ -315,5 +315,5 @@ func PublishChainTxEvents(ctx context.Context, client tmclient.EventsClient, bus ## References -- [Publish Custom Events via a bus](https://github.com/ovrclk/akash/blob/90d258caeb933b611d575355b8df281208a214f8/events/publish.go#L19-L58) -- [Consuming the events in `Client`](https://github.com/ovrclk/deploy/blob/bf6c633ab6c68f3026df59efd9982d6ca1bf0561/cmd/event-handlers.go#L57) +* [Publish Custom Events via a bus](https://github.com/ovrclk/akash/blob/90d258caeb933b611d575355b8df281208a214f8/events/publish.go#L19-L58) +* [Consuming the events in `Client`](https://github.com/ovrclk/deploy/blob/bf6c633ab6c68f3026df59efd9982d6ca1bf0561/cmd/event-handlers.go#L57) diff --git a/docs/architecture/adr-033-protobuf-inter-module-comm.md b/docs/architecture/adr-033-protobuf-inter-module-comm.md index e647e1eebb10..f6bb881b9bd5 100644 --- a/docs/architecture/adr-033-protobuf-inter-module-comm.md +++ b/docs/architecture/adr-033-protobuf-inter-module-comm.md @@ -2,7 +2,7 @@ ## Changelog -- 2020-10-05: Initial Draft +* 2020-10-05: Initial Draft ## Status @@ -14,9 +14,9 @@ This ADR introduces a system for permissioned inter-module communication leverag service definitions defined in [ADR 021](./adr-021-protobuf-query-encoding.md) and [ADR 031](./adr-031-msg-service.md) which provides: -- stable protobuf based module interfaces to potentially later replace the keeper paradigm -- stronger inter-module object capabilities (OCAPs) guarantees -- module accounts and sub-account authorization +* stable protobuf based module interfaces to potentially later replace the keeper paradigm +* stronger inter-module object capabilities (OCAPs) guarantees +* module accounts and sub-account authorization ## Context @@ -99,8 +99,8 @@ transaction This mechanism has the added benefits of: -- reducing boilerplate through code generation, and -- allowing for modules in other languages either via a VM like CosmWasm or sub-processes using gRPC +* reducing boilerplate through code generation, and +* allowing for modules in other languages either via a VM like CosmWasm or sub-processes using gRPC ### Inter-module Communication @@ -376,16 +376,16 @@ replacing `Keeper` interfaces altogether. ### Positive -- an alternative to keepers which can more easily lead to stable inter-module interfaces -- proper inter-module OCAPs -- improved module developer DevX, as commented on by several particpants on +* an alternative to keepers which can more easily lead to stable inter-module interfaces +* proper inter-module OCAPs +* improved module developer DevX, as commented on by several particpants on [Architecture Review Call, Dec 3](https://hackmd.io/E0wxxOvRQ5qVmTf6N_k84Q) -- lays the groundwork for what can be a greatly simplified `app.go` -- router can be setup to enforce atomic transactions for module-to-module calls +* lays the groundwork for what can be a greatly simplified `app.go` +* router can be setup to enforce atomic transactions for module-to-module calls ### Negative -- modules which adopt this will need significant refactoring +* modules which adopt this will need significant refactoring ### Neutral @@ -393,8 +393,8 @@ replacing `Keeper` interfaces altogether. ## References -- [ADR 021](./adr-021-protobuf-query-encoding.md) -- [ADR 031](./adr-031-msg-service.md) -- [ADR 028](./adr-028-public-key-addresses.md) -- [ADR 030 draft](https://github.com/cosmos/cosmos-sdk/pull/7105) -- [Object-Capability Model](../docs/core/ocap.md) +* [ADR 021](./adr-021-protobuf-query-encoding.md) +* [ADR 031](./adr-031-msg-service.md) +* [ADR 028](./adr-028-public-key-addresses.md) +* [ADR 030 draft](https://github.com/cosmos/cosmos-sdk/pull/7105) +* [Object-Capability Model](../docs/core/ocap.md) diff --git a/docs/architecture/adr-034-account-rekeying.md b/docs/architecture/adr-034-account-rekeying.md index d3b54d17f17e..21eaff0f6733 100644 --- a/docs/architecture/adr-034-account-rekeying.md +++ b/docs/architecture/adr-034-account-rekeying.md @@ -2,7 +2,7 @@ ## Changelog -- 30-09-2020: Initial Draft +* 30-09-2020: Initial Draft ## Status @@ -73,4 +73,4 @@ Breaks the current assumed relationship between address and pubkeys as H(pubkey) ## References -+ https://www.algorand.com/resources/blog/announcing-rekeying +* diff --git a/docs/architecture/adr-035-rosetta-api-support.md b/docs/architecture/adr-035-rosetta-api-support.md index 7a10a59b0d42..5e8d300136b0 100644 --- a/docs/architecture/adr-035-rosetta-api-support.md +++ b/docs/architecture/adr-035-rosetta-api-support.md @@ -2,14 +2,14 @@ ## Authors -- Jonathan Gimeno (@jgimeno) -- David Grierson (@senormonito) -- Alessio Treglia (@alessio) -- Frojdy Dymylja (@fdymylja) +* Jonathan Gimeno (@jgimeno) +* David Grierson (@senormonito) +* Alessio Treglia (@alessio) +* Frojdy Dymylja (@fdymylja) ## Changelog -- 2021-05-12: the external library [cosmos-rosetta-gateway](https://github.com/tendermint/cosmos-rosetta-gateway) has been moved within the Cosmos SDK. +* 2021-05-12: the external library [cosmos-rosetta-gateway](https://github.com/tendermint/cosmos-rosetta-gateway) has been moved within the Cosmos SDK. ## Context @@ -203,9 +203,9 @@ Proposed ### Positive -- Out-of-the-box Rosetta API support within Cosmos SDK. -- Blockchain interface standardisation +* Out-of-the-box Rosetta API support within Cosmos SDK. +* Blockchain interface standardisation ## References -- https://www.rosetta-api.org/ +* diff --git a/docs/architecture/adr-036-arbitrary-signature.md b/docs/architecture/adr-036-arbitrary-signature.md index c175d25ec42f..c82ca6459485 100644 --- a/docs/architecture/adr-036-arbitrary-signature.md +++ b/docs/architecture/adr-036-arbitrary-signature.md @@ -2,14 +2,14 @@ ## Changelog -- 28/10/2020 - Initial draft +* 28/10/2020 - Initial draft ## Authors -- Antoine Herzog (@antoineherzog) -- Zaki Manian (@zmanian) -- Aleksandr Bezobchuk (alexanderbez) [1] -- Frojdi Dymylja (@fdymylja) +* Antoine Herzog (@antoineherzog) +* Zaki Manian (@zmanian) +* Aleksandr Bezobchuk (alexanderbez) [1] +* Frojdi Dymylja (@fdymylja) ## Status @@ -41,11 +41,11 @@ Create the `offchain` proto definitions, we extend the auth module with `offchai An offchain transaction follows these rules: -- the memo must be empty -- nonce, sequence number must be equal to 0 -- chain-id must be equal to “” -- fee gas must be equal to 0 -- fee amount must be an empty array +* the memo must be empty +* nonce, sequence number must be equal to 0 +* chain-id must be equal to “” +* fee gas must be equal to 0 +* fee amount must be an empty array Verification of an offchain transaction follows the same rules as an onchain one, except for the spec differences highlighted above. @@ -110,23 +110,23 @@ Backwards compatibility is maintained as this is a new message spec definition. ### Positive -- A common format that can be used by multiple applications to sign and verify off-chain messages. -- The specification is primitive which means it can cover every use case without limiting what is possible to fit inside it. -- It gives room for other off-chain messages specifications that aim to target more specific and common use cases such as off-chain-based authN/authZ layers [2]. +* A common format that can be used by multiple applications to sign and verify off-chain messages. +* The specification is primitive which means it can cover every use case without limiting what is possible to fit inside it. +* It gives room for other off-chain messages specifications that aim to target more specific and common use cases such as off-chain-based authN/authZ layers [2]. ### Negative -- Current proposal requires a fixed relationship between an account address and a public key. -- Doesn't work with multisig accounts. +* Current proposal requires a fixed relationship between an account address and a public key. +* Doesn't work with multisig accounts. ## Further discussion -- Regarding security in `MsgSignData`, the developer using `MsgSignData` is in charge of making the content laying in `Data` non-replayable when, and if, needed. -- the offchain package will be further extended with extra messages that target specific use cases such as, but not limited to, authentication in applications, payment channels, L2 solutions in general. +* Regarding security in `MsgSignData`, the developer using `MsgSignData` is in charge of making the content laying in `Data` non-replayable when, and if, needed. +* the offchain package will be further extended with extra messages that target specific use cases such as, but not limited to, authentication in applications, payment channels, L2 solutions in general. ## References -1. https://github.com/cosmos/ics/pull/33 -2. https://github.com/cosmos/cosmos-sdk/pull/7727#discussion_r515668204 -3. https://github.com/cosmos/cosmos-sdk/pull/7727#issuecomment-722478477 -4. https://github.com/cosmos/cosmos-sdk/pull/7727#issuecomment-721062923 +1. +2. +3. +4. diff --git a/docs/architecture/adr-037-gov-split-vote.md b/docs/architecture/adr-037-gov-split-vote.md index 742fdd10841e..c09041a84e17 100644 --- a/docs/architecture/adr-037-gov-split-vote.md +++ b/docs/architecture/adr-037-gov-split-vote.md @@ -2,7 +2,7 @@ ## Changelog -- 2020/10/28: Intial draft +* 2020/10/28: Intial draft ## Status @@ -22,7 +22,7 @@ However, often times the entity owning that address might not be a single indivi We modify the vote structs to be -``` +```go type WeightedVoteOption struct { Option string Weight sdk.Dec @@ -37,7 +37,7 @@ type Vote struct { And for backwards compatibility, we introduce `MsgVoteWeighted` while keeping `MsgVote`. -``` +```go type MsgVote struct { ProposalID int64 Voter sdk.Address @@ -58,7 +58,7 @@ The `ValidateBasic` of a `MsgVoteWeighted` struct would require that The governance tally function will iterate over all the options in a vote and add to the tally the result of the voter's voting power * the rate for that option. -``` +```go tally() { results := map[types.VoteOption]sdk.Dec @@ -78,7 +78,7 @@ simd tx gov vote 1 "yes=0.6,no=0.3,abstain=0.05,no_with_veto=0.05" --from mykey To create a single-option vote a user can do either -``` +```sh simd tx gov vote 1 "yes=1" --from mykey ``` @@ -94,18 +94,18 @@ to maintain backwards compatibility. ### Backwards Compatibility -- Previous VoteMsg types will remain the same and so clients will not have to update their procedure unless they want to support the WeightedVoteMsg feature. -- When querying a Vote struct from state, its structure will be different, and so clients wanting to display all voters and their respective votes will have to handle the new format and the fact that a single voter can have split votes. -- The result of querying the tally function should have the same API for clients. +* Previous VoteMsg types will remain the same and so clients will not have to update their procedure unless they want to support the WeightedVoteMsg feature. +* When querying a Vote struct from state, its structure will be different, and so clients wanting to display all voters and their respective votes will have to handle the new format and the fact that a single voter can have split votes. +* The result of querying the tally function should have the same API for clients. ### Positive -- Can make the voting process more accurate for addresses representing multiple stakeholders, often some of the largest addresses. +* Can make the voting process more accurate for addresses representing multiple stakeholders, often some of the largest addresses. ### Negative -- Is more complex than simple voting, and so may be harder to explain to users. However, this is mostly mitigated because the feature is opt-in. +* Is more complex than simple voting, and so may be harder to explain to users. However, this is mostly mitigated because the feature is opt-in. ### Neutral -- Relatively minor change to governance tally function. +* Relatively minor change to governance tally function. diff --git a/docs/architecture/adr-038-state-listening.md b/docs/architecture/adr-038-state-listening.md index 7e5e49d4f255..b9c209b4aa32 100644 --- a/docs/architecture/adr-038-state-listening.md +++ b/docs/architecture/adr-038-state-listening.md @@ -2,7 +2,7 @@ ## Changelog -- 11/23/2020: Initial draft +* 11/23/2020: Initial draft ## Status @@ -535,17 +535,17 @@ These changes will provide a means of subscribing to KVStore state changes in re ### Backwards Compatibility -- This ADR changes the `MultiStore`, `CacheWrap`, and `CacheWrapper` interfaces, implementations supporting the previous version of these interfaces will not support the new ones +* This ADR changes the `MultiStore`, `CacheWrap`, and `CacheWrapper` interfaces, implementations supporting the previous version of these interfaces will not support the new ones ### Positive -- Ability to listen to KVStore state changes in real time and expose these events to external consumers +* Ability to listen to KVStore state changes in real time and expose these events to external consumers ### Negative -- Changes `MultiStore`, `CacheWrap`, and `CacheWrapper` interfaces +* Changes `MultiStore`, `CacheWrap`, and `CacheWrapper` interfaces ### Neutral -- Introduces additional- but optional- complexity to configuring and running a cosmos application -- If an application developer opts to use these features to expose data, they need to be aware of the ramifications/risks of that data exposure as it pertains to the specifics of their application +* Introduces additional- but optional- complexity to configuring and running a cosmos application +* If an application developer opts to use these features to expose data, they need to be aware of the ramifications/risks of that data exposure as it pertains to the specifics of their application diff --git a/docs/architecture/adr-039-epoched-staking.md b/docs/architecture/adr-039-epoched-staking.md index 44c1f14088b1..8c227e586927 100644 --- a/docs/architecture/adr-039-epoched-staking.md +++ b/docs/architecture/adr-039-epoched-staking.md @@ -2,12 +2,12 @@ ## Changelog -- 10-Feb-2021: Initial Draft +* 10-Feb-2021: Initial Draft ## Authors -- Dev Ojha (@valardragon) -- Sunny Aggarwal (@sunnya97) +* Dev Ojha (@valardragon) +* Sunny Aggarwal (@sunnya97) ## Status @@ -43,10 +43,10 @@ There is a design consideration for whether to apply a slash immediately or at t Applying it immediately can be viewed as offering greater consensus layer security, at potential costs to the aforementioned usecases. The benefits of immediate slashing for consensus layer security can be all be obtained by executing the validator jailing immediately (thus removing it from the validator set), and delaying the actual slash change to the validator's weight until the epoch boundary. For the use cases mentioned above, workarounds can be integrated to avoid problems, as follows: -- For threshold based cryptography, this setting will have the threshold cryptography use the original epoch weights, while consensus has an update that lets it more rapidly benefit from additional security. If the threshold based cryptography blocks liveness of the chain, then we have effectively raised the liveness threshold of the remaining validators for the rest of the epoch. (Alternatively, jailed nodes could still contribute shares) This plan will fail in the extreme case that more than 1/3rd of the validators have been jailed within a single epoch. For such an extreme scenario, the chain already have its own custom incident response plan, and defining how to handle the threshold cryptography should be a part of that. -- For light client efficiency, there can be a bit included in the header indicating an intra-epoch slash (ala https://github.com/tendermint/spec/issues/199). -- For fairness of deterministic leader election, applying a slash or jailing within an epoch would break the guarantee we were seeking to provide. This then re-introduces a new (but significantly simpler) problem for trying to provide fairness guarantees. Namely, that validators can adversarially elect to remove themself from the set of proposers. From a security perspective, this could potentially be handled by two different mechanisms (or prove to still be too difficult to achieve). One is making a security statement acknowledging the ability for an adversary to force an ahead-of-time fixed threshold of users to drop out of the proposer set within an epoch. The second method would be to parameterize such that the cost of a slash within the epoch far outweights benefits due to being a proposer. However, this latter criterion is quite dubious, since being a proposer can have many advantageous side-effects in chains with complex state machines. (Namely, DeFi games such as Fomo3D) -- For staking derivative design, there is no issue introduced. This does not increase the state size of staking records, since whether a slash has occured is fully queryable given the validator address. +* For threshold based cryptography, this setting will have the threshold cryptography use the original epoch weights, while consensus has an update that lets it more rapidly benefit from additional security. If the threshold based cryptography blocks liveness of the chain, then we have effectively raised the liveness threshold of the remaining validators for the rest of the epoch. (Alternatively, jailed nodes could still contribute shares) This plan will fail in the extreme case that more than 1/3rd of the validators have been jailed within a single epoch. For such an extreme scenario, the chain already have its own custom incident response plan, and defining how to handle the threshold cryptography should be a part of that. +* For light client efficiency, there can be a bit included in the header indicating an intra-epoch slash (ala ). +* For fairness of deterministic leader election, applying a slash or jailing within an epoch would break the guarantee we were seeking to provide. This then re-introduces a new (but significantly simpler) problem for trying to provide fairness guarantees. Namely, that validators can adversarially elect to remove themself from the set of proposers. From a security perspective, this could potentially be handled by two different mechanisms (or prove to still be too difficult to achieve). One is making a security statement acknowledging the ability for an adversary to force an ahead-of-time fixed threshold of users to drop out of the proposer set within an epoch. The second method would be to parameterize such that the cost of a slash within the epoch far outweights benefits due to being a proposer. However, this latter criterion is quite dubious, since being a proposer can have many advantageous side-effects in chains with complex state machines. (Namely, DeFi games such as Fomo3D) +* For staking derivative design, there is no issue introduced. This does not increase the state size of staking records, since whether a slash has occured is fully queryable given the validator address. ### Token lockup @@ -73,36 +73,36 @@ Until an ABCI mechanism for variable block times is introduced, it is ill-advise ## Decision -__Step-1__: Implement buffering of all staking and slashing messages. +**Step-1**: Implement buffering of all staking and slashing messages. First we create a pool for storing tokens that are being bonded, but should be applied at the epoch boundary called the `EpochDelegationPool`. Then, we have two separate queues, one for staking, one for slashing. We describe what happens on each message being delivered below: ### Staking messages -- **MsgCreateValidator**: Move user's self-bond to `EpochDelegationPool` immediately. Queue a message for the epoch boundary to handle the self-bond, taking the funds from the `EpochDelegationPool`. If Epoch execution fail, return back funds from `EpochDelegationPool` to user's account. -- **MsgEditValidator**: Validate message and if valid queue the message for execution at the end of the Epoch. -- **MsgDelegate**: Move user's funds to `EpochDelegationPool` immediately. Queue a message for the epoch boundary to handle the delegation, taking the funds from the `EpochDelegationPool`. If Epoch execution fail, return back funds from `EpochDelegationPool` to user's account. -- **MsgBeginRedelegate**: Validate message and if valid queue the message for execution at the end of the Epoch. -- **MsgUndelegate**: Validate message and if valid queue the message for execution at the end of the Epoch. +* **MsgCreateValidator**: Move user's self-bond to `EpochDelegationPool` immediately. Queue a message for the epoch boundary to handle the self-bond, taking the funds from the `EpochDelegationPool`. If Epoch execution fail, return back funds from `EpochDelegationPool` to user's account. +* **MsgEditValidator**: Validate message and if valid queue the message for execution at the end of the Epoch. +* **MsgDelegate**: Move user's funds to `EpochDelegationPool` immediately. Queue a message for the epoch boundary to handle the delegation, taking the funds from the `EpochDelegationPool`. If Epoch execution fail, return back funds from `EpochDelegationPool` to user's account. +* **MsgBeginRedelegate**: Validate message and if valid queue the message for execution at the end of the Epoch. +* **MsgUndelegate**: Validate message and if valid queue the message for execution at the end of the Epoch. ### Slashing messages -- **MsgUnjail**: Validate message and if valid queue the message for execution at the end of the Epoch. -- **Slash Event**: Whenever a slash event is created, it gets queued in the slashing module to apply at the end of the epoch. The queues should be setup such that this slash applies immediately. +* **MsgUnjail**: Validate message and if valid queue the message for execution at the end of the Epoch. +* **Slash Event**: Whenever a slash event is created, it gets queued in the slashing module to apply at the end of the epoch. The queues should be setup such that this slash applies immediately. ### Evidence Messages -- **MsgSubmitEvidence**: This gets executed immediately, and the validator gets jailed immediately. However in slashing, the actual slash event gets queued. +* **MsgSubmitEvidence**: This gets executed immediately, and the validator gets jailed immediately. However in slashing, the actual slash event gets queued. Then we add methods to the end blockers, to ensure that at the epoch boundary the queues are cleared and delegation updates are applied. -__Step-2__: Implement querying of queued staking txs. +**Step-2**: Implement querying of queued staking txs. When querying the staking activity of a given address, the status should return not only the amount of tokens staked, but also if there are any queued stake events for that address. This will require more work to be done in the querying logic, to trace the queued upcoming staking events. As an initial implementation, this can be implemented as a linear search over all queued staking events. However, for chains that need long epochs, they should eventually build additional support for nodes that support querying to be able to produce results in constant time. (This is do-able by maintaining an auxilliary hashmap for indexing upcoming staking events by address) -__Step-3__: Adjust gas +**Step-3**: Adjust gas Currently gas represents the cost of executing a transaction when its done immediately. (Merging together costs of p2p overhead, state access overhead, and computational overhead) However, now a transaction can cause computation in a future block, namely at the epoch boundary. diff --git a/docs/architecture/adr-040-storage-and-smt-state-commitments.md b/docs/architecture/adr-040-storage-and-smt-state-commitments.md index ea3db7e98ea0..78e8d5cf55cc 100644 --- a/docs/architecture/adr-040-storage-and-smt-state-commitments.md +++ b/docs/architecture/adr-040-storage-and-smt-state-commitments.md @@ -2,7 +2,7 @@ ## Changelog -- 2020-01-15: Draft +* 2020-01-15: Draft ## Status @@ -19,11 +19,11 @@ Currently, Cosmos SDK uses IAVL for both state [commitments](https://cryptograph IAVL has effectively become an orphaned project within the Cosmos ecosystem and it's proven to be an inefficient state commitment data structure. In the current design, IAVL is used for both data storage and as a Merkle Tree for state commitments. IAVL is meant to be a standalone Merkelized key/value database, however it's using a KV DB engine to store all tree nodes. So, each node is stored in a separate record in the KV DB. This causes many inefficiencies and problems: -+ Each object query requires a tree traversal from the root. Subsequent queries for the same object are cached on the Cosmos SDK level. -+ Each edge traversal requires a DB query. -+ Creating snapshots is [expensive](https://github.com/cosmos/cosmos-sdk/issues/7215#issuecomment-684804950). It takes about 30 seconds to export less than 100 MB of state (as of March 2020). -+ Updates in IAVL may trigger tree reorganization and possible O(log(n)) hashes re-computation, which can become a CPU bottleneck. -+ The node structure is pretty expensive - it contains a standard tree node elements (key, value, left and right element) and additional metadata such as height, version (which is not required by the Cosmos SDK). The entire node is hashed, and that hash is used as the key in the underlying database, [ref](https://github.com/cosmos/iavl/blob/master/docs/node/node.md +* Each object query requires a tree traversal from the root. Subsequent queries for the same object are cached on the Cosmos SDK level. +* Each edge traversal requires a DB query. +* Creating snapshots is [expensive](https://github.com/cosmos/cosmos-sdk/issues/7215#issuecomment-684804950). It takes about 30 seconds to export less than 100 MB of state (as of March 2020). +* Updates in IAVL may trigger tree reorganization and possible O(log(n)) hashes re-computation, which can become a CPU bottleneck. +* The node structure is pretty expensive - it contains a standard tree node elements (key, value, left and right element) and additional metadata such as height, version (which is not required by the Cosmos SDK). The entire node is hashed, and that hash is used as the key in the underlying database, [ref](https://github.com/cosmos/iavl/blob/master/docs/node/node.md ). Moreover, the IAVL project lacks support and a maintainer and we already see better and well-established alternatives. Instead of optimizing the IAVL, we are looking into other solutions for both storage and state commitments. @@ -54,18 +54,18 @@ We propose to use a KV database for both `SS` and `SC`. The store interface will State Storage requirements: -+ range queries -+ quick (key, value) access -+ creating a snapshot -+ historical versioning -+ pruning (garbage collection) +* range queries +* quick (key, value) access +* creating a snapshot +* historical versioning +* pruning (garbage collection) State Commitment requirements: -+ fast updates -+ tree path should be short -+ query historical commitment proofs using ICS-23 standard -+ pruning (garbage collection) +* fast updates +* tree path should be short +* query historical commitment proofs using ICS-23 standard +* pruning (garbage collection) ### SMT for State Commitment @@ -192,9 +192,9 @@ The presented workaround can be used until the IBC module is fully upgraded to s We consider a compression of prefix keys by creating a mapping from module key to an integer, and serializing the integer using varint coding. Varint coding assures that different values don't have common byte prefix. For Merkle Proofs we can't use prefix compression - so it should only apply for the `SS` keys. Moreover, the prefix compression should be only applied for the module namespace. More precisely: -+ each module has it's own namespace; -+ when accessing a module namespace we create a KVStore with embedded prefix; -+ that prefix will be compressed only when accessing and managing `SS`. +* each module has it's own namespace; +* when accessing a module namespace we create a KVStore with embedded prefix; +* that prefix will be compressed only when accessing and managing `SS`. We need to assure that the codes won't change. We can fix the mapping in a static variable (provided by an app) or SS state under a special key. @@ -209,10 +209,11 @@ TODO: finalize this or move to another ADR. ## Migration Using the new store will require a migration. 2 Migrations are proposed: + 1. Genesis export -- it will reset the blockchain history. 2. In place migration: we can reuse `UpgradeKeeper.SetUpgradeHandler` to provide the migration logic: - ```go +```go app.UpgradeKeeper.SetUpgradeHandler("adr-40", func(ctx sdk.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { storev2.Migrate(iavlstore, v2.store) @@ -221,7 +222,7 @@ app.UpgradeKeeper.SetUpgradeHandler("adr-40", func(ctx sdk.Context, plan upgrade // with the updated module ConsensusVersions return app.mm.RunMigrations(ctx, vm) }) - ``` +``` The `Migrate` function will read all entries from a store/v1 DB and save them to the AD-40 combined KV store. Cache layer should not be used and the operation must finish with a single Commit call. @@ -239,21 +240,21 @@ We change the storage layout of the state machine, a storage hard fork and netwo ### Positive -+ Decoupling state from state commitment introduce better engineering opportunities for further optimizations and better storage patterns. -+ Performance improvements. -+ Joining SMT based camp which has wider and proven adoption than IAVL. Example projects which decided on SMT: Ethereum2, Diem (Libra), Trillan, Tezos, Celestia. -+ Multistore removal fixes a longstanding issue with the current MultiStore design. -+ Simplifies merkle proofs - all modules, except IBC, have only one pass for merkle proof. +* Decoupling state from state commitment introduce better engineering opportunities for further optimizations and better storage patterns. +* Performance improvements. +* Joining SMT based camp which has wider and proven adoption than IAVL. Example projects which decided on SMT: Ethereum2, Diem (Libra), Trillan, Tezos, Celestia. +* Multistore removal fixes a longstanding issue with the current MultiStore design. +* Simplifies merkle proofs - all modules, except IBC, have only one pass for merkle proof. ### Negative -+ Storage migration -+ LL SMT doesn't support pruning - we will need to add and test that functionality. -+ `SS` keys will have an overhead of a key prefix. This doesn't impact `SC` because all keys in `SC` have same size (they are hashed). +* Storage migration +* LL SMT doesn't support pruning - we will need to add and test that functionality. +* `SS` keys will have an overhead of a key prefix. This doesn't impact `SC` because all keys in `SC` have same size (they are hashed). ### Neutral -+ Deprecating IAVL, which is one of the core proposals of Cosmos Whitepaper. +* Deprecating IAVL, which is one of the core proposals of Cosmos Whitepaper. ## Alternative designs @@ -277,12 +278,12 @@ We were discussing use case where modules can use a support database, which is n ## References -+ [IAVL What's Next?](https://github.com/cosmos/cosmos-sdk/issues/7100) -+ [IAVL overview](https://docs.google.com/document/d/16Z_hW2rSAmoyMENO-RlAhQjAG3mSNKsQueMnKpmcBv0/edit#heading=h.yd2th7x3o1iv) of it's state v0.15 -+ [State commitments and storage report](https://paper.dropbox.com/published/State-commitments-and-storage-review--BDvA1MLwRtOx55KRihJ5xxLbBw-KeEB7eOd11pNrZvVtqUgL3h) -+ [Celestia (LazyLedger) SMT](https://github.com/lazyledger/smt) -+ Facebook Diem (Libra) SMT [design](https://developers.diem.com/papers/jellyfish-merkle-tree/2021-01-14.pdf) -+ [Trillian Revocation Transparency](https://github.com/google/trillian/blob/master/docs/papers/RevocationTransparency.pdf), [Trillian Verifiable Data Structures](https://github.com/google/trillian/blob/master/docs/papers/VerifiableDataStructures.pdf). -+ Design and implementation [discussion](https://github.com/cosmos/cosmos-sdk/discussions/8297). -+ [How to Upgrade IBC Chains and their Clients](https://github.com/cosmos/ibc-go/blob/main/docs/ibc/upgrades/quick-guide.md) -+ [ADR-40 Effect on IBC](https://github.com/cosmos/ibc-go/discussions/256) +* [IAVL What's Next?](https://github.com/cosmos/cosmos-sdk/issues/7100) +* [IAVL overview](https://docs.google.com/document/d/16Z_hW2rSAmoyMENO-RlAhQjAG3mSNKsQueMnKpmcBv0/edit#heading=h.yd2th7x3o1iv) of it's state v0.15 +* [State commitments and storage report](https://paper.dropbox.com/published/State-commitments-and-storage-review--BDvA1MLwRtOx55KRihJ5xxLbBw-KeEB7eOd11pNrZvVtqUgL3h) +* [Celestia (LazyLedger) SMT](https://github.com/lazyledger/smt) +* Facebook Diem (Libra) SMT [design](https://developers.diem.com/papers/jellyfish-merkle-tree/2021-01-14.pdf) +* [Trillian Revocation Transparency](https://github.com/google/trillian/blob/master/docs/papers/RevocationTransparency.pdf), [Trillian Verifiable Data Structures](https://github.com/google/trillian/blob/master/docs/papers/VerifiableDataStructures.pdf). +* Design and implementation [discussion](https://github.com/cosmos/cosmos-sdk/discussions/8297). +* [How to Upgrade IBC Chains and their Clients](https://github.com/cosmos/ibc-go/blob/main/docs/ibc/upgrades/quick-guide.md) +* [ADR-40 Effect on IBC](https://github.com/cosmos/ibc-go/discussions/256) diff --git a/docs/architecture/adr-041-in-place-store-migrations.md b/docs/architecture/adr-041-in-place-store-migrations.md index 3eb8a078ccac..9366f1af4a11 100644 --- a/docs/architecture/adr-041-in-place-store-migrations.md +++ b/docs/architecture/adr-041-in-place-store-migrations.md @@ -2,7 +2,7 @@ ## Changelog -- 17.02.2021: Initial Draft +* 17.02.2021: Initial Draft ## Status @@ -18,8 +18,8 @@ When a chain upgrade introduces state-breaking changes inside modules, the curre This procedure is cumbersome for multiple reasons: -- The procedure takes time. It can take hours to run the `export` command, plus some additional hours to run `InitChain` on the fresh chain using the migrated JSON. -- The exported JSON file can be heavy (~100MB-1GB), making it difficult to view, edit and transfer, which in turn introduces additional work to solve these problems (such as [streaming genesis](https://github.com/cosmos/cosmos-sdk/issues/6936)). +* The procedure takes time. It can take hours to run the `export` command, plus some additional hours to run `InitChain` on the fresh chain using the migrated JSON. +* The exported JSON file can be heavy (~100MB-1GB), making it difficult to view, edit and transfer, which in turn introduces additional work to solve these problems (such as [streaming genesis](https://github.com/cosmos/cosmos-sdk/issues/6936)). ## Decision @@ -81,7 +81,7 @@ Each module's migration functions are specific to the module's store evolutions, We introduce a new prefix store in `x/upgrade`'s store. This store will track each module's current version, it can be modelized as a `map[string]uint64` of module name to module ConsensusVersion, and will be used when running the migrations (see next section for details). The key prefix used is `0x1`, and the key/value format is: -``` +```text 0x2 | {bytes(module_name)} => BigEndian(module_consensus_version) ``` @@ -116,10 +116,10 @@ A gRPC query endpoint to query the `VersionMap` stored in `x/upgrade`'s state wi Once all the migration handlers are registered inside the configurator (which happens at startup), running migrations can happen by calling the `RunMigrations` method on `module.Manager`. This function will loop through all modules, and for each module: -- Get the old ConsensusVersion of the module from its `VersionMap` argument (let's call it `M`). -- Fetch the new ConsensusVersion of the module from the `ConsensusVersion()` method on `AppModule` (call it `N`). -- If `N>M`, run all registered migrations for the module sequentially `M -> M+1 -> M+2...` until `N`. - - There is a special case where there is no ConsensusVersion for the module, as this means that the module has been newly added during the upgrade. In this case, no migration function is run, and the module's current ConsensusVersion is saved to `x/upgrade`'s store. +* Get the old ConsensusVersion of the module from its `VersionMap` argument (let's call it `M`). +* Fetch the new ConsensusVersion of the module from the `ConsensusVersion()` method on `AppModule` (call it `N`). +* If `N>M`, run all registered migrations for the module sequentially `M -> M+1 -> M+2...` until `N`. + * There is a special case where there is no ConsensusVersion for the module, as this means that the module has been newly added during the upgrade. In this case, no migration function is run, and the module's current ConsensusVersion is saved to `x/upgrade`'s store. If a required migration is missing (e.g. if it has not been registered in the `Configurator`), then the `RunMigrations` function will error. @@ -133,8 +133,8 @@ app.UpgradeKeeper.SetUpgradeHandler("my-plan", func(ctx sdk.Context, plan upgrad Assuming a chain upgrades at block `n`, the procedure should run as follows: -- the old binary will halt in `BeginBlock` when starting block `N`. In its store, the ConsensusVersions of the old binary's modules are stored. -- the new binary will start at block `N`. The UpgradeHandler is set in the new binary, so will run at `BeginBlock` of the new binary. Inside `x/upgrade`'s `ApplyUpgrade`, the `VersionMap` will be retrieved from the (old binary's) store, and passed into the `RunMigrations` functon, migrating all module stores in-place before the modules' own `BeginBlock`s. +* the old binary will halt in `BeginBlock` when starting block `N`. In its store, the ConsensusVersions of the old binary's modules are stored. +* the new binary will start at block `N`. The UpgradeHandler is set in the new binary, so will run at `BeginBlock` of the new binary. Inside `x/upgrade`'s `ApplyUpgrade`, the `VersionMap` will be retrieved from the (old binary's) store, and passed into the `RunMigrations` functon, migrating all module stores in-place before the modules' own `BeginBlock`s. ## Consequences @@ -146,22 +146,22 @@ While modules MUST register their migration functions when bumping ConsensusVers ### Positive -- Perform chain upgrades without manipulating JSON files. -- While no benchmark has been made yet, it is probable that in-place store migrations will take less time than JSON migrations. The main reason supporting this claim is that both the `simd export` command on the old binary and the `InitChain` function on the new binary will be skipped. +* Perform chain upgrades without manipulating JSON files. +* While no benchmark has been made yet, it is probable that in-place store migrations will take less time than JSON migrations. The main reason supporting this claim is that both the `simd export` command on the old binary and the `InitChain` function on the new binary will be skipped. ### Negative -- Module developers MUST correctly track consensus-breaking changes in their modules. If a consensus-breaking change is introduced in a module without its corresponding `ConsensusVersion()` bump, then the `RunMigrations` function won't detect the migration, and the chain upgrade might be unsuccessful. Documentation should clearly reflect this. +* Module developers MUST correctly track consensus-breaking changes in their modules. If a consensus-breaking change is introduced in a module without its corresponding `ConsensusVersion()` bump, then the `RunMigrations` function won't detect the migration, and the chain upgrade might be unsuccessful. Documentation should clearly reflect this. ### Neutral -- The Cosmos SDK will continue to support JSON migrations via the existing `simd export` and `simd migrate` commands. -- The current ADR does not allow creating, renaming or deleting stores, only modifying existing store keys and values. The Cosmos SDK already has the `StoreLoader` for those operations. +* The Cosmos SDK will continue to support JSON migrations via the existing `simd export` and `simd migrate` commands. +* The current ADR does not allow creating, renaming or deleting stores, only modifying existing store keys and values. The Cosmos SDK already has the `StoreLoader` for those operations. ## Further Discussions ## References -- Initial discussion: https://github.com/cosmos/cosmos-sdk/discussions/8429 -- Implementation of `ConsensusVersion` and `RunMigrations`: https://github.com/cosmos/cosmos-sdk/pull/8485 -- Issue discussing `x/upgrade` design: https://github.com/cosmos/cosmos-sdk/issues/8514 +* Initial discussion: +* Implementation of `ConsensusVersion` and `RunMigrations`: +* Issue discussing `x/upgrade` design: diff --git a/docs/architecture/adr-042-group-module.md b/docs/architecture/adr-042-group-module.md index 2907c7305aa8..bf24b3effa83 100644 --- a/docs/architecture/adr-042-group-module.md +++ b/docs/architecture/adr-042-group-module.md @@ -2,7 +2,7 @@ ## Changelog -- 2020/04/09: Initial Draft +* 2020/04/09: Initial Draft ## Status @@ -16,15 +16,15 @@ This ADR defines the `x/group` module which allows the creation and management o The legacy amino multi-signature mechanism of the Cosmos SDK has certain limitations: -- Key rotation is not possible, although this can be solved with [account rekeying](adr-034-account-rekeying.md). -- Thresholds can't be changed. -- UX is cumbersome for non-technical users ([#5661](https://github.com/cosmos/cosmos-sdk/issues/5661)). -- It requires `legacy_amino` sign mode ([#8141](https://github.com/cosmos/cosmos-sdk/issues/8141)). +* Key rotation is not possible, although this can be solved with [account rekeying](adr-034-account-rekeying.md). +* Thresholds can't be changed. +* UX is cumbersome for non-technical users ([#5661](https://github.com/cosmos/cosmos-sdk/issues/5661)). +* It requires `legacy_amino` sign mode ([#8141](https://github.com/cosmos/cosmos-sdk/issues/8141)). While the group module is not meant to be a total replacement for the current multi-signature accounts, it provides a solution to the limitations described above, with a more flexible key management system where keys can be added, updated or removed, as well as configurable thresholds. It's meant to be used with other access control modules such as [`x/feegrant`](./adr-029-fee-grant-module.md) ans [`x/authz`](adr-030-authz-module.md) to simplify key management for individuals and organizations. -The proof of concept of the group module can be found in https://github.com/regen-network/regen-ledger/tree/master/proto/regen/group/v1alpha1 and https://github.com/regen-network/regen-ledger/tree/master/x/group. +The proof of concept of the group module can be found in and . ## Decision @@ -187,9 +187,9 @@ passes as well as any metadata associated with the proposal. These `sdk.Msg`s ge Internally, a proposal also tracks: -- its current `Status`: submitted, closed or aborted -- its `Result`: unfinalized, accepted or rejected -- its `VoteState` in the form of a `Tally`, which is calculated on new votes and when executing the proposal. +* its current `Status`: submitted, closed or aborted +* its `Result`: unfinalized, accepted or rejected +* its `VoteState` in the form of a `Tally`, which is calculated on new votes and when executing the proposal. ```proto // Tally represents the sum of weighted votes. @@ -254,26 +254,26 @@ Inter-module communication introduced by [ADR-033](adr-033-protobuf-inter-module ### Positive -- Improved UX for multi-signature accounts allowing key rotation and custom decision policies. +* Improved UX for multi-signature accounts allowing key rotation and custom decision policies. ### Negative ### Neutral -- It uses ADR 033 so it will need to be implemented within the Cosmos SDK, but this doesn't imply necessarily any large refactoring of existing Cosmos SDK modules. -- The current implementation of the group module uses the ORM package. +* It uses ADR 033 so it will need to be implemented within the Cosmos SDK, but this doesn't imply necessarily any large refactoring of existing Cosmos SDK modules. +* The current implementation of the group module uses the ORM package. ## Further Discussions -- Convergence of `/group` and `x/gov` as both support proposals and voting: https://github.com/cosmos/cosmos-sdk/discussions/9066 -- `x/group` possible future improvements: - - Execute proposals on submission (https://github.com/regen-network/regen-ledger/issues/288) - - Withdraw a proposal (https://github.com/regen-network/cosmos-modules/issues/41) - - Make `Tally` more flexible and support non-binary choices +* Convergence of `/group` and `x/gov` as both support proposals and voting: +* `x/group` possible future improvements: + * Execute proposals on submission () + * Withdraw a proposal () + * Make `Tally` more flexible and support non-binary choices ## References -- Initial specification: - - https://gist.github.com/aaronc/b60628017352df5983791cad30babe56#group-module - - [#5236](https://github.com/cosmos/cosmos-sdk/pull/5236) -- Proposal to add `x/group` into the Cosmos SDK: [#7633](https://github.com/cosmos/cosmos-sdk/issues/7633) +* Initial specification: + * + * [#5236](https://github.com/cosmos/cosmos-sdk/pull/5236) +* Proposal to add `x/group` into the Cosmos SDK: [#7633](https://github.com/cosmos/cosmos-sdk/issues/7633) diff --git a/docs/architecture/adr-043-nft-module.md b/docs/architecture/adr-043-nft-module.md index 0da4a5822d29..802d2d03a949 100644 --- a/docs/architecture/adr-043-nft-module.md +++ b/docs/architecture/adr-043-nft-module.md @@ -2,8 +2,8 @@ ## Changelog -- 2021-05-01: Initial Draft -- 2021-07-02: Review updates +* 2021-05-01: Initial Draft +* 2021-07-02: Review updates ## Status @@ -13,22 +13,22 @@ PROPOSED This ADR defines the `x/nft` module which is a generic implementation of NFTs, roughly "compatible" with ERC721. **Applications using the `x/nft` module must implement the following functions**: -- `MsgNewClass` - Receive the user's request to create a class, and call the `NewClass` of the `x/nft` module. -- `MsgUpdateClass` - Receive the user's request to update a class, and call the `UpdateClass` of the `x/nft` module. -- `MsgMintNFT` - Receive the user's request to mint a nft, and call the `MintNFT` of the `x/nft` module. -- `BurnNFT` - Receive the user's request to burn a nft, and call the `BurnNFT` of the `x/nft` module. -- `UpdateNFT` - Receive the user's request to update a nft, and call the `UpdateNFT` of the `x/nft` module. +* `MsgNewClass` - Receive the user's request to create a class, and call the `NewClass` of the `x/nft` module. +* `MsgUpdateClass` - Receive the user's request to update a class, and call the `UpdateClass` of the `x/nft` module. +* `MsgMintNFT` - Receive the user's request to mint a nft, and call the `MintNFT` of the `x/nft` module. +* `BurnNFT` - Receive the user's request to burn a nft, and call the `BurnNFT` of the `x/nft` module. +* `UpdateNFT` - Receive the user's request to update a nft, and call the `UpdateNFT` of the `x/nft` module. ## Context -NFTs are more than just crypto art, which is very helpful for accruing value to the Cosmos ecosystem. As a result, Cosmos Hub should implement NFT functions and enable a unified mechanism for storing and sending the ownership representative of NFTs as discussed in https://github.com/cosmos/cosmos-sdk/discussions/9065. +NFTs are more than just crypto art, which is very helpful for accruing value to the Cosmos ecosystem. As a result, Cosmos Hub should implement NFT functions and enable a unified mechanism for storing and sending the ownership representative of NFTs as discussed in . As discussed in [#9065](https://github.com/cosmos/cosmos-sdk/discussions/9065), several potential solutions can be considered: -- irismod/nft and modules/incubator/nft -- CW721 -- DID NFTs -- interNFT +* irismod/nft and modules/incubator/nft +* CW721 +* DID NFTs +* interNFT Since functions/use cases of NFTs are tightly connected with their logic, it is almost impossible to support all the NFTs' use cases in one Cosmos SDK module by defining and implementing different transaction types. @@ -41,10 +41,10 @@ The current design is based on the work done by [IRISnet team](https://github.co We create a `x/nft` module, which contains the following functionality: -- Store NFTs and track their ownership. -- Expose `Keeper` interface for composing modules to transfer, mint and burn NFTs. -- Expose external `Message` interface for users to transfer ownership of their NFTs. -- Query NFTs and their supply information. +* Store NFTs and track their ownership. +* Expose `Keeper` interface for composing modules to transfer, mint and burn NFTs. +* Expose external `Message` interface for users to transfer ownership of their NFTs. +* Query NFTs and their supply information. The proposed module is a base module for NFT app logic. It's goal it to provide a common layer for storage, basic transfer functionality and IBC. The module should not be used as a standalone. Instead an app should create a specialized module to handle app specific logic (eg: NFT ID construction, royalty), user level minting and burning. Moreover an app specialized module should handle auxiliary data to support the app logic (eg indexes, ORM, business data). @@ -54,8 +54,9 @@ All data carried over IBC must be part of the `NFT` or `Class` type described be ### Types We propose two main types: -+ `Class` -- describes NFT class. We can think about it as a smart contract address. -+ `NFT` -- object representing unique, non fungible asset. Each NFT is associated with a Class. + +* `Class` -- describes NFT class. We can think about it as a smart contract address. +* `NFT` -- object representing unique, non fungible asset. Each NFT is associated with a Class. #### Class @@ -73,13 +74,13 @@ message Class { } ``` -- `id` is an alphanumeric identifier of the NFT class; it is used as the primary index for storing the class; _required_ -- `name` is a descriptive name of the NFT class; _optional_ -- `symbol` is the symbol usually shown on exchanges for the NFT class; _optional_ -- `description` is a detailed description of the NFT class; _optional_ -- `uri` is a URI for the class metadata stored off chain. It should be a JSON file that contains metadata about the NFT class and NFT data schema ([OpenSea example](https://docs.opensea.io/docs/contract-level-metadata)); _optional_ -- `uri_hash` is a hash of the document pointed by uri; _optional_ -- `data` is app specific metadata of the class; _optional_ +* `id` is an alphanumeric identifier of the NFT class; it is used as the primary index for storing the class; _required_ +* `name` is a descriptive name of the NFT class; _optional_ +* `symbol` is the symbol usually shown on exchanges for the NFT class; _optional_ +* `description` is a detailed description of the NFT class; _optional_ +* `uri` is a URI for the class metadata stored off chain. It should be a JSON file that contains metadata about the NFT class and NFT data schema ([OpenSea example](https://docs.opensea.io/docs/contract-level-metadata)); _optional_ +* `uri_hash` is a hash of the document pointed by uri; _optional_ +* `data` is app specific metadata of the class; _optional_ #### NFT @@ -95,16 +96,16 @@ message NFT { } ``` -- `class_id` is the identifier of the NFT class where the NFT belongs; _required_,`[a-zA-Z][a-zA-Z0-9/:-]{2,100}` -- `id` is an alphanumeric identifier of the NFT, unique within the scope of its class. It is specified by the creator of the NFT and may be expanded to use DID in the future. `class_id` combined with `id` uniquely identifies an NFT and is used as the primary index for storing the NFT; _required_,`[a-zA-Z][a-zA-Z0-9/:-]{2,100}` +* `class_id` is the identifier of the NFT class where the NFT belongs; _required_,`[a-zA-Z][a-zA-Z0-9/:-]{2,100}` +* `id` is an alphanumeric identifier of the NFT, unique within the scope of its class. It is specified by the creator of the NFT and may be expanded to use DID in the future. `class_id` combined with `id` uniquely identifies an NFT and is used as the primary index for storing the NFT; _required_,`[a-zA-Z][a-zA-Z0-9/:-]{2,100}` - ``` + ```text {class_id}/{id} --> NFT (bytes) ``` -- `uri` is a URI for the NFT metadata stored off chain. Should point to a JSON file that contains metadata about this NFT (Ref: [ERC721 standard and OpenSea extension](https://docs.opensea.io/docs/metadata-standards)); _required_ -- `uri_hash` is a hash of the document pointed by uri; _optional_ -- `data` is an app specific data of the NFT. CAN be used by composing modules to specify additional properties of the NFT; _optional_ +* `uri` is a URI for the NFT metadata stored off chain. Should point to a JSON file that contains metadata about this NFT (Ref: [ERC721 standard and OpenSea extension](https://docs.opensea.io/docs/metadata-standards)); _required_ +* `uri_hash` is a hash of the document pointed by uri; _optional_ +* `data` is an app specific data of the NFT. CAN be used by composing modules to specify additional properties of the NFT; _optional_ This ADR doesn't specify values that `data` can take; however, best practices recommend upper-level NFT modules clearly specify their contents. Although the value of this field doesn't provide the additional context required to manage NFT records, which means that the field can technically be removed from the specification, the field's existence allows basic informational/UI functionality. @@ -309,31 +310,31 @@ This specification conforms to the ERC-721 smart contract specification for NFT ### Positive -- NFT identifiers available on Cosmos Hub. -- Ability to build different NFT modules for the Cosmos Hub, e.g., ERC-721. -- NFT module which supports interoperability with IBC and other cross-chain infrastructures like Gravity Bridge +* NFT identifiers available on Cosmos Hub. +* Ability to build different NFT modules for the Cosmos Hub, e.g., ERC-721. +* NFT module which supports interoperability with IBC and other cross-chain infrastructures like Gravity Bridge ### Negative -+ New IBC app is required for x/nft -+ CW721 adapter is required +* New IBC app is required for x/nft +* CW721 adapter is required ### Neutral -- Other functions need more modules. For example, a custody module is needed for NFT trading function, a collectible module is needed for defining NFT properties. +* Other functions need more modules. For example, a custody module is needed for NFT trading function, a collectible module is needed for defining NFT properties. ## Further Discussions For other kinds of applications on the Hub, more app-specific modules can be developed in the future: -- `x/nft/custody`: custody of NFTs to support trading functionality. -- `x/nft/marketplace`: selling and buying NFTs using sdk.Coins. -- `x/fractional`: a module to split an ownership of an asset (NFT or other assets) for multiple stakeholder. `x/group` should work for most of the cases. +* `x/nft/custody`: custody of NFTs to support trading functionality. +* `x/nft/marketplace`: selling and buying NFTs using sdk.Coins. +* `x/fractional`: a module to split an ownership of an asset (NFT or other assets) for multiple stakeholder. `x/group` should work for most of the cases. Other networks in the Cosmos ecosystem could design and implement their own NFT modules for specific NFT applications and use cases. ## References -- Initial discussion: https://github.com/cosmos/cosmos-sdk/discussions/9065 -- x/nft: initialize module: https://github.com/cosmos/cosmos-sdk/pull/9174 -- [ADR 033](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-033-protobuf-inter-module-comm.md) +* Initial discussion: +* x/nft: initialize module: +* [ADR 033](https://github.com/cosmos/cosmos-sdk/blob/master/docs/architecture/adr-033-protobuf-inter-module-comm.md) diff --git a/docs/architecture/adr-044-protobuf-updates-guidelines.md b/docs/architecture/adr-044-protobuf-updates-guidelines.md index dc650424d349..833a5648cc64 100644 --- a/docs/architecture/adr-044-protobuf-updates-guidelines.md +++ b/docs/architecture/adr-044-protobuf-updates-guidelines.md @@ -2,8 +2,8 @@ ## Changelog -- 28.06.2021: Initial Draft -- 02.12.2021: Add `Since:` comment for new fields +* 28.06.2021: Initial Draft +* 02.12.2021: Add `Since:` comment for new fields ## Status @@ -19,8 +19,8 @@ The Cosmos SDK maintains a set of [Protobuf definitions](https://github.com/cosm When making changes to these Protobuf definitions, the Cosmos SDK currently only follows [Buf's](https://docs.buf.build/) recommendations. We noticed however that Buf's recommendations might still result in breaking changes in the SDK in some cases. For example: -- Adding fields to `Msg`s. Adding fields is a not a Protobuf spec-breaking operation. However, when adding new fields to `Msg`s, the unknown field rejection will throw an error when sending the new `Msg` to an older node. -- Marking fields as `reserved`. Protobuf proposes the `reserved` keyword for removing fields without the need to bump the package version. However, by doing so, client backwards compatibility is broken as Protobuf doesn't generate anything for `reserved` fields. See [#9446](https://github.com/cosmos/cosmos-sdk/issues/9446) for more details on this issue. +* Adding fields to `Msg`s. Adding fields is a not a Protobuf spec-breaking operation. However, when adding new fields to `Msg`s, the unknown field rejection will throw an error when sending the new `Msg` to an older node. +* Marking fields as `reserved`. Protobuf proposes the `reserved` keyword for removing fields without the need to bump the package version. However, by doing so, client backwards compatibility is broken as Protobuf doesn't generate anything for `reserved` fields. See [#9446](https://github.com/cosmos/cosmos-sdk/issues/9446) for more details on this issue. Moreover, module developers often face other questions around Protobuf definitions such as "Can I rename a field?" or "Can I deprecate a field?" This ADR aims to answer all these questions by providing clear guidelines about allowed updates for Protobuf definitions. @@ -28,11 +28,11 @@ Moreover, module developers often face other questions around Protobuf definitio We decide to keep [Buf's](https://docs.buf.build/) recommendations with the following exceptions: -- `UNARY_RPC`: the Cosmos SDK currently does not support streaming RPCs. -- `COMMENT_FIELD`: the Cosmos SDK allows fields with no comments. -- `SERVICE_SUFFIX`: we use the `Query` and `Msg` service naming convention, which doesn't use the `-Service` suffix. -- `PACKAGE_VERSION_SUFFIX`: some packages, such as `cosmos.crypto.ed25519`, don't use a version suffix. -- `RPC_REQUEST_STANDARD_NAME`: Requests for the `Msg` service don't have the `-Request` suffix to keep backwards compatibility. +* `UNARY_RPC`: the Cosmos SDK currently does not support streaming RPCs. +* `COMMENT_FIELD`: the Cosmos SDK allows fields with no comments. +* `SERVICE_SUFFIX`: we use the `Query` and `Msg` service naming convention, which doesn't use the `-Service` suffix. +* `PACKAGE_VERSION_SUFFIX`: some packages, such as `cosmos.crypto.ed25519`, don't use a version suffix. +* `RPC_REQUEST_STANDARD_NAME`: Requests for the `Msg` service don't have the `-Request` suffix to keep backwards compatibility. On top of Buf's recommendations we add the following guidelines that are specific to the Cosmos SDK. @@ -86,8 +86,8 @@ Protobuf supports the [`deprecated` field option](https://developers.google.com/ As an example, the Cosmos SDK v0.42 to v0.43 update contained two Protobuf-breaking changes, listed below. Instead of bumping the package versions from `v1beta1` to `v1`, the SDK team decided to follow this guideline, by reverting the breaking changes, marking those changes as deprecated, and modifying the node implementation when processing messages with deprecated fields. More specifically: -- The Cosmos SDK recently removed support for [time-based software upgrades](https://github.com/cosmos/cosmos-sdk/pull/8849). As such, the `time` field has been marked as deprecated in `cosmos.upgrade.v1beta1.Plan`. Moreover, the node will reject any proposal containing an upgrade Plan whose `time` field is non-empty. -- The Cosmos SDK now supports [governance split votes](./adr-037-gov-split-vote.md). When querying for votes, the returned `cosmos.gov.v1beta1.Vote` message has its `option` field (used for 1 vote option) deprecated in favor of its `options` field (allowing multiple vote options). Whenever possible, the SDK still populates the deprecated `option` field, that is, if and only if the `len(options) == 1` and `options[0].Weight == 1.0`. +* The Cosmos SDK recently removed support for [time-based software upgrades](https://github.com/cosmos/cosmos-sdk/pull/8849). As such, the `time` field has been marked as deprecated in `cosmos.upgrade.v1beta1.Plan`. Moreover, the node will reject any proposal containing an upgrade Plan whose `time` field is non-empty. +* The Cosmos SDK now supports [governance split votes](./adr-037-gov-split-vote.md). When querying for votes, the returned `cosmos.gov.v1beta1.Vote` message has its `option` field (used for 1 vote option) deprecated in favor of its `options` field (allowing multiple vote options). Whenever possible, the SDK still populates the deprecated `option` field, that is, if and only if the `len(options) == 1` and `options[0].Weight == 1.0`. #### 4. Fields MUST NOT be renamed @@ -97,10 +97,10 @@ Whereas the official Protobuf recommendations do not prohibit renaming fields, a TODO, needs architecture review. Some topics: -- Bumping versions frequency -- When bumping versions, should the Cosmos SDK support both versions? - - i.e. v1beta1 -> v1, should we have two folders in the Cosmos SDK, and handlers for both versions? -- mention ADR-023 Protobuf naming +* Bumping versions frequency +* When bumping versions, should the Cosmos SDK support both versions? + * i.e. v1beta1 -> v1, should we have two folders in the Cosmos SDK, and handlers for both versions? +* mention ADR-023 Protobuf naming ## Consequences @@ -112,9 +112,9 @@ TODO, needs architecture review. Some topics: ### Positive -- less pain to tool developers -- more compatibility in the ecosystem -- ... +* less pain to tool developers +* more compatibility in the ecosystem +* ... ### Negative @@ -122,7 +122,7 @@ TODO, needs architecture review. Some topics: ### Neutral -- more rigor in Protobuf review +* more rigor in Protobuf review ## Further Discussions @@ -134,5 +134,5 @@ Test cases for an implementation are mandatory for ADRs that are affecting conse ## References -- [#9445](https://github.com/cosmos/cosmos-sdk/issues/9445) Release proto definitions v1 -- [#9446](https://github.com/cosmos/cosmos-sdk/issues/9446) Address v1beta1 proto breaking changes +* [#9445](https://github.com/cosmos/cosmos-sdk/issues/9445) Release proto definitions v1 +* [#9446](https://github.com/cosmos/cosmos-sdk/issues/9446) Address v1beta1 proto breaking changes diff --git a/docs/architecture/adr-045-check-delivertx-middlewares.md b/docs/architecture/adr-045-check-delivertx-middlewares.md index 7c5f84109ad0..b8c1ad3a7c62 100644 --- a/docs/architecture/adr-045-check-delivertx-middlewares.md +++ b/docs/architecture/adr-045-check-delivertx-middlewares.md @@ -2,8 +2,8 @@ ## Changelog -- 20.08.2021: Initial draft. -- 07.12.2021: Update `tx.Handler` interface ([\#10693](https://github.com/cosmos/cosmos-sdk/pull/10693)). +* 20.08.2021: Initial draft. +* 07.12.2021: Update `tx.Handler` interface ([\#10693](https://github.com/cosmos/cosmos-sdk/pull/10693)). ## Status @@ -186,7 +186,7 @@ While BaseApp simply holds a reference to a `tx.Handler`, this `tx.Handler` itse Then, the app developer can compose multiple middlewares on top on the base `tx.Handler`. Each middleware can run pre-and-post-processing logic around its next middleware, as described in the section above. Conceptually, as an example, given the middlewares `A`, `B`, and `C` and the base `tx.Handler` `H` the stack looks like: -``` +```text A.pre B.pre C.pre @@ -232,17 +232,17 @@ The middleware-based design builds upon the existing antehandlers design describ #### Similarities with Antehandlers -- Designed as chaining/composing small modular pieces. -- Allow code reuse for `{Check,Deliver}Tx` and for `Simulate`. -- Set up in `app.go`, and easily customizable by app developers. -- Order is important. +* Designed as chaining/composing small modular pieces. +* Allow code reuse for `{Check,Deliver}Tx` and for `Simulate`. +* Set up in `app.go`, and easily customizable by app developers. +* Order is important. #### Differences with Antehandlers -- The Antehandlers are run before `Msg` execution, whereas middlewares can run before and after. -- The middleware approach uses separate methods for `{Check,Deliver,Simulate}Tx`, whereas the antehandlers pass a `simulate bool` flag and uses the `sdkCtx.Is{Check,Recheck}Tx()` flags to determine in which transaction mode we are. -- The middleware design lets each middleware hold a reference to the next middleware, whereas the antehandlers pass a `next` argument in the `AnteHandle` method. -- The middleware design use Go's standard `context.Context`, whereas the antehandlers use `sdk.Context`. +* The Antehandlers are run before `Msg` execution, whereas middlewares can run before and after. +* The middleware approach uses separate methods for `{Check,Deliver,Simulate}Tx`, whereas the antehandlers pass a `simulate bool` flag and uses the `sdkCtx.Is{Check,Recheck}Tx()` flags to determine in which transaction mode we are. +* The middleware design lets each middleware hold a reference to the next middleware, whereas the antehandlers pass a `next` argument in the `AnteHandle` method. +* The middleware design use Go's standard `context.Context`, whereas the antehandlers use `sdk.Context`. ## Consequences @@ -281,14 +281,14 @@ This ADR does not introduce any state-machine-, client- or CLI-breaking changes. ### Positive -- Allow custom logic to be run before an after `Msg` execution. This enables the [tips](https://github.com/cosmos/cosmos-sdk/issues/9406) and [gas refund](https://github.com/cosmos/cosmos-sdk/issues/2150) uses cases, and possibly other ones. -- Make BaseApp more lightweight, and defer complex logic to small modular components. -- Separate paths for `{Check,Deliver,Simulate}Tx` with different returns types. This allows for improved readability (replace `if sdkCtx.IsRecheckTx() && !simulate {...}` with separate methods) and more flexibility (e.g. returning a `priority` in `ResponseCheckTx`). +* Allow custom logic to be run before an after `Msg` execution. This enables the [tips](https://github.com/cosmos/cosmos-sdk/issues/9406) and [gas refund](https://github.com/cosmos/cosmos-sdk/issues/2150) uses cases, and possibly other ones. +* Make BaseApp more lightweight, and defer complex logic to small modular components. +* Separate paths for `{Check,Deliver,Simulate}Tx` with different returns types. This allows for improved readability (replace `if sdkCtx.IsRecheckTx() && !simulate {...}` with separate methods) and more flexibility (e.g. returning a `priority` in `ResponseCheckTx`). ### Negative -- It is hard to understand at first glance the state updates that would occur after a middleware runs given the `sdk.Context` and `tx`. A middleware can have an arbitrary number of nested middleware being called within its function body, each possibly doing some pre- and post-processing before calling the next middleware on the chain. Thus to understand what a middleware is doing, one must also understand what every other middleware further along the chain is also doing, and the order of middlewares matters. This can get quite complicated to understand. -- API-breaking changes for app developers. +* It is hard to understand at first glance the state updates that would occur after a middleware runs given the `sdk.Context` and `tx`. A middleware can have an arbitrary number of nested middleware being called within its function body, each possibly doing some pre- and post-processing before calling the next middleware on the chain. Thus to understand what a middleware is doing, one must also understand what every other middleware further along the chain is also doing, and the order of middlewares matters. This can get quite complicated to understand. +* API-breaking changes for app developers. ### Neutral @@ -296,8 +296,8 @@ No neutral consequences. ## Further Discussions -- [#9934](https://github.com/cosmos/cosmos-sdk/discussions/9934) Decomposing BaseApp's other ABCI methods into middlewares. -- Replace `sdk.Tx` interface with the concrete protobuf Tx type in the `tx.Handler` methods signature. +* [#9934](https://github.com/cosmos/cosmos-sdk/discussions/9934) Decomposing BaseApp's other ABCI methods into middlewares. +* Replace `sdk.Tx` interface with the concrete protobuf Tx type in the `tx.Handler` methods signature. ## Test Cases @@ -307,5 +307,5 @@ For new middlewares, we introduce unit tests. Since middlewares are purposefully ## References -- Initial discussion: https://github.com/cosmos/cosmos-sdk/issues/9585 -- Implementation: [#9920 BaseApp refactor](https://github.com/cosmos/cosmos-sdk/pull/9920) and [#10028 Antehandlers migration](https://github.com/cosmos/cosmos-sdk/pull/10028) +* Initial discussion: +* Implementation: [#9920 BaseApp refactor](https://github.com/cosmos/cosmos-sdk/pull/9920) and [#10028 Antehandlers migration](https://github.com/cosmos/cosmos-sdk/pull/10028) diff --git a/docs/architecture/adr-046-module-params.md b/docs/architecture/adr-046-module-params.md index 520c79884e82..7c378adeee8d 100644 --- a/docs/architecture/adr-046-module-params.md +++ b/docs/architecture/adr-046-module-params.md @@ -2,7 +2,7 @@ ## Changelog -- Sep 22, 2021: Initial Draft +* Sep 22, 2021: Initial Draft ## Status @@ -156,20 +156,20 @@ module may be removed entirely in a future release. ### Positive -- Module parameters are serialized more efficiently -- Modules are able to react on parameters changes and perform additional actions. -- Special events can be emitted, allowing hooks to be triggered. +* Module parameters are serialized more efficiently +* Modules are able to react on parameters changes and perform additional actions. +* Special events can be emitted, allowing hooks to be triggered. ### Negative -- Module parameters becomes slightly more burdensome for module developers: - - Modules are now responsible for persisting and retrieving parameter state - - Modules are now required to have unique message handlers to handle parameter +* Module parameters becomes slightly more burdensome for module developers: + * Modules are now responsible for persisting and retrieving parameter state + * Modules are now required to have unique message handlers to handle parameter changes per unique parameter data structure. ### Neutral -- Requires [#9810](https://github.com/cosmos/cosmos-sdk/pull/9810) to be reviewed +* Requires [#9810](https://github.com/cosmos/cosmos-sdk/pull/9810) to be reviewed and merged. is used, this is used to parallelize go test instances, provide info to Github and slack integrations to provide information to your team on how the simulations are running. @@ -83,7 +82,7 @@ them to be used on the parameters. Now that all the required functions are defined, we need to integrate them into the module pattern within the `module.go`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.0/x/distribution/module.go ++++ ## App Simulator manager diff --git a/docs/building-modules/structure.md b/docs/building-modules/structure.md index 549cd634f75e..70885833fdcb 100644 --- a/docs/building-modules/structure.md +++ b/docs/building-modules/structure.md @@ -22,11 +22,11 @@ proto       └── tx.proto ``` -- `{module_name}.proto`: The module's common message type definitions. -- `event.proto`: The module's message type definitions related to events. -- `genesis.proto`: The module's message type definitions related to genesis state. -- `query.proto`: The module's Query service and related message type definitions. -- `tx.proto`: The module's Msg service and related message type definitions. +* `{module_name}.proto`: The module's common message type definitions. +* `event.proto`: The module's message type definitions related to events. +* `genesis.proto`: The module's message type definitions related to genesis state. +* `query.proto`: The module's Query service and related message type definitions. +* `tx.proto`: The module's Msg service and related message type definitions. ```shell x/{module_name} @@ -76,23 +76,23 @@ x/{module_name} └── tx.pb.go ``` -- `client/`: The module's CLI client functionality implementation and the module's integration testing suite. -- `exported/`: The module's exported types - typically interface types. If a module relies on keepers from another module, it is expected to receive the keepers as interface contracts through the `expected_keepers.go` file (see below) in order to avoid a direct dependency on the module implementing the keepers. However, these interface contracts can define methods that operate on and/or return types that are specific to the module that is implementing the keepers and this is where `exported/` comes into play. The interface types that are defined in `exported/` use canonical types, allowing for the module to receive the keepers as interface contracts through the `expected_keepers.go` file. This pattern allows for code to remain DRY and also alleviates import cycle chaos. -- `keeper/`: The module's `Keeper` and `MsgServer` implementation. -- `module/`: The module's `AppModule` and `AppModuleBasic` implementation. -- `simulation/`: The module's [simulation](./simulator.html) package defines functions used by the blockchain simulator application (`simapp`). -- `spec/`: The module's specification documents outlining important concepts, state storage structure, and message and event type definitions. -- The root directory includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. - - `abci.go`: The module's `BeginBlocker` and `EndBlocker` implementations (this file is only required if `BeginBlocker` and/or `EndBlocker` need to be defined). - - `codec.go`: The module's registry methods for interface types. - - `errors.go`: The module's sentinel errors. - - `events.go`: The module's event types and constructors. - - `expected_keepers.go`: The module's [expected keeper](./keeper.html#type-definition) interfaces. - - `genesis.go`: The module's genesis state methods and helper functions. - - `keys.go`: The module's store keys and associated helper functions. - - `msgs.go`: The module's message type definitions and associated methods. - - `params.go`: The module's parameter type definitions and associated methods. - - `*.pb.go`: The module's type definitions generated by Protocol Buffers (as defined in the respective `*.proto` files above). +* `client/`: The module's CLI client functionality implementation and the module's integration testing suite. +* `exported/`: The module's exported types - typically interface types. If a module relies on keepers from another module, it is expected to receive the keepers as interface contracts through the `expected_keepers.go` file (see below) in order to avoid a direct dependency on the module implementing the keepers. However, these interface contracts can define methods that operate on and/or return types that are specific to the module that is implementing the keepers and this is where `exported/` comes into play. The interface types that are defined in `exported/` use canonical types, allowing for the module to receive the keepers as interface contracts through the `expected_keepers.go` file. This pattern allows for code to remain DRY and also alleviates import cycle chaos. +* `keeper/`: The module's `Keeper` and `MsgServer` implementation. +* `module/`: The module's `AppModule` and `AppModuleBasic` implementation. +* `simulation/`: The module's [simulation](./simulator.html) package defines functions used by the blockchain simulator application (`simapp`). +* `spec/`: The module's specification documents outlining important concepts, state storage structure, and message and event type definitions. +* The root directory includes type definitions for messages, events, and genesis state, including the type definitions generated by Protocol Buffers. + * `abci.go`: The module's `BeginBlocker` and `EndBlocker` implementations (this file is only required if `BeginBlocker` and/or `EndBlocker` need to be defined). + * `codec.go`: The module's registry methods for interface types. + * `errors.go`: The module's sentinel errors. + * `events.go`: The module's event types and constructors. + * `expected_keepers.go`: The module's [expected keeper](./keeper.html#type-definition) interfaces. + * `genesis.go`: The module's genesis state methods and helper functions. + * `keys.go`: The module's store keys and associated helper functions. + * `msgs.go`: The module's message type definitions and associated methods. + * `params.go`: The module's parameter type definitions and associated methods. + * `*.pb.go`: The module's type definitions generated by Protocol Buffers (as defined in the respective `*.proto` files above). ## Next {hide} diff --git a/docs/building-modules/upgrade.md b/docs/building-modules/upgrade.md index 4879eb10b64e..720643f800af 100644 --- a/docs/building-modules/upgrade.md +++ b/docs/building-modules/upgrade.md @@ -8,14 +8,14 @@ order: 13 ## Prerequisite Readings -- [In-Place Store Migration](../core/upgrade.md) {prereq} +* [In-Place Store Migration](../core/upgrade.md) {prereq} ## Consensus Version Successful upgrades of existing modules require each `AppModule` to implement the function `ConsensusVersion() uint64`. -- The versions must be hard-coded by the module developer. -- The initial version **must** be set to 1. +* The versions must be hard-coded by the module developer. +* The initial version **must** be set to 1. Consensus versions serve as state-breaking versions of app modules and must be incremented when the module introduces breaking changes. @@ -41,7 +41,7 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { Since these migrations are functions that need access to a Keeper's store, use a wrapper around the keepers called `Migrator` as shown in this example: -+++ https://github.com/cosmos/cosmos-sdk/blob/6ac8898fec9bd7ea2c1e5c79e0ed0c3f827beb55/x/bank/keeper/migrations.go#L8-L21 ++++ ## Writing Migration Scripts diff --git a/docs/core/baseapp.md b/docs/core/baseapp.md index 74a01ce23571..94fbd1424ed6 100644 --- a/docs/core/baseapp.md +++ b/docs/core/baseapp.md @@ -8,16 +8,16 @@ This document describes `BaseApp`, the abstraction that implements the core func ## Pre-requisite Readings -- [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} -- [Lifecycle of a Cosmos SDK transaction](../basics/tx-lifecycle.md) {prereq} +* [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} +* [Lifecycle of a Cosmos SDK transaction](../basics/tx-lifecycle.md) {prereq} ## Introduction `BaseApp` is a base type that implements the core of a Cosmos SDK application, namely: -- The [Application Blockchain Interface](#abci), for the state-machine to communicate with the underlying consensus engine (e.g. Tendermint). -- [Service Routers](#service-routers), to route messages and queries to the appropriate module. -- Different [states](#states), as the state-machine can have different volatile states updated based on the ABCI message received. +* The [Application Blockchain Interface](#abci), for the state-machine to communicate with the underlying consensus engine (e.g. Tendermint). +* [Service Routers](#service-routers), to route messages and queries to the appropriate module. +* Different [states](#states), as the state-machine can have different volatile states updated based on the ABCI message received. The goal of `BaseApp` is to provide the fundamental layer of a Cosmos SDK application that developers can easily extend to build their own custom application. Usually, @@ -45,7 +45,7 @@ management logic. The `BaseApp` type holds many important parameters for any Cosmos SDK based application. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/baseapp/baseapp.go#L46-L131 ++++ Let us go through the most important components. @@ -54,50 +54,50 @@ Let us go through the most important components. First, the important parameters that are initialized during the bootstrapping of the application: -- [`CommitMultiStore`](./store.md#commitmultistore): This is the main store of the application, +* [`CommitMultiStore`](./store.md#commitmultistore): This is the main store of the application, which holds the canonical state that is committed at the [end of each block](#commit). This store is **not** cached, meaning it is not used to update the application's volatile (un-committed) states. The `CommitMultiStore` is a multi-store, meaning a store of stores. Each module of the application uses one or multiple `KVStores` in the multi-store to persist their subset of the state. -- Database: The `db` is used by the `CommitMultiStore` to handle data persistence. -- [`Msg` Service Router](#msg-service-router): The `msgServiceRouter` facilitates the routing of `sdk.Msg` requests to the appropriate +* Database: The `db` is used by the `CommitMultiStore` to handle data persistence. +* [`Msg` Service Router](#msg-service-router): The `msgServiceRouter` facilitates the routing of `sdk.Msg` requests to the appropriate module `Msg` service for processing. Here a `sdk.Msg` refers to the transaction component that needs to be processed by a service in order to update the application state, and not to ABCI message which implements the interface between the application and the underlying consensus engine. -- [gRPC Query Router](#grpc-query-router): The `grpcQueryRouter` facilitates the routing of gRPC queries to the +* [gRPC Query Router](#grpc-query-router): The `grpcQueryRouter` facilitates the routing of gRPC queries to the appropriate module for it to be processed. These queries are not ABCI messages themselves, but they are relayed to the relevant module's gRPC `Query` service. -- [`TxDecoder`](https://godoc.org/github.com/cosmos/cosmos-sdk/types#TxDecoder): It is used to decode +* [`TxDecoder`](https://godoc.org/github.com/cosmos/cosmos-sdk/types#TxDecoder): It is used to decode raw transaction bytes relayed by the underlying Tendermint engine. -- [`ParamStore`](#paramstore): The parameter store used to get and set application consensus parameters. -- [`AnteHandler`](#antehandler): This handler is used to handle signature verification, fee payment, +* [`ParamStore`](#paramstore): The parameter store used to get and set application consensus parameters. +* [`AnteHandler`](#antehandler): This handler is used to handle signature verification, fee payment, and other pre-message execution checks when a transaction is received. It's executed during [`CheckTx/RecheckTx`](#checktx) and [`DeliverTx`](#delivertx). -- [`InitChainer`](../basics/app-anatomy.md#initchainer), +* [`InitChainer`](../basics/app-anatomy.md#initchainer), [`BeginBlocker` and `EndBlocker`](../basics/app-anatomy.md#beginblocker-and-endblocker): These are the functions executed when the application receives the `InitChain`, `BeginBlock` and `EndBlock` ABCI messages from the underlying Tendermint engine. Then, parameters used to define [volatile states](#volatile-states) (i.e. cached states): -- `checkState`: This state is updated during [`CheckTx`](#checktx), and reset on [`Commit`](#commit). -- `deliverState`: This state is updated during [`DeliverTx`](#delivertx), and set to `nil` on +* `checkState`: This state is updated during [`CheckTx`](#checktx), and reset on [`Commit`](#commit). +* `deliverState`: This state is updated during [`DeliverTx`](#delivertx), and set to `nil` on [`Commit`](#commit) and gets re-initialized on BeginBlock. Finally, a few more important parameterd: -- `voteInfos`: This parameter carries the list of validators whose precommit is missing, either +* `voteInfos`: This parameter carries the list of validators whose precommit is missing, either because they did not vote or because the proposer did not include their vote. This information is carried by the [Context](#context) and can be used by the application for various things like punishing absent validators. -- `minGasPrices`: This parameter defines the minimum gas prices accepted by the node. This is a +* `minGasPrices`: This parameter defines the minimum gas prices accepted by the node. This is a **local** parameter, meaning each full-node can set a different `minGasPrices`. It is used in the `AnteHandler` during [`CheckTx`](#checktx), mainly as a spam protection mechanism. The transaction enters the [mempool](https://tendermint.com/docs/tendermint-core/mempool.html#transaction-ordering) only if the gas prices of the transaction are greater than one of the minimum gas price in `minGasPrices` (e.g. if `minGasPrices == 1uatom,1photon`, the `gas-price` of the transaction must be greater than `1uatom` OR `1photon`). -- `appVersion`: Version of the application. It is set in the +* `appVersion`: Version of the application. It is set in the [application's constructor function](../basics/app-anatomy.md#constructor-function). ## Constructor @@ -209,8 +209,8 @@ The [Application-Blockchain Interface](https://tendermint.com/docs/spec/abci/) ( The consensus engine handles two main tasks: -- The networking logic, which mainly consists in gossiping block parts, transactions and consensus votes. -- The consensus logic, which results in the deterministic ordering of transactions in the form of blocks. +* The networking logic, which mainly consists in gossiping block parts, transactions and consensus votes. +* The consensus logic, which results in the deterministic ordering of transactions in the form of blocks. It is **not** the role of the consensus engine to define the state or the validity of transactions. Generally, transactions are handled by the consensus engine in the form of `[]bytes`, and relayed to the application via the ABCI to be decoded and processed. At keys moments in the networking and consensus processes (e.g. beginning of a block, commit of a block, reception of an unconfirmed transaction, ...), the consensus engine emits ABCI messages for the state-machine to act on. @@ -257,15 +257,15 @@ is actually included in a block, because `checkState` never gets committed to th `CheckTx` returns a response to the underlying consensus engine of type [`abci.ResponseCheckTx`](https://tendermint.com/docs/spec/abci/abci.html#messages). The response contains: -- `Code (uint32)`: Response Code. `0` if successful. -- `Data ([]byte)`: Result bytes, if any. -- `Log (string):` The output of the application's logger. May be non-deterministic. -- `Info (string):` Additional information. May be non-deterministic. -- `GasWanted (int64)`: Amount of gas requested for transaction. It is provided by users when they generate the transaction. -- `GasUsed (int64)`: Amount of gas consumed by transaction. During `CheckTx`, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction. Next is an example: - +++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/x/auth/ante/basic.go#L104-L105 -- `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./events.md) for more. -- `Codespace (string)`: Namespace for the Code. +* `Code (uint32)`: Response Code. `0` if successful. +* `Data ([]byte)`: Result bytes, if any. +* `Log (string):` The output of the application's logger. May be non-deterministic. +* `Info (string):` Additional information. May be non-deterministic. +* `GasWanted (int64)`: Amount of gas requested for transaction. It is provided by users when they generate the transaction. +* `GasUsed (int64)`: Amount of gas consumed by transaction. During `CheckTx`, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction. Next is an example: + +++ +* `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./events.md) for more. +* `Codespace (string)`: Namespace for the Code. #### RecheckTx @@ -289,20 +289,20 @@ Before the first transaction of a given block is processed, a [volatile state](# During the additional fifth step outlined in (2), each read/write to the store increases the value of `GasConsumed`. You can find the default cost of each operation: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/store/types/gas.go#L164-L175 ++++ At any point, if `GasConsumed > GasWanted`, the function returns with `Code != 0` and `DeliverTx` fails. `DeliverTx` returns a response to the underlying consensus engine of type [`abci.ResponseDeliverTx`](https://tendermint.com/docs/spec/abci/abci.html#delivertx). The response contains: -- `Code (uint32)`: Response Code. `0` if successful. -- `Data ([]byte)`: Result bytes, if any. -- `Log (string):` The output of the application's logger. May be non-deterministic. -- `Info (string):` Additional information. May be non-deterministic. -- `GasWanted (int64)`: Amount of gas requested for transaction. It is provided by users when they generate the transaction. -- `GasUsed (int64)`: Amount of gas consumed by transaction. During `DeliverTx`, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction, and by adding gas each time a read/write to the store occurs. -- `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./events.md) for more. -- `Codespace (string)`: Namespace for the Code. +* `Code (uint32)`: Response Code. `0` if successful. +* `Data ([]byte)`: Result bytes, if any. +* `Log (string):` The output of the application's logger. May be non-deterministic. +* `Info (string):` Additional information. May be non-deterministic. +* `GasWanted (int64)`: Amount of gas requested for transaction. It is provided by users when they generate the transaction. +* `GasUsed (int64)`: Amount of gas consumed by transaction. During `DeliverTx`, this value is computed by multiplying the standard cost of a transaction byte by the size of the raw transaction, and by adding gas each time a read/write to the store occurs. +* `Events ([]cmn.KVPair)`: Key-Value tags for filtering and indexing transactions (eg. by account). See [`event`s](./events.md) for more. +* `Codespace (string)`: Namespace for the Code. ## RunTx, AnteHandler and RunMsgs @@ -316,7 +316,7 @@ After that, `RunTx()` calls `ValidateBasic()` on each `sdk.Msg`in the `Tx`, whic Then, the [`anteHandler`](#antehandler) of the application is run (if it exists). In preparation of this step, both the `checkState`/`deliverState`'s `context` and `context`'s `CacheMultiStore` are branched using the `cacheTxContext()` function. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/baseapp/baseapp.go#L623-L630 ++++ This allows `RunTx` not to commit the changes made to the state during the execution of `anteHandler` if it ends up failing. It also prevents the module implementing the `anteHandler` from writing to state, which is an important part of the [object-capabilities](./ocap.md) of the Cosmos SDK. @@ -326,13 +326,13 @@ Finally, the [`RunMsgs()`](#runmsgs) function is called to process the `sdk.Msg` The `AnteHandler` is a special handler that implements the `AnteHandler` interface and is used to authenticate the transaction before the transaction's internal messages are processed. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/types/handler.go#L6-L8 ++++ The `AnteHandler` is theoretically optional, but still a very important component of public blockchain networks. It serves 3 primary purposes: -- Be a primary line of defense against spam and second line of defense (the first one being the mempool) against transaction replay with fees deduction and [`sequence`](./transactions.md#transaction-generation) checking. -- Perform preliminary _stateful_ validity checks like ensuring signatures are valid or that the sender has enough funds to pay for fees. -- Play a role in the incentivisation of stakeholders via the collection of transaction fees. +* Be a primary line of defense against spam and second line of defense (the first one being the mempool) against transaction replay with fees deduction and [`sequence`](./transactions.md#transaction-generation) checking. +* Perform preliminary _stateful_ validity checks like ensuring signatures are valid or that the sender has enough funds to pay for fees. +* Play a role in the incentivisation of stakeholders via the collection of transaction fees. `BaseApp` holds an `anteHandler` as parameter that is initialized in the [application's constructor](../basics/app-anatomy.md#application-constructor). The most widely used `anteHandler` is the [`auth` module](https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/x/auth/ante/ante.go). @@ -350,9 +350,9 @@ First, it retrieves the `sdk.Msg`'s fully-qualified type name, by checking the ` The [`InitChain` ABCI message](https://tendermint.com/docs/app-dev/abci-spec.html#initchain) is sent from the underlying Tendermint engine when the chain is first started. It is mainly used to **initialize** parameters and state like: -- [Consensus Parameters](https://tendermint.com/docs/spec/abci/apps.html#consensus-parameters) via `setConsensusParams`. -- [`checkState` and `deliverState`](#volatile-states) via `setCheckState` and `setDeliverState`. -- The [block gas meter](../basics/gas-fees.md#block-gas-meter), with infinite gas to process genesis transactions. +* [Consensus Parameters](https://tendermint.com/docs/spec/abci/apps.html#consensus-parameters) via `setConsensusParams`. +* [`checkState` and `deliverState`](#volatile-states) via `setCheckState` and `setDeliverState`. +* The [block gas meter](../basics/gas-fees.md#block-gas-meter), with infinite gas to process genesis transactions. Finally, the `InitChain(req abci.RequestInitChain)` method of `BaseApp` calls the [`initChainer()`](../basics/app-anatomy.md#initchainer) of the application in order to initialize the main state of the application from the `genesis file` and, if defined, call the [`InitGenesis`](../building-modules/genesis.md#initgenesis) function of each of the application's modules. @@ -360,12 +360,12 @@ Finally, the `InitChain(req abci.RequestInitChain)` method of `BaseApp` calls th The [`BeginBlock` ABCI message](#https://tendermint.com/docs/app-dev/abci-spec.html#beginblock) is sent from the underlying Tendermint engine when a block proposal created by the correct proposer is received, before [`DeliverTx`](#delivertx) is run for each transaction in the block. It allows developers to have logic be executed at the beginning of each block. In the Cosmos SDK, the `BeginBlock(req abci.RequestBeginBlock)` method does the following: -- Initialize [`deliverState`](#volatile-states) with the latest header using the `req abci.RequestBeginBlock` passed as parameter via the `setDeliverState` function. - +++ https://github.com/cosmos/cosmos-sdk/blob/7d7821b9af132b0f6131640195326aa02b6751db/baseapp/baseapp.go#L387-L397 +* Initialize [`deliverState`](#volatile-states) with the latest header using the `req abci.RequestBeginBlock` passed as parameter via the `setDeliverState` function. + +++ This function also resets the [main gas meter](../basics/gas-fees.md#main-gas-meter). -- Initialize the [block gas meter](../basics/gas-fees.md#block-gas-meter) with the `maxGas` limit. The `gas` consumed within the block cannot go above `maxGas`. This parameter is defined in the application's consensus parameters. -- Run the application's [`beginBlocker()`](../basics/app-anatomy.md#beginblocker-and-endblock), which mainly runs the [`BeginBlocker()`](../building-modules/beginblock-endblock.md#beginblock) method of each of the application's modules. -- Set the [`VoteInfos`](https://tendermint.com/docs/app-dev/abci-spec.html#voteinfo) of the application, i.e. the list of validators whose _precommit_ for the previous block was included by the proposer of the current block. This information is carried into the [`Context`](./context.md) so that it can be used during `DeliverTx` and `EndBlock`. +* Initialize the [block gas meter](../basics/gas-fees.md#block-gas-meter) with the `maxGas` limit. The `gas` consumed within the block cannot go above `maxGas`. This parameter is defined in the application's consensus parameters. +* Run the application's [`beginBlocker()`](../basics/app-anatomy.md#beginblocker-and-endblock), which mainly runs the [`BeginBlocker()`](../building-modules/beginblock-endblock.md#beginblock) method of each of the application's modules. +* Set the [`VoteInfos`](https://tendermint.com/docs/app-dev/abci-spec.html#voteinfo) of the application, i.e. the list of validators whose _precommit_ for the previous block was included by the proposer of the current block. This information is carried into the [`Context`](./context.md) so that it can be used during `DeliverTx` and `EndBlock`. ### EndBlock @@ -389,10 +389,10 @@ The [`Query` ABCI message](https://tendermint.com/docs/app-dev/abci-spec.html#qu Each Tendermint `query` comes with a `path`, which is a `string` which denotes what to query. If the `path` matches a gRPC fully-qualified service method, then `BaseApp` will defer the query to the `grpcQueryRouter` and let it handle it like explained [above](#grpc-query-router). Otherwise, the `path` represents a query that is not (yet) handled by the gRPC router. `BaseApp` splits the `path` string with the `/` delimiter. By convention, the first element of the splitted string (`splitted[0]`) contains the category of `query` (`app`, `p2p`, `store` or `custom` ). The `BaseApp` implementation of the `Query(req abci.RequestQuery)` method is a simple dispatcher serving these 4 main categories of queries: -- Application-related queries like querying the application's version, which are served via the `handleQueryApp` method. -- Direct queries to the multistore, which are served by the `handlerQueryStore` method. These direct queries are different from custom queries which go through `app.queryRouter`, and are mainly used by third-party service provider like block explorers. -- P2P queries, which are served via the `handleQueryP2P` method. These queries return either `app.addrPeerFilter` or `app.ipPeerFilter` that contain the list of peers filtered by address or IP respectively. These lists are first initialized via `options` in `BaseApp`'s [constructor](#constructor). -- Custom queries, which encompass legacy queries (before the introduction of gRPC queries), are served via the `handleQueryCustom` method. The `handleQueryCustom` branches the multistore before using the `queryRoute` obtained from `app.queryRouter` to map the query to the appropriate module's [legacy `querier`](../building-modules/query-services.md#legacy-queriers). +* Application-related queries like querying the application's version, which are served via the `handleQueryApp` method. +* Direct queries to the multistore, which are served by the `handlerQueryStore` method. These direct queries are different from custom queries which go through `app.queryRouter`, and are mainly used by third-party service provider like block explorers. +* P2P queries, which are served via the `handleQueryP2P` method. These queries return either `app.addrPeerFilter` or `app.ipPeerFilter` that contain the list of peers filtered by address or IP respectively. These lists are first initialized via `options` in `BaseApp`'s [constructor](#constructor). +* Custom queries, which encompass legacy queries (before the introduction of gRPC queries), are served via the `handleQueryCustom` method. The `handleQueryCustom` branches the multistore before using the `queryRoute` obtained from `app.queryRouter` to map the query to the appropriate module's [legacy `querier`](../building-modules/query-services.md#legacy-queriers). ## Next {hide} diff --git a/docs/core/cli.md b/docs/core/cli.md index 00588c1f34d4..1c9c0c253880 100644 --- a/docs/core/cli.md +++ b/docs/core/cli.md @@ -20,10 +20,10 @@ simd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake --gas auto --gas-pr The first four strings specify the command: -- The root command for the entire application `simd`. -- The subcommand `tx`, which contains all commands that let users create transactions. -- The subcommand `bank` to indicate which module to route the command to ([`x/bank`](../../x/bank/spec/README.md) module in this case). -- The type of transaction `send`. +* The root command for the entire application `simd`. +* The subcommand `tx`, which contains all commands that let users create transactions. +* The subcommand `bank` to indicate which module to route the command to ([`x/bank`](../../x/bank/spec/README.md) module in this case). +* The type of transaction `send`. The next two strings are arguments: the `from_address` the user wishes to send from, the `to_address` of the recipient, and the `amount` they want to send. Finally, the last few strings of the command are optional flags to indicate how much the user is willing to pay in fees (calculated using the amount of gas used to execute the transaction and the gas prices provided by the user). @@ -33,14 +33,14 @@ The CLI interacts with a [node](../core/node.md) to handle this command. The int The `main.go` file needs to have a `main()` function that creates a root command, to which all the application commands will be added as subcommands. The root command additionally handles: -- **setting configurations** by reading in configuration files (e.g. the Cosmos SDK config file). -- **adding any flags** to it, such as `--chain-id`. -- **instantiating the `codec`** by calling the application's `MakeCodec()` function (called `MakeTestEncodingConfig` in `simapp`). The [`codec`](../core/encoding.md) is used to encode and decode data structures for the application - stores can only persist `[]byte`s so the developer must define a serialization format for their data structures or use the default, Protobuf. -- **adding subcommand** for all the possible user interactions, including [transaction commands](#transaction-commands) and [query commands](#query-commands). +* **setting configurations** by reading in configuration files (e.g. the Cosmos SDK config file). +* **adding any flags** to it, such as `--chain-id`. +* **instantiating the `codec`** by calling the application's `MakeCodec()` function (called `MakeTestEncodingConfig` in `simapp`). The [`codec`](../core/encoding.md) is used to encode and decode data structures for the application - stores can only persist `[]byte`s so the developer must define a serialization format for their data structures or use the default, Protobuf. +* **adding subcommand** for all the possible user interactions, including [transaction commands](#transaction-commands) and [query commands](#query-commands). The `main()` function finally creates an executor and [execute](https://godoc.org/github.com/spf13/cobra#Command.Execute) the root command. See an example of `main()` function from the `simapp` application: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/main.go#L12-L24 ++++ The rest of the document will detail what needs to be implemented for each step and include smaller portions of code from the `simapp` CLI files. @@ -52,25 +52,25 @@ Every application CLI first constructs a root command, then adds functionality b The root command (called `rootCmd`) is what the user first types into the command line to indicate which application they wish to interact with. The string used to invoke the command (the "Use" field) is typically the name of the application suffixed with `-d`, e.g. `simd` or `gaiad`. The root command typically includes the following commands to support basic functionality in the application. -- **Status** command from the Cosmos SDK rpc client tools, which prints information about the status of the connected [`Node`](../core/node.md). The Status of a node includes `NodeInfo`,`SyncInfo` and `ValidatorInfo`. -- **Keys** [commands](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/client/keys) from the Cosmos SDK client tools, which includes a collection of subcommands for using the key functions in the Cosmos SDK crypto tools, including adding a new key and saving it to the keyring, listing all public keys stored in the keyring, and deleting a key. For example, users can type `simd keys add ` to add a new key and save an encrypted copy to the keyring, using the flag `--recover` to recover a private key from a seed phrase or the flag `--multisig` to group multiple keys together to create a multisig key. For full details on the `add` key command, see the code [here](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/client/keys/add.go). For more details about usage of `--keyring-backend` for storage of key credentials look at the [keyring docs](../run-node/keyring.md). -- **Server** commands from the Cosmos SDK server package. These commands are responsible for providing the mechanisms necessary to start an ABCI Tendermint application and provides the CLI framework (based on [cobra](github.com/spf13/cobra)) necessary to fully bootstrap an application. The package exposes two core functions: `StartCmd` and `ExportCmd` which creates commands to start the application and export state respectively. Click [here](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/server) to learn more. -- [**Transaction**](#transaction-commands) commands. -- [**Query**](#query-commands) commands. +* **Status** command from the Cosmos SDK rpc client tools, which prints information about the status of the connected [`Node`](../core/node.md). The Status of a node includes `NodeInfo`,`SyncInfo` and `ValidatorInfo`. +* **Keys** [commands](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/client/keys) from the Cosmos SDK client tools, which includes a collection of subcommands for using the key functions in the Cosmos SDK crypto tools, including adding a new key and saving it to the keyring, listing all public keys stored in the keyring, and deleting a key. For example, users can type `simd keys add ` to add a new key and save an encrypted copy to the keyring, using the flag `--recover` to recover a private key from a seed phrase or the flag `--multisig` to group multiple keys together to create a multisig key. For full details on the `add` key command, see the code [here](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/client/keys/add.go). For more details about usage of `--keyring-backend` for storage of key credentials look at the [keyring docs](../run-node/keyring.md). +* **Server** commands from the Cosmos SDK server package. These commands are responsible for providing the mechanisms necessary to start an ABCI Tendermint application and provides the CLI framework (based on [cobra](github.com/spf13/cobra)) necessary to fully bootstrap an application. The package exposes two core functions: `StartCmd` and `ExportCmd` which creates commands to start the application and export state respectively. Click [here](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/server) to learn more. +* [**Transaction**](#transaction-commands) commands. +* [**Query**](#query-commands) commands. Next is an example `rootCmd` function from the `simapp` application. It instantiates the root command, adds a [_persistent_ flag](#flags) and `PreRun` function to be run before every execution, and adds all of the necessary subcommands. -+++ https://github.com/cosmos/cosmos-sdk/blob/4eea4cafd3b8b1c2cd493886db524500c9dd745c/simapp/simd/cmd/root.go#L37-L150 ++++ `rootCmd` has a function called `initAppConfig()` which is useful for setting the application's custom configs. By default app uses Tendermint app config template from Cosmos SDK, which can be over-written via `initAppConfig()`. Here's an example code to override default `app.toml` template. -+++ https://github.com/cosmos/cosmos-sdk/blob/4eea4cafd3b8b1c2cd493886db524500c9dd745c/simapp/simd/cmd/root.go#L84-L117 ++++ The `initAppConfig()` also allows overriding the default Cosmos SDK's [server config](https://github.com/cosmos/cosmos-sdk/blob/4eea4cafd3b8b1c2cd493886db524500c9dd745c/server/config/config.go#L199). One example is the `min-gas-prices` config, which defines the minimum gas prices a validator is willing to accept for processing a transaction. By default, the Cosmos SDK sets this parameter to `""` (empty string), which forces all validators to tweak their own `app.toml` and set a non-empty value, or else the node will halt on startup. This might not be the best UX for validators, so the chain developer can set a default `app.toml` value for validators inside this `initAppConfig()` function. -+++ https://github.com/cosmos/cosmos-sdk/blob/aa9b055ddb46aacd4737335a92d0b8a82d577341/simapp/simd/cmd/root.go#L101-L116 ++++ The root-level `status` and `keys` subcommands are common across most applications and do not interact with application state. The bulk of an application's functionality - what users can actually _do_ with it - is enabled by its `tx` and `query` commands. @@ -78,35 +78,35 @@ The root-level `status` and `keys` subcommands are common across most applicatio [Transactions](./transactions.md) are objects wrapping [`Msg`s](../building-modules/messages-and-queries.md#messages) that trigger state changes. To enable the creation of transactions using the CLI interface, a function `txCmd` is generally added to the `rootCmd`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L86-L92 ++++ This `txCmd` function adds all the transaction available to end-users for the application. This typically includes: -- **Sign command** from the [`auth`](../../x/auth/spec/README.md) module that signs messages in a transaction. To enable multisig, add the `auth` module's `MultiSign` command. Since every transaction requires some sort of signature in order to be valid, the signing command is necessary for every application. -- **Broadcast command** from the Cosmos SDK client tools, to broadcast transactions. -- **All [module transaction commands](../building-modules/module-interfaces.md#transaction-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/module-manager.md#basic-manager) `AddTxCommands()` function. +* **Sign command** from the [`auth`](../../x/auth/spec/README.md) module that signs messages in a transaction. To enable multisig, add the `auth` module's `MultiSign` command. Since every transaction requires some sort of signature in order to be valid, the signing command is necessary for every application. +* **Broadcast command** from the Cosmos SDK client tools, to broadcast transactions. +* **All [module transaction commands](../building-modules/module-interfaces.md#transaction-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/module-manager.md#basic-manager) `AddTxCommands()` function. Here is an example of a `txCmd` aggregating these subcommands from the `simapp` application: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L123-L149 ++++ ### Query Commands [**Queries**](../building-modules/messages-and-queries.md#queries) are objects that allow users to retrieve information about the application's state. To enable the creation of transactions using the CLI interface, a function `txCmd` is generally added to the `rootCmd`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L86-L92 ++++ This `queryCmd` function adds all the queries available to end-users for the application. This typically includes: -- **QueryTx** and/or other transaction query commands] from the `auth` module which allow the user to search for a transaction by inputting its hash, a list of tags, or a block height. These queries allow users to see if transactions have been included in a block. -- **Account command** from the `auth` module, which displays the state (e.g. account balance) of an account given an address. -- **Validator command** from the Cosmos SDK rpc client tools, which displays the validator set of a given height. -- **Block command** from the Cosmos SDK rpc client tools, which displays the block data for a given height. -- **All [module query commands](../building-modules/module-interfaces.md#query-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/module-manager.md#basic-manager) `AddQueryCommands()` function. +* **QueryTx** and/or other transaction query commands] from the `auth` module which allow the user to search for a transaction by inputting its hash, a list of tags, or a block height. These queries allow users to see if transactions have been included in a block. +* **Account command** from the `auth` module, which displays the state (e.g. account balance) of an account given an address. +* **Validator command** from the Cosmos SDK rpc client tools, which displays the validator set of a given height. +* **Block command** from the Cosmos SDK rpc client tools, which displays the block data for a given height. +* **All [module query commands](../building-modules/module-interfaces.md#query-commands)** the application is dependent on, retrieved by using the [basic module manager's](../building-modules/module-manager.md#basic-manager) `AddQueryCommands()` function. Here is an example of a `queryCmd` aggregating subcommands from the `simapp` application: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L99-L121 ++++ ## Flags @@ -116,7 +116,7 @@ A _persistent_ flag (as opposed to a _local_ flag) added to a command transcends Flags are added to commands directly (generally in the [module's CLI file](../building-modules/module-interfaces.md#flags) where module commands are defined) and no flag except for the `rootCmd` persistent flags has to be added at application level. It is common to add a _persistent_ flag for `--chain-id`, the unique identifier of the blockchain the application pertains to, to the root command. Adding this flag can be done in the `main()` function. Adding this flag makes sense as the chain ID should not be changing across commands in this application CLI. Here is an example from the `simapp` application: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L118-L119 ++++ ## Environment variables @@ -145,7 +145,7 @@ It is vital that the root command of an application uses `PersistentPreRun()` co Here is an example of an `PersistentPreRun()` function from `simapp``: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/simapp/simd/cmd/root.go#L54-L60 ++++ The `SetCmdClientContextHandler` call reads persistent flags via `ReadPersistentCommandFlags` which creates a `client.Context` and sets that on the root command's `Context`. diff --git a/docs/core/context.md b/docs/core/context.md index bf61374a77f9..6fd2977af5e8 100644 --- a/docs/core/context.md +++ b/docs/core/context.md @@ -8,27 +8,27 @@ The `context` is a data structure intended to be passed from function to functio ## Pre-requisites Readings -- [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} -- [Lifecycle of a Transaction](../basics/tx-lifecycle.md) {prereq} +* [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} +* [Lifecycle of a Transaction](../basics/tx-lifecycle.md) {prereq} ## Context Definition The Cosmos SDK `Context` is a custom data structure that contains Go's stdlib [`context`](https://golang.org/pkg/context) as its base, and has many additional types within its definition that are specific to the Cosmos SDK. The `Context` is integral to transaction processing in that it allows modules to easily access their respective [store](./store.md#base-layer-kvstores) in the [`multistore`](./store.md#multistore) and retrieve transactional context such as the block header and gas meter. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/types/context.go#L16-L39 - -- **Context:** The base type is a Go [Context](https://golang.org/pkg/context), which is explained further in the [Go Context Package](#go-context-package) section below. -- **Multistore:** Every application's `BaseApp` contains a [`CommitMultiStore`](./store.md#multistore) which is provided when a `Context` is created. Calling the `KVStore()` and `TransientStore()` methods allows modules to fetch their respective [`KVStore`](./store.md#base-layer-kvstores) using their unique `StoreKey`. -- **ABCI Header:** The [header](https://tendermint.com/docs/spec/abci/abci.html#header) is an ABCI type. It carries important information about the state of the blockchain, such as block height and proposer of the current block. -- **Chain ID:** The unique identification number of the blockchain a block pertains to. -- **Transaction Bytes:** The `[]byte` representation of a transaction being processed using the context. Every transaction is processed by various parts of the Cosmos SDK and consensus engine (e.g. Tendermint) throughout its [lifecycle](../basics/tx-lifecycle.md), some of which to not have any understanding of transaction types. Thus, transactions are marshaled into the generic `[]byte` type using some kind of [encoding format](./encoding.md) such as [Amino](./encoding.md). -- **Logger:** A `logger` from the Tendermint libraries. Learn more about logs [here](https://tendermint.com/docs/tendermint-core/how-to-read-logs.html#how-to-read-logs). Modules call this method to create their own unique module-specific logger. -- **VoteInfo:** A list of the ABCI type [`VoteInfo`](https://tendermint.com/docs/spec/abci/abci.html#voteinfo), which includes the name of a validator and a boolean indicating whether they have signed the block. -- **Gas Meters:** Specifically, a [`gasMeter`](../basics/gas-fees.md#main-gas-meter) for the transaction currently being processed using the context and a [`blockGasMeter`](../basics/gas-fees.md#block-gas-meter) for the entire block it belongs to. Users specify how much in fees they wish to pay for the execution of their transaction; these gas meters keep track of how much [gas](../basics/gas-fees.md) has been used in the transaction or block so far. If the gas meter runs out, execution halts. -- **CheckTx Mode:** A boolean value indicating whether a transaction should be processed in `CheckTx` or `DeliverTx` mode. -- **Min Gas Price:** The minimum [gas](../basics/gas-fees.md) price a node is willing to take in order to include a transaction in its block. This price is a local value configured by each node individually, and should therefore **not be used in any functions used in sequences leading to state-transitions**. -- **Consensus Params:** The ABCI type [Consensus Parameters](https://tendermint.com/docs/spec/abci/apps.html#consensus-parameters), which specify certain limits for the blockchain, such as maximum gas for a block. -- **Event Manager:** The event manager allows any caller with access to a `Context` to emit [`Events`](./events.md). Modules may define module specific ++++ + +* **Context:** The base type is a Go [Context](https://golang.org/pkg/context), which is explained further in the [Go Context Package](#go-context-package) section below. +* **Multistore:** Every application's `BaseApp` contains a [`CommitMultiStore`](./store.md#multistore) which is provided when a `Context` is created. Calling the `KVStore()` and `TransientStore()` methods allows modules to fetch their respective [`KVStore`](./store.md#base-layer-kvstores) using their unique `StoreKey`. +* **ABCI Header:** The [header](https://tendermint.com/docs/spec/abci/abci.html#header) is an ABCI type. It carries important information about the state of the blockchain, such as block height and proposer of the current block. +* **Chain ID:** The unique identification number of the blockchain a block pertains to. +* **Transaction Bytes:** The `[]byte` representation of a transaction being processed using the context. Every transaction is processed by various parts of the Cosmos SDK and consensus engine (e.g. Tendermint) throughout its [lifecycle](../basics/tx-lifecycle.md), some of which to not have any understanding of transaction types. Thus, transactions are marshaled into the generic `[]byte` type using some kind of [encoding format](./encoding.md) such as [Amino](./encoding.md). +* **Logger:** A `logger` from the Tendermint libraries. Learn more about logs [here](https://tendermint.com/docs/tendermint-core/how-to-read-logs.html#how-to-read-logs). Modules call this method to create their own unique module-specific logger. +* **VoteInfo:** A list of the ABCI type [`VoteInfo`](https://tendermint.com/docs/spec/abci/abci.html#voteinfo), which includes the name of a validator and a boolean indicating whether they have signed the block. +* **Gas Meters:** Specifically, a [`gasMeter`](../basics/gas-fees.md#main-gas-meter) for the transaction currently being processed using the context and a [`blockGasMeter`](../basics/gas-fees.md#block-gas-meter) for the entire block it belongs to. Users specify how much in fees they wish to pay for the execution of their transaction; these gas meters keep track of how much [gas](../basics/gas-fees.md) has been used in the transaction or block so far. If the gas meter runs out, execution halts. +* **CheckTx Mode:** A boolean value indicating whether a transaction should be processed in `CheckTx` or `DeliverTx` mode. +* **Min Gas Price:** The minimum [gas](../basics/gas-fees.md) price a node is willing to take in order to include a transaction in its block. This price is a local value configured by each node individually, and should therefore **not be used in any functions used in sequences leading to state-transitions**. +* **Consensus Params:** The ABCI type [Consensus Parameters](https://tendermint.com/docs/spec/abci/apps.html#consensus-parameters), which specify certain limits for the blockchain, such as maximum gas for a block. +* **Event Manager:** The event manager allows any caller with access to a `Context` to emit [`Events`](./events.md). Modules may define module specific `Events` by defining various `Types` and `Attributes` or use the common definitions found in `types/`. Clients can subscribe or query for these `Events`. These `Events` are collected throughout `DeliverTx`, `BeginBlock`, and `EndBlock` and are returned to Tendermint for indexing. For example: ```go diff --git a/docs/core/encoding.md b/docs/core/encoding.md index 21255acd39f4..106117630120 100644 --- a/docs/core/encoding.md +++ b/docs/core/encoding.md @@ -8,7 +8,7 @@ While encoding in the Cosmos SDK used to be mainly handled by `go-amino` codec, ## Pre-requisite Readings -- [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} +* [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} ## Encoding @@ -75,10 +75,10 @@ Modules are encouraged to utilize Protobuf encoding for their respective types. In addition to [following official Protocol Buffer guidelines](https://developers.google.com/protocol-buffers/docs/proto3#simple), we recommend using these annotations in .proto files when dealing with interfaces: -- use `cosmos_proto.accepts_interface` to annote fields that accept interfaces -- pass the same fully qualified name as `protoName` to `InterfaceRegistry.RegisterInterface` -- annotate interface implementations with `cosmos_proto.implements_interface` -- pass the same fully qualified name as `protoName` to `InterfaceRegistry.RegisterInterface` +* use `cosmos_proto.accepts_interface` to annote fields that accept interfaces +* pass the same fully qualified name as `protoName` to `InterfaceRegistry.RegisterInterface` +* annotate interface implementations with `cosmos_proto.implements_interface` +* pass the same fully qualified name as `protoName` to `InterfaceRegistry.RegisterInterface` ### Transaction Encoding @@ -88,16 +88,16 @@ the Cosmos SDK but are then passed to the underlying consensus engine to be rela other peers. Since the underlying consensus engine is agnostic to the application, the consensus engine accepts only transactions in the form of raw bytes. -- The `TxEncoder` object performs the encoding. -- The `TxDecoder` object performs the decoding. +* The `TxEncoder` object performs the encoding. +* The `TxDecoder` object performs the decoding. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/types/tx_msg.go#L83-L87 ++++ A standard implementation of both these objects can be found in the [`auth` module](../../x/auth/spec/README.md): -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/x/auth/tx/decoder.go ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/x/auth/tx/encoder.go ++++ See [ADR-020](../architecture/adr-020-protobuf-transaction-encoding.md) for details of how a transaction is encoded. @@ -116,7 +116,7 @@ message Profile { In this `Profile` example, we hardcoded `account` as a `BaseAccount`. However, there are several other types of [user accounts related to vesting](../../x/auth/spec/05_vesting.md), such as `BaseVestingAccount` or `ContinuousVestingAccount`. All of these accounts are different, but they all implement the `AccountI` interface. How would you create a `Profile` that allows all these types of accounts with an `account` field that accepts an `AccountI` interface? -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/x/auth/types/account.go#L307-L330 ++++ In [ADR-019](../architecture/adr-019-protobuf-state-encoding.md), it has been decided to use [`Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto)s to encode interfaces in protobuf. An `Any` contains an arbitrary serialized message as bytes, along with a URL that acts as a globally unique identifier for and resolves to that message's type. This strategy allows us to pack arbitrary Go types inside protobuf messages. Our new `Profile` then looks like: @@ -193,36 +193,36 @@ For more information about interface encoding, and especially on `UnpackInterfac The above `Profile` example is a fictive example used for educational purposes. In the Cosmos SDK, we use `Any` encoding in several places (non-exhaustive list): -- the `cryptotypes.PubKey` interface for encoding different types of public keys, -- the `sdk.Msg` interface for encoding different `Msg`s in a transaction, -- the `AccountI` interface for encodinig different types of accounts (similar to the above example) in the x/auth query responses, -- the `Evidencei` interface for encoding different types of evidences in the x/evidence module, -- the `AuthorizationI` interface for encoding different types of x/authz authorizations, -- the [`Validator`](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/x/staking/types/staking.pb.go#L306-L337) struct that contains information about a validator. +* the `cryptotypes.PubKey` interface for encoding different types of public keys, +* the `sdk.Msg` interface for encoding different `Msg`s in a transaction, +* the `AccountI` interface for encodinig different types of accounts (similar to the above example) in the x/auth query responses, +* the `Evidencei` interface for encoding different types of evidences in the x/evidence module, +* the `AuthorizationI` interface for encoding different types of x/authz authorizations, +* the [`Validator`](https://github.com/cosmos/cosmos-sdk/blob/v0.42.5/x/staking/types/staking.pb.go#L306-L337) struct that contains information about a validator. A real-life example of encoding the pubkey as `Any` inside the Validator struct in x/staking is shown in the following example: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/x/staking/types/validator.go#L40-L61 ++++ ## FAQ -1. How to create modules using protobuf encoding? +### How to create modules using protobuf encoding -**Defining module types** +#### Defining module types Protobuf types can be defined to encode: -- state -- [`Msg`s](../building-modules/messages-and-queries.md#messages) -- [Query services](../building-modules/query-services.md) -- [genesis](../building-modules/genesis.md) +* state +* [`Msg`s](../building-modules/messages-and-queries.md#messages) +* [Query services](../building-modules/query-services.md) +* [genesis](../building-modules/genesis.md) -**Naming and conventions** +#### Naming and conventions We encourage developers to follow industry guidelines: [Protocol Buffers style guide](https://developers.google.com/protocol-buffers/docs/style) and [Buf](https://buf.build/docs/style-guide), see more details in [ADR 023](../architecture/adr-023-protobuf-naming.md) -2. How to update modules to protobuf encoding? +### How to update modules to protobuf encoding If modules do not contain any interfaces (e.g. `Account` or `Content`), then they may simply migrate any existing types that @@ -246,7 +246,7 @@ The Cosmos SDK `codec.Codec` interface provides support methods `MarshalInterfac Module should register interfaces using `InterfaceRegistry` which provides a mechanism for registering interfaces: `RegisterInterface(protoName string, iface interface{})` and implementations: `RegisterImplementations(iface interface{}, impls ...proto.Message)` that can be safely unpacked from Any, similarly to type registration with Amino: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc4/codec/types/interface_registry.go#L25-L66 ++++ In addition, an `UnpackInterfaces` phase should be introduced to deserialization to unpack interfaces before they're needed. Protobuf types that contain a protobuf `Any` either directly or via one of their members should implement the `UnpackInterfacesMessage` interface: diff --git a/docs/core/events.md b/docs/core/events.md index 389b6c42620b..3769cf9955b0 100644 --- a/docs/core/events.md +++ b/docs/core/events.md @@ -8,20 +8,20 @@ order: 9 ## Pre-requisite Readings -- [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} -- [Tendermint Documentation on Events](https://docs.tendermint.com/master/spec/abci/abci.html#events) {prereq} +* [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} +* [Tendermint Documentation on Events](https://docs.tendermint.com/master/spec/abci/abci.html#events) {prereq} ## Events Events are implemented in the Cosmos SDK as an alias of the ABCI `Event` type and take the form of: `{eventType}.{attributeKey}={attributeValue}`. -+++ https://github.com/tendermint/tendermint/blob/v0.34.8/proto/tendermint/abci/types.proto#L304-L313 ++++ An Event contains: -- A `type` to categorize the Event at a high-level; for example, the Cosmos SDK uses the `"message"` type to filter Events by `Msg`s. -- A list of `attributes` are key-value pairs that give more information about the categorized Event. For example, for the `"message"` type, we can filter Events by key-value pairs using `message.action={some_action}`, `message.module={some_module}` or `message.sender={some_sender}`. +* A `type` to categorize the Event at a high-level; for example, the Cosmos SDK uses the `"message"` type to filter Events by `Msg`s. +* A list of `attributes` are key-value pairs that give more information about the categorized Event. For example, for the `"message"` type, we can filter Events by key-value pairs using `message.action={some_action}`, `message.module={some_module}` or `message.sender={some_sender}`. ::: tip To parse the attribute values as strings, make sure to add `'` (single quotes) around each attribute value. @@ -34,10 +34,10 @@ by using the [`EventManager`](#eventmanager). In addition, each module documents Events are returned to the underlying consensus engine in the response of the following ABCI messages: -- [`BeginBlock`](./baseapp.md#beginblock) -- [`EndBlock`](./baseapp.md#endblock) -- [`CheckTx`](./baseapp.md#checktx) -- [`DeliverTx`](./baseapp.md#delivertx) +* [`BeginBlock`](./baseapp.md#beginblock) +* [`EndBlock`](./baseapp.md#endblock) +* [`CheckTx`](./baseapp.md#checktx) +* [`DeliverTx`](./baseapp.md#delivertx) ### Examples @@ -57,13 +57,13 @@ In Cosmos SDK applications, Events are managed by an abstraction called the `Eve Internally, the `EventManager` tracks a list of Events for the entire execution flow of a transaction or `BeginBlock`/`EndBlock`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/types/events.go#L17-L25 ++++ The `EventManager` comes with a set of useful methods to manage Events. The method that is used most by module and application developers is `EmitEvent` that tracks an Event in the `EventManager`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/types/events.go#L33-L37 ++++ Module developers should handle Event emission via the `EventManager#EmitEvent` in each message `Handler` and in each `BeginBlock`/`EndBlock` handler. The `EventManager` is accessed via @@ -104,9 +104,9 @@ You can use Tendermint's [Websocket](https://docs.tendermint.com/master/tendermi The main `eventCategory` you can subscribe to are: -- `NewBlock`: Contains Events triggered during `BeginBlock` and `EndBlock`. -- `Tx`: Contains Events triggered during `DeliverTx` (i.e. transaction processing). -- `ValidatorSetUpdates`: Contains validator set updates for the block. +* `NewBlock`: Contains Events triggered during `BeginBlock` and `EndBlock`. +* `Tx`: Contains Events triggered during `DeliverTx` (i.e. transaction processing). +* `ValidatorSetUpdates`: Contains validator set updates for the block. These Events are triggered from the `state` package after a block is committed. You can get the full list of Event categories [on the Tendermint Godoc page](https://godoc.org/github.com/tendermint/tendermint/types#pkg-constants). diff --git a/docs/core/grpc_rest.md b/docs/core/grpc_rest.md index 71c105b07e59..5fb4c78ef5ed 100644 --- a/docs/core/grpc_rest.md +++ b/docs/core/grpc_rest.md @@ -10,9 +10,9 @@ This document presents an overview of all the endpoints a node exposes: gRPC, RE Each node exposes the following endpoints for users to interact with a node, each endpoint is served on a different port. Details on how to configure each endpoint is provided in the endpoint's own section. -- the gRPC server (default port: `9090`), -- the REST server (default port: `1317`), -- the Tendermint RPC endpoint (default port: `26657`). +* the gRPC server (default port: `9090`), +* the REST server (default port: `1317`), +* the Tendermint RPC endpoint (default port: `26657`). ::: tip The node also exposes some other endpoints, such as the Tendermint P2P endpoint, or the [Prometheus endpoint](https://docs.tendermint.com/master/nodes/metrics.html#metrics), which are not directly related to the Cosmos SDK. Please refer to the [Tendermint documentation](https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#configuration) for more information about these endpoints. @@ -25,7 +25,7 @@ A patch introduced in `go-grpc v1.34.0` made gRPC incompatible with the `gogopro To make sure that gRPC is working properly, it is **highly recommended** to add the following line in your application's `go.mod`: -``` +```go replace google.golang.org/grpc => google.golang.org/grpc v1.33.2 ``` @@ -36,14 +36,14 @@ Cosmos SDK v0.40 introduced Protobuf as the main [encoding](./encoding) library, Each module exposes a [Protobuf `Query` service](../building-modules/messages-and-queries.md#queries) that defines state queries. The `Query` services and a transaction service used to broadcast transactions are hooked up to the gRPC server via the following function inside the application: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-rc0/server/types/app.go#L39-L41 ++++ Note: It is not possible to expose any [Protobuf `Msg` service](../building-modules/messages-and-queries.md#messages) endpoints via gRPC. Transactions must be generated and signed using the CLI or programmatically before they can be broadcasted using gRPC. See [Generating, Signing, and Broadcasting Transactions](../run-node/txs.html) for more information. The `grpc.Server` is a concrete gRPC server, which spawns and serves all gRPC query requests and a broadcast transaction request. This server can be configured inside `~/.simapp/config/app.toml`: -- `grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`. -- `grpc.address = {string}` field defines the address (really, the port, since the host should be kept at `0.0.0.0`) the server should bind to. Defaults to `0.0.0.0:9090`. +* `grpc.enable = true|false` field defines if the gRPC server should be enabled. Defaults to `true`. +* `grpc.address = {string}` field defines the address (really, the port, since the host should be kept at `0.0.0.0`) the server should bind to. Defaults to `0.0.0.0:9090`. :::tip `~/.simapp` is the directory where the node's configuration and databases are stored. By default, it's set to `~/.{app_name}`. @@ -59,9 +59,9 @@ Cosmos SDK supports REST routes via gRPC-gateway. All routes are configured under the following fields in `~/.simapp/config/app.toml`: -- `api.enable = true|false` field defines if the REST server should be enabled. Defaults to `false`. -- `api.address = {string}` field defines the address (really, the port, since the host should be kept at `0.0.0.0`) the server should bind to. Defaults to `tcp://0.0.0.0:1317`. -- some additional API configuration options are defined in `~/.simapp/config/app.toml`, along with comments, please refer to that file directly. +* `api.enable = true|false` field defines if the REST server should be enabled. Defaults to `false`. +* `api.address = {string}` field defines the address (really, the port, since the host should be kept at `0.0.0.0`) the server should bind to. Defaults to `tcp://0.0.0.0:1317`. +* some additional API configuration options are defined in `~/.simapp/config/app.toml`, along with comments, please refer to that file directly. ### gRPC-gateway REST Routes @@ -69,7 +69,7 @@ If, for various reasons, you cannot use gRPC (for example, you are building a we [gRPC-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) is a tool to expose gRPC endpoints as REST endpoints. For each gRPC endpoint defined in a Protobuf `Query` service, the Cosmos SDK offers a REST equivalent. For instance, querying a balance could be done via the `/cosmos.bank.v1beta1.QueryAllBalances` gRPC endpoint, or alternatively via the gRPC-gateway `"/cosmos/bank/v1beta1/balances/{address}"` REST endpoint: both will return the same result. For each RPC method defined in a Protobuf `Query` service, the corresponding REST endpoint is defined as an option: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.41.0/proto/cosmos/bank/v1beta1/query.proto#L19-L22 ++++ For application developers, gRPC-gateway REST routes needs to be wired up to the REST server, this is done by calling the `RegisterGRPCGatewayRoutes` function on the ModuleManager. @@ -87,14 +87,14 @@ Independently from the Cosmos SDK, Tendermint also exposes a RPC server. This RP Some Tendermint RPC endpoints are directly related to the Cosmos SDK: -- `/abci_query`: this endpoint will query the application for state. As the `path` parameter, you can send the following strings: - - any Protobuf fully-qualified service method, such as `/cosmos.bank.v1beta1.QueryAllBalances`. The `data` field should then include the method's request parameter(s) encoded as bytes using Protobuf. - - `/app/simulate`: this will simulate a transaction, and return some information such as gas used. - - `/app/version`: this will return the application's version. - - `/store/{path}`: this will query the store directly. - - `/p2p/filter/addr/{port}`: this will return a filtered list of the node's P2P peers by address port. - - `/p2p/filter/id/{id}`: this will return a filtered list of the node's P2P peers by ID. -- `/broadcast_tx_{aync,async,commit}`: these 3 endpoint will broadcast a transaction to other peers. CLI, gRPC and REST expose [a way to broadcast transations](./transactions.md#broadcasting-the-transaction), but they all use these 3 Tendermint RPCs under the hood. +* `/abci_query`: this endpoint will query the application for state. As the `path` parameter, you can send the following strings: + * any Protobuf fully-qualified service method, such as `/cosmos.bank.v1beta1.QueryAllBalances`. The `data` field should then include the method's request parameter(s) encoded as bytes using Protobuf. + * `/app/simulate`: this will simulate a transaction, and return some information such as gas used. + * `/app/version`: this will return the application's version. + * `/store/{path}`: this will query the store directly. + * `/p2p/filter/addr/{port}`: this will return a filtered list of the node's P2P peers by address port. + * `/p2p/filter/id/{id}`: this will return a filtered list of the node's P2P peers by ID. +* `/broadcast_tx_{aync,async,commit}`: these 3 endpoint will broadcast a transaction to other peers. CLI, gRPC and REST expose [a way to broadcast transations](./transactions.md#broadcasting-the-transaction), but they all use these 3 Tendermint RPCs under the hood. ## Comparison Table diff --git a/docs/core/node.md b/docs/core/node.md index 81e637d3b110..b7790eac0b6e 100644 --- a/docs/core/node.md +++ b/docs/core/node.md @@ -8,7 +8,7 @@ The main endpoint of a Cosmos SDK application is the daemon client, otherwise kn ## Pre-requisite Readings -- [Anatomy of an SDK application](../basics/app-anatomy.md) {prereq} +* [Anatomy of an SDK application](../basics/app-anatomy.md) {prereq} ## `main` function @@ -16,17 +16,17 @@ The full-node client of any Cosmos SDK application is built by running a `main` In general, developers will implement the `main.go` function with the following structure: -- First, an [`appCodec`](./encoding.md) is instantiated for the application. -- Then, the `config` is retrieved and config parameters are set. This mainly involves setting the Bech32 prefixes for [addresses](../basics/accounts.md#addresses). - +++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/types/config.go#L13-L24 -- Using [cobra](https://github.com/spf13/cobra), the root command of the full-node client is created. After that, all the custom commands of the application are added using the `AddCommand()` method of `rootCmd`. -- Add default server commands to `rootCmd` using the `server.AddCommands()` method. These commands are separated from the ones added above since they are standard and defined at Cosmos SDK level. They should be shared by all Cosmos SDK-based applications. They include the most important command: the [`start` command](#start-command). -- Prepare and execute the `executor`. - +++ https://github.com/tendermint/tendermint/blob/v0.34.0-rc6/libs/cli/setup.go#L74-L78 +* First, an [`appCodec`](./encoding.md) is instantiated for the application. +* Then, the `config` is retrieved and config parameters are set. This mainly involves setting the Bech32 prefixes for [addresses](../basics/accounts.md#addresses). + +++ +* Using [cobra](https://github.com/spf13/cobra), the root command of the full-node client is created. After that, all the custom commands of the application are added using the `AddCommand()` method of `rootCmd`. +* Add default server commands to `rootCmd` using the `server.AddCommands()` method. These commands are separated from the ones added above since they are standard and defined at Cosmos SDK level. They should be shared by all Cosmos SDK-based applications. They include the most important command: the [`start` command](#start-command). +* Prepare and execute the `executor`. + +++ See an example of `main` function from the `simapp` application, the Cosmos SDK's application for demo purposes: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/simapp/simd/main.go ++++ ## `start` command @@ -46,24 +46,24 @@ The flow of the `start` command is pretty straightforward. First, it retrieves t With the `db`, the `start` command creates a new instance of the application using an `appCreator` function: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/server/start.go#L227-L228 ++++ Note that an `appCreator` is a function that fulfills the `AppCreator` signature: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/server/types/app.go#L48-L50 ++++ In practice, the [constructor of the application](../basics/app-anatomy.md#constructor-function) is passed as the `appCreator`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/simapp/simd/cmd/root.go#L170-L215 ++++ Then, the instance of `app` is used to instanciate a new Tendermint node: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/server/start.go#L235-L244 ++++ The Tendermint node can be created with `app` because the latter satisfies the [`abci.Application` interface](https://github.com/tendermint/tendermint/blob/v0.34.0/abci/types/application.go#L7-L32) (given that `app` extends [`baseapp`](./baseapp.md)). As part of the `NewNode` method, Tendermint makes sure that the height of the application (i.e. number of blocks since genesis) is equal to the height of the Tendermint node. The difference between these two heights should always be negative or null. If it is strictly negative, `NewNode` will replay blocks until the height of the application reaches the height of the Tendermint node. Finally, if the height of the application is `0`, the Tendermint node will call [`InitChain`](./baseapp.md#initchain) on the application to initialize the state from the genesis file. Once the Tendermint node is instanciated and in sync with the application, the node can be started: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/server/start.go#L250-L252 ++++ Upon starting, the node will bootstrap its RPC and P2P server and start dialing peers. During handshake with its peers, if the node realizes they are ahead, it will query all the blocks sequentially in order to catch up. Then, it will wait for new block proposals and block signatures from validators in order to make progress. diff --git a/docs/core/ocap.md b/docs/core/ocap.md index a365fd106ec2..0c21095f3bb3 100644 --- a/docs/core/ocap.md +++ b/docs/core/ocap.md @@ -68,7 +68,7 @@ sumValue := externalModule.ComputeSumValue(*account) In the Cosmos SDK, you can see the application of this principle in the gaia app. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.41.4/simapp/app.go#L249-L273 ++++ The following diagram shows the current dependencies between keepers. diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index a38dba786b1f..b8cc6f6d9a3a 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -1,6 +1,7 @@ + # Protobuf Documentation This file has been replaced by [Cosmos-SDK Buf Proto-docs](https://buf.build/cosmos/cosmos-sdk/docs/main) diff --git a/docs/core/runtx_middleware.md b/docs/core/runtx_middleware.md index ab028d6dffc9..86c2f7e2f4c6 100644 --- a/docs/core/runtx_middleware.md +++ b/docs/core/runtx_middleware.md @@ -22,8 +22,8 @@ type RecoveryHandler func(recoveryObj interface{}) error **Contract:** -- RecoveryHandler returns `nil` if `recoveryObj` wasn't handled and should be passed to the next recovery middleware; -- RecoveryHandler returns a non-nil `error` if `recoveryObj` was handled; +* RecoveryHandler returns `nil` if `recoveryObj` wasn't handled and should be passed to the next recovery middleware; +* RecoveryHandler returns a non-nil `error` if `recoveryObj` was handled; ## Custom RecoveryHandler register diff --git a/docs/core/simulation.md b/docs/core/simulation.md index 7bb271b883ac..586cc1ed58e9 100644 --- a/docs/core/simulation.md +++ b/docs/core/simulation.md @@ -30,14 +30,14 @@ provided operations (randomized or not). The simulation app has different commands, each of which tests a different failure type: -- `AppImportExport`: The simulator exports the initial app state and then it +* `AppImportExport`: The simulator exports the initial app state and then it creates a new app with the exported `genesis.json` as an input, checking for inconsistencies between the stores. -- `AppSimulationAfterImport`: Queues two simulations together. The first one provides the app state (_i.e_ genesis) to the second. Useful to test software upgrades or hard-forks from a live chain. -- `AppStateDeterminism`: Checks that all the nodes return the same values, in the same order. -- `BenchmarkInvariants`: Analysis of the performance of running all modules' invariants (_i.e_ sequentially runs a [benchmark](https://golang.org/pkg/testing/#hdr-Benchmarks) test). An invariant checks for +* `AppSimulationAfterImport`: Queues two simulations together. The first one provides the app state (_i.e_ genesis) to the second. Useful to test software upgrades or hard-forks from a live chain. +* `AppStateDeterminism`: Checks that all the nodes return the same values, in the same order. +* `BenchmarkInvariants`: Analysis of the performance of running all modules' invariants (_i.e_ sequentially runs a [benchmark](https://golang.org/pkg/testing/#hdr-Benchmarks) test). An invariant checks for differences between the values that are on the store and the passive tracker. Eg: total coins held by accounts vs total supply tracker. -- `FullAppSimulation`: General simulation mode. Runs the chain and the specified operations for a given number of blocks. Tests that there're no `panics` on the simulation. It does also run invariant checks on every `Period` but they are not benchmarked. +* `FullAppSimulation`: General simulation mode. Runs the chain and the specified operations for a given number of blocks. Tests that there're no `panics` on the simulation. It does also run invariant checks on every `Period` but they are not benchmarked. Each simulation must receive a set of inputs (_i.e_ flags) such as the number of blocks that the simulation is run, seed, block size, etc. @@ -76,26 +76,26 @@ check the Cosmos SDK [Makefile](https://github.com/cosmos/cosmos-sdk/blob/v0.40. Here are some suggestions when encountering a simulation failure: -- Export the app state at the height were the failure was found. You can do this +* Export the app state at the height were the failure was found. You can do this by passing the `-ExportStatePath` flag to the simulator. -- Use `-Verbose` logs. They could give you a better hint on all the operations +* Use `-Verbose` logs. They could give you a better hint on all the operations involved. -- Reduce the simulation `-Period`. This will run the invariants checks more +* Reduce the simulation `-Period`. This will run the invariants checks more frequently. -- Print all the failed invariants at once with `-PrintAllInvariants`. -- Try using another `-Seed`. If it can reproduce the same error and if it fails +* Print all the failed invariants at once with `-PrintAllInvariants`. +* Try using another `-Seed`. If it can reproduce the same error and if it fails sooner you will spend less time running the simulations. -- Reduce the `-NumBlocks` . How's the app state at the height previous to the +* Reduce the `-NumBlocks` . How's the app state at the height previous to the failure? -- Run invariants on every operation with `-SimulateEveryOperation`. _Note_: this +* Run invariants on every operation with `-SimulateEveryOperation`. _Note_: this will slow down your simulation **a lot**. -- Try adding logs to operations that are not logged. You will have to define a +* Try adding logs to operations that are not logged. You will have to define a [Logger](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/x/staking/keeper/keeper.go#L66-L69) on your `Keeper`. ## Use simulation in your Cosmos SDK-based application Learn how you can integrate the simulation into your Cosmos SDK-based application: -- Application Simulation Manager -- [Building modules: Simulator](../building-modules/simulator.md) -- Simulator tests +* Application Simulation Manager +* [Building modules: Simulator](../building-modules/simulator.md) +* Simulator tests diff --git a/docs/core/store.md b/docs/core/store.md index bc0975a22de2..95c83822d6b1 100644 --- a/docs/core/store.md +++ b/docs/core/store.md @@ -8,13 +8,13 @@ A store is a data structure that holds the state of the application. {synopsis} ## Pre-requisite Readings -- [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} +* [Anatomy of a Cosmos SDK application](../basics/app-anatomy.md) {prereq} ## Introduction to Cosmos SDK Stores The Cosmos SDK comes with a large set of stores to persist the state of applications. By default, the main store of Cosmos SDK applications is a `multistore`, i.e. a store of stores. Developers can add any number of key-value stores to the multistore, depending on their application needs. The multistore exists to support the modularity of the Cosmos SDK, as it lets each module declare and manage their own subset of the state. Key-value stores in the multistore can only be accessed with a specific capability `key`, which is typically held in the [`keeper`](../building-modules/keeper.md) of the module that declared the store. -``` +```text +-----------------------------------------------------+ | | | +--------------------------------------------+ | @@ -58,11 +58,11 @@ The Cosmos SDK comes with a large set of stores to persist the state of applicat At its very core, a Cosmos SDK `store` is an object that holds a `CacheWrapper` and has a `GetStoreType()` method: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L15-L18 ++++ The `GetStoreType` is a simple method that returns the type of store, whereas a `CacheWrapper` is a simple interface that implements store read caching and write branching through `Write` method: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L240-L264 ++++ Branching and cache is used ubiquitously in the Cosmos SDK and required to be implemented on every store type. A storage branch creates an isolated, ephemeral branch of a store that can be passed around and updated without affecting the main underlying store. This is used to trigger temporary state-transitions that may be reverted later should an error occur. Read more about it in [context](./context.md#Store-branching) @@ -70,11 +70,11 @@ Branching and cache is used ubiquitously in the Cosmos SDK and required to be im A commit store is a store that has the ability to commit changes made to the underlying tree or db. The Cosmos SDK differentiates simple stores from commit stores by extending the basic store interfaces with a `Committer`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L29-L33 ++++ The `Committer` is an interface that defines methods to persist changes to disk: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L20-L27 ++++ The `CommitID` is a deterministic commit of the state tree. Its hash is returned to the underlying consensus engine and stored in the block header. Note that commit store interfaces exist for various purposes, one of which is to make sure not every object can commit the store. As part of the [object-capabilities model](./ocap.md) of the Cosmos SDK, only `baseapp` should have the ability to commit stores. For example, this is the reason why the `ctx.KVStore()` method by which modules typically access stores returns a `KVStore` and not a `CommitKVStore`. @@ -86,7 +86,7 @@ The Cosmos SDK comes with many types of stores, the most used being [`CommitMult Each Cosmos SDK application holds a multistore at its root to persist its state. The multistore is a store of `KVStores` that follows the `Multistore` interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L104-L133 ++++ If tracing is enabled, then branching the multistore will firstly wrap all the underlying `KVStore` in [`TraceKv.Store`](#tracekv-store). @@ -94,11 +94,11 @@ If tracing is enabled, then branching the multistore will firstly wrap all the u The main type of `Multistore` used in the Cosmos SDK is `CommitMultiStore`, which is an extension of the `Multistore` interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L141-L184 ++++ As for concrete implementation, the [`rootMulti.Store`] is the go-to implementation of the `CommitMultiStore` interface. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/rootmulti/store.go#L43-L61 ++++ The `rootMulti.Store` is a base-layer multistore built around a `db` on top of which multiple `KVStores` can be mounted, and is the default multistore store used in [`baseapp`](./baseapp.md). @@ -106,7 +106,7 @@ The `rootMulti.Store` is a base-layer multistore built around a `db` on top of w Whenever the `rootMulti.Store` needs to be branched, a [`cachemulti.Store`](https://github.com/cosmos/cosmos-sdk/blob/v0.42.1/store/cachemulti/store.go) is used. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/cachemulti/store.go#L17-L28 ++++ `cachemulti.Store` branches all substores (creates a virtual store for each substore) in its constructor and hold them in `Store.stores`. Moreover caches all read queries. `Store.GetKVStore()` returns the store from `Store.stores`, and `Store.Write()` recursively calls `CacheWrap.Write()` on all the substores. @@ -120,23 +120,23 @@ Individual `KVStore`s are used by modules to manage a subset of the global state `CommitKVStore`s are declared by proxy of their respective `key` and mounted on the application's [multistore](#multistore) in the [main application file](../basics/app-anatomy.md#core-application-file). In the same file, the `key` is also passed to the module's `keeper` that is responsible for managing the store. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/store.go#L189-L219 ++++ Apart from the traditional `Get` and `Set` methods, a `KVStore` must provide an `Iterator(start, end)` method which returns an `Iterator` object. It is used to iterate over a range of keys, typically keys that share a common prefix. Below is an example from the bank's module keeper, used to iterate over all account balances: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/x/bank/keeper/view.go#L115-L134 ++++ ### `IAVL` Store The default implementation of `KVStore` and `CommitKVStore` used in `baseapp` is the `iavl.Store`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/iavl/store.go#L37-L40 ++++ `iavl` stores are based around an [IAVL Tree](https://github.com/tendermint/iavl), a self-balancing binary tree which guarantees that: -- `Get` and `Set` operations are O(log n), where n is the number of elements in the tree. -- Iteration efficiently returns the sorted elements within the range. -- Each tree version is immutable and can be retrieved even after a commit (depending on the pruning settings). +* `Get` and `Set` operations are O(log n), where n is the number of elements in the tree. +* Iteration efficiently returns the sorted elements within the range. +* Each tree version is immutable and can be retrieved even after a commit (depending on the pruning settings). The documentation on the IAVL Tree is located [here](https://github.com/cosmos/iavl/blob/v0.15.0-rc5/docs/overview.md). @@ -144,7 +144,7 @@ The documentation on the IAVL Tree is located [here](https://github.com/cosmos/i `dbadapter.Store` is a adapter for `dbm.DB` making it fulfilling the `KVStore` interface. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/dbadapter/store.go#L13-L16 ++++ `dbadapter.Store` embeds `dbm.DB`, meaning most of the `KVStore` interface functions are implemented. The other functions (mostly miscellaneous) are manually implemented. This store is primarily used within [Transient Stores](#transient-stores) @@ -152,17 +152,17 @@ The documentation on the IAVL Tree is located [here](https://github.com/cosmos/i `Transient.Store` is a base-layer `KVStore` which is automatically discarded at the end of the block. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/transient/store.go#L13-L16 ++++ `Transient.Store` is a `dbadapter.Store` with a `dbm.NewMemDB()`. All `KVStore` methods are reused. When `Store.Commit()` is called, a new `dbadapter.Store` is assigned, discarding previous reference and making it garbage collected. This type of store is useful to persist information that is only relevant per-block. One example would be to store parameter changes (i.e. a bool set to `true` if a parameter changed in a block). -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/x/params/types/subspace.go#L20-L30 ++++ Transient stores are typically accessed via the [`context`](./context.md) via the `TransientStore()` method: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/types/context.go#L232-L235 ++++ ## KVStore Wrappers @@ -170,7 +170,7 @@ Transient stores are typically accessed via the [`context`](./context.md) via th `cachekv.Store` is a wrapper `KVStore` which provides buffered writing / cached reading functionalities over the underlying `KVStore`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/cachekv/store.go#L27-L34 ++++ This is the type used whenever an IAVL Store needs to be branched to create an isolated store (typically when we need to mutate a state that might be reverted later). @@ -190,25 +190,25 @@ This is the type used whenever an IAVL Store needs to be branched to create an i Cosmos SDK applications use [`gas`](../basics/gas-fees.md) to track resources usage and prevent spam. [`GasKv.Store`](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/gaskv/store.go) is a `KVStore` wrapper that enables automatic gas consumption each time a read or write to the store is made. It is the solution of choice to track storage usage in Cosmos SDK applications. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/gaskv/store.go#L13-L19 ++++ When methods of the parent `KVStore` are called, `GasKv.Store` automatically consumes appropriate amount of gas depending on the `Store.gasConfig`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/gas.go#L153-L162 ++++ By default, all `KVStores` are wrapped in `GasKv.Stores` when retrieved. This is done in the `KVStore()` method of the [`context`](./context.md): -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/types/context.go#L227-L230 ++++ In this case, the default gas configuration is used: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/types/gas.go#L164-L175 ++++ ### `TraceKv` Store `tracekv.Store` is a wrapper `KVStore` which provides operation tracing functionalities over the underlying `KVStore`. It is applied automatically by the Cosmos SDK on all `KVStore` if tracing is enabled on the parent `MultiStore`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/tracekv/store.go#L20-L43 ++++ When each `KVStore` methods are called, `tracekv.Store` automatically logs `traceOperation` to the `Store.writer`. `traceOperation.Metadata` is filled with `Store.context` when it is not nil. `TraceContext` is a `map[string]interface{}`. @@ -216,7 +216,7 @@ When each `KVStore` methods are called, `tracekv.Store` automatically logs `trac `prefix.Store` is a wrapper `KVStore` which provides automatic key-prefixing functionalities over the underlying `KVStore`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/store/prefix/store.go#L15-L21 ++++ When `Store.{Get, Set}()` is called, the store forwards the call to its parent, with the key prefixed with the `Store.prefix`. @@ -228,7 +228,7 @@ When `Store.Iterator()` is called, it does not simply prefix the `Store.prefix`, It is applied automatically by the Cosmos SDK on any `KVStore` whose `StoreKey` is specified during state streaming configuration. Additional information about state streaming configuration can be found in the [store/streaming/README.md](../../store/streaming/README.md). -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.44.1/store/listenkv/store.go#L11-L18 ++++ When `KVStore.Set` or `KVStore.Delete` methods are called, `listenkv.Store` automatically writes the operations to the set of `Store.listeners`. @@ -247,16 +247,18 @@ An interface providing only the basic CRUD functionality (`Get`, `Set`, `Has`, a ## MultiStore This is the new interface (or, set of interfaces) for the main client store, replacing the role of `store/types.MultiStore` (v1). There are a few significant differences in behavior compared with v1: - * Commits are atomic and are performed on the entire store state; individual substores cannot be committed separately and cannot have different version numbers. - * The store's current version and version history track that of the backing `db.DBConnection`. Past versions are accessible read-only. - * The set of valid substores is defined at initialization and cannot be updated dynamically in an existing store instance. + +* Commits are atomic and are performed on the entire store state; individual substores cannot be committed separately and cannot have different version numbers. +* The store's current version and version history track that of the backing `db.DBConnection`. Past versions are accessible read-only. +* The set of valid substores is defined at initialization and cannot be updated dynamically in an existing store instance. ### `CommitMultiStore` This is the main interface for persisent application state, analogous to the original `CommitMultiStore`. - * Past version views are accessed with `GetVersion`, which returns a `BasicMultiStore`. - * Substores are accessed with `GetKVStore`. Trying to get a substore that was not defined at initialization will cause a panic. - * `Close` must be called to release the DB resources being used by the store. + +* Past version views are accessed with `GetVersion`, which returns a `BasicMultiStore`. +* Substores are accessed with `GetKVStore`. Trying to get a substore that was not defined at initialization will cause a panic. +* `Close` must be called to release the DB resources being used by the store. ### `BasicMultiStore` diff --git a/docs/core/transactions.md b/docs/core/transactions.md index 23e337a388f4..034f1de24da3 100644 --- a/docs/core/transactions.md +++ b/docs/core/transactions.md @@ -8,7 +8,7 @@ order: 2 ## Pre-requisite Readings -- [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} +* [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} ## Transactions @@ -20,12 +20,12 @@ When users want to interact with an application and make state changes (e.g. sen Transaction objects are Cosmos SDK types that implement the `Tx` interface -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/types/tx_msg.go#L49-L57 ++++ It contains the following methods: -- **GetMsgs:** unwraps the transaction and returns a list of contained `sdk.Msg`s - one transaction may have one or multiple messages, which are defined by module developers. -- **ValidateBasic:** lightweight, [_stateless_](../basics/tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./baseapp.md#checktx) and [`DeliverTx`](./baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth) module's `StdTx` `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed what the user's maximum. Note that this function is to be distinct from `sdk.Msg` [`ValidateBasic`](../basics/tx-lifecycle.md#ValidateBasic) methods, which perform basic validity checks on messages only. When [`runTx`](./baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth/spec) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. +* **GetMsgs:** unwraps the transaction and returns a list of contained `sdk.Msg`s - one transaction may have one or multiple messages, which are defined by module developers. +* **ValidateBasic:** lightweight, [_stateless_](../basics/tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./baseapp.md#checktx) and [`DeliverTx`](./baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth) module's `StdTx` `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed what the user's maximum. Note that this function is to be distinct from `sdk.Msg` [`ValidateBasic`](../basics/tx-lifecycle.md#ValidateBasic) methods, which perform basic validity checks on messages only. When [`runTx`](./baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/master/x/auth/spec) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. As a developer, you should rarely manipulate `Tx` directly, as `Tx` is really an intermediate type used for transaction generation. Instead, developers should prefer the `TxBuilder` interface, which you can learn more about [below](#transaction-generation). @@ -37,11 +37,11 @@ Every message in a transaction must be signed by the addresses specified by its The most used implementation of the `Tx` interface is the Protobuf `Tx` message, which is used in `SIGN_MODE_DIRECT`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/proto/cosmos/tx/v1beta1/tx.proto#L12-L25 ++++ Because Protobuf serialization is not deterministic, the Cosmos SDK uses an additional `TxRaw` type to denote the pinned bytes over which a transaction is signed. Any user can generate a valid `body` and `auth_info` for a transaction, and serialize these two messages using Protobuf. `TxRaw` then pins the user's exact binary representation of `body` and `auth_info`, called respectively `body_bytes` and `auth_info_bytes`. The document that is signed by all signers of the transaction is `SignDoc` (deterministically serialized using [ADR-027](../architecture/adr-027-deterministic-protobuf-serialization.md)): -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/proto/cosmos/tx/v1beta1/tx.proto#L47-L64 ++++ Once signed by all signers, the `body_bytes`, `auth_info_bytes` and `signatures` are gathered into `TxRaw`, whose serialized bytes are broadcasted over the network. @@ -49,11 +49,11 @@ Once signed by all signers, the `body_bytes`, `auth_info_bytes` and `signatures` The legacy implemention of the `Tx` interface is the `StdTx` struct from `x/auth`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/auth/legacy/legacytx/stdtx.go#L120-L130 ++++ The document signed by all signers is `StdSignDoc`: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/auth/legacy/legacytx/stdsign.go#L20-L33 ++++ which is encoded into bytes using Amino JSON. Once all signatures are gathered into `StdTx`, `StdTx` is serialized using Amino JSON, and these bytes are broadcasted over the network. @@ -65,9 +65,9 @@ Other sign modes, most notably `SIGN_MODE_TEXTUAL`, are being discussed. If you The process of an end-user sending a transaction is: -- decide on the messages to put into the transaction, -- generate the transaction using the Cosmos SDK's `TxBuilder`, -- broadcast the transaction using one of the available interfaces. +* decide on the messages to put into the transaction, +* generate the transaction using the Cosmos SDK's `TxBuilder`, +* broadcast the transaction using one of the available interfaces. The next paragraphs will describe each of these components, in this order. @@ -90,23 +90,23 @@ While messages contain the information for state transition logic, a transaction The `TxBuilder` interface contains data closely related with the generation of transactions, which an end-user can freely set to generate the desired transaction: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/client/tx_config.go#L32-L45 ++++ -- `Msg`s, the array of [messages](#messages) included in the transaction. -- `GasLimit`, option chosen by the users for how to calculate how much gas they will need to pay. -- `Memo`, a note or comment to send with the transaction. -- `FeeAmount`, the maximum amount the user is willing to pay in fees. -- `TimeoutHeight`, block height until which the transaction is valid. -- `Signatures`, the array of signatures from all signers of the transaction. +* `Msg`s, the array of [messages](#messages) included in the transaction. +* `GasLimit`, option chosen by the users for how to calculate how much gas they will need to pay. +* `Memo`, a note or comment to send with the transaction. +* `FeeAmount`, the maximum amount the user is willing to pay in fees. +* `TimeoutHeight`, block height until which the transaction is valid. +* `Signatures`, the array of signatures from all signers of the transaction. As there are currently two sign modes for signing transactions, there are also two implementations of `TxBuilder`: -- [wrapper](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/auth/tx/builder.go#L19-L33) for creating transactions for `SIGN_MODE_DIRECT`, -- [StdTxBuilder](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/auth/legacy/legacytx/stdtx_builder.go#L14-L20) for `SIGN_MODE_LEGACY_AMINO_JSON`. +* [wrapper](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/auth/tx/builder.go#L19-L33) for creating transactions for `SIGN_MODE_DIRECT`, +* [StdTxBuilder](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/x/auth/legacy/legacytx/stdtx_builder.go#L14-L20) for `SIGN_MODE_LEGACY_AMINO_JSON`. However, the two implementation of `TxBuilder` should be hidden away from end-users, as they should prefer using the overarching `TxConfig` interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/client/tx_config.go#L21-L30 ++++ `TxConfig` is an app-wide configuration for managing transactions. Most importantly, it holds the information about whether to sign each transaction with `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`. By calling `txBuilder := txConfig.NewTxBuilder()`, a new `TxBuilder` will be created with the appropriate sign mode. @@ -138,7 +138,7 @@ simd tx send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake [gRPC](https://grpc.io) is introduced in Cosmos SDK 0.40 as the main component for the Cosmos SDK's RPC layer. The principal usage of gRPC is in the context of modules' [`Query` services](../building-modules). However, the Cosmos SDK also exposes a few other module-agnostic gRPC services, one of them being the `Tx` service: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc3/proto/cosmos/tx/v1beta1/service.proto ++++ The `Tx` service exposes a handful of utility functions, such as simulating a transaction or querying a transaction, and also one method to broadcast transactions. diff --git a/docs/core/upgrade.md b/docs/core/upgrade.md index 2782785e75cd..2495bc515ee1 100644 --- a/docs/core/upgrade.md +++ b/docs/core/upgrade.md @@ -12,9 +12,9 @@ Upgrade your app modules smoothly with custom in-place store migration logic. {s The Cosmos SDK uses two methods to perform upgrades. -- Exporting the entire application state to a JSON file using the `export` CLI command, making changes, and then starting a new binary with the changed JSON file as the genesis file. See [Chain Upgrade Guide to v0.42](https://docs.cosmos.network/v0.42/migrations/chain-upgrade-guide-040.html). +* Exporting the entire application state to a JSON file using the `export` CLI command, making changes, and then starting a new binary with the changed JSON file as the genesis file. See [Chain Upgrade Guide to v0.42](https://docs.cosmos.network/v0.42/migrations/chain-upgrade-guide-040.html). -- Version v0.44 and later can perform upgrades in place to significantly decrease the upgrade time for chains with a larger state. Use the [Module Upgrade Guide](../building-modules/upgrade.md) to set up your application modules to take advantage of in-place upgrades. +* Version v0.44 and later can perform upgrades in place to significantly decrease the upgrade time for chains with a larger state. Use the [Module Upgrade Guide](../building-modules/upgrade.md) to set up your application modules to take advantage of in-place upgrades. This document provides steps to use the In-Place Store Migrations upgrade method. diff --git a/docs/ibc/custom.md b/docs/ibc/custom.md index 36de3085cc72..1a5e0e306d2a 100644 --- a/docs/ibc/custom.md +++ b/docs/ibc/custom.md @@ -23,8 +23,8 @@ module correctly. ## Pre-requisites Readings -- [IBC Overview](./overview.md)) {prereq} -- [IBC default integration](./integration.md) {prereq} +* [IBC Overview](./overview.md)) {prereq} +* [IBC default integration](./integration.md) {prereq} ## Create a custom IBC application module diff --git a/docs/ibc/integration.md b/docs/ibc/integration.md index 04f1cc4a718e..f35da72fc23e 100644 --- a/docs/ibc/integration.md +++ b/docs/ibc/integration.md @@ -14,13 +14,13 @@ send fungible token transfers to other chains. Integrating the IBC module to your Cosmos SDK-based application is straighforward. The general changes can be summarized in the following steps: -- Add required modules to the `module.BasicManager` -- Define additional `Keeper` fields for the new modules on the `App` type -- Add the module's `StoreKeys` and initialize their `Keepers` -- Set up corresponding routers and routes for the `ibc` and `evidence` modules -- Add the modules to the module `Manager` -- Add modules to `Begin/EndBlockers` and `InitGenesis` -- Update the module `SimulationManager` to enable simulations +* Add required modules to the `module.BasicManager` +* Define additional `Keeper` fields for the new modules on the `App` type +* Add the module's `StoreKeys` and initialize their `Keepers` +* Set up corresponding routers and routes for the `ibc` and `evidence` modules +* Add the modules to the module `Manager` +* Add modules to `Begin/EndBlockers` and `InitGenesis` +* Update the module `SimulationManager` to enable simulations ### Module `BasicManager` and `ModuleAccount` permissions diff --git a/docs/ibc/overview.md b/docs/ibc/overview.md index 4108421943cc..1fb9ee43fabf 100644 --- a/docs/ibc/overview.md +++ b/docs/ibc/overview.md @@ -6,7 +6,7 @@ order: 1 Learn what IBC is, its components, and use cases. {synopsis} -## What is the Inter-Blockchain Communication Protocol (IBC)? +## What is the Inter-Blockchain Communication Protocol (IBC) The Inter-Blockchain Communication protocol (IBC) allows blockchains to talk to each other. The backbone of the Cosmos ecosystem, IBC handles transport across different sovereign blockchains. This end-to-end, connection-oriented, stateful protocol provides reliable, ordered, and authenticated communication between heterogeneous blockchains. @@ -18,13 +18,13 @@ The abstraction layer details on channels and ports are relevant for app develop The following requirements must be met for a module to interact over IBC: -- Bind to one or more ports +* Bind to one or more ports -- Define the packet data +* Define the packet data -- Define optional acknowledgement structures and methods to encode and decode them +* Define optional acknowledgement structures and methods to encode and decode them -- Implement the IBCModule interface +* Implement the IBCModule interface ## Components Overview @@ -34,9 +34,9 @@ This section describes the IBC components and links to the repos. IBC clients are light clients that are identified by a unique client id. IBC clients track the consensus states of other blockchains and the proof specs of those blockchains that are required to properly verify proofs against the client's consensus state. A client can be associated with any number of connections to multiple chains. The supported IBC clients are: -- [Solo Machine light client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/06-solomachine): devices such as phones, browsers, or laptops. -- [Tendermint light client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/07-tendermint): The default for Cosmos SDK-based chains. -- [Localhost (loopback) client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/09-localhost): Useful for testing, simulation, and relaying packets to modules on the same application. +* [Solo Machine light client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/06-solomachine): devices such as phones, browsers, or laptops. +* [Tendermint light client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/07-tendermint): The default for Cosmos SDK-based chains. +* [Localhost (loopback) client](https://github.com/cosmos/ibc-go/blob/main/modules/light-clients/09-localhost): Useful for testing, simulation, and relaying packets to modules on the same application. ### [Connections](https://github.com/cosmos/ibc-go/blob/main/modules/core/03-connection) @@ -46,13 +46,13 @@ Connections encapsulate two `ConnectionEnd` objects on two separate blockchains. In IBC, blockchains do not directly pass messages to each other over the network. -- To communicate, a blockchain commits some state to a precisely defined path reserved for a specific message type and a specific counterparty. For example, a blockchain that stores a specific connectionEnd as part of a handshake or a packet intended to be relayed to a module on the counterparty chain. +* To communicate, a blockchain commits some state to a precisely defined path reserved for a specific message type and a specific counterparty. For example, a blockchain that stores a specific connectionEnd as part of a handshake or a packet intended to be relayed to a module on the counterparty chain. -- A relayer process monitors for updates to these paths and relays messages by submitting the data stored under the path along with a proof of that data to the counterparty chain. +* A relayer process monitors for updates to these paths and relays messages by submitting the data stored under the path along with a proof of that data to the counterparty chain. -- The paths that all IBC implementations must support for committing IBC messages are defined in [ICS-24 host requirements](https://github.com/cosmos/ics/tree/master/spec/core/ics-024-host-requirements). +* The paths that all IBC implementations must support for committing IBC messages are defined in [ICS-24 host requirements](https://github.com/cosmos/ics/tree/master/spec/core/ics-024-host-requirements). -- The proof format that all implementations must produce and verify is defined in [ICS-23 implementation](https://github.com/confio/ics23). +* The proof format that all implementations must produce and verify is defined in [ICS-23 implementation](https://github.com/confio/ics23). ### [Capabilities](./ocap.md) @@ -74,9 +74,9 @@ IBC modules are responsible for claiming the capability that is returned on `Bin An IBC channel can be established between two IBC ports. A port is exclusively owned by a single module. IBC packets are sent over channels. Just as IP packets contain the destination IP address, IP port, the source IP address, and source IP port, IBC packets contain the destination portID, channelID, the source portID, and channelID. The IBC packets enable IBC to correctly route the packets to the destination module, while also allowing modules receiving packets to know the sender module. -- A channel can be `ORDERED` so that packets from a sending module must be processed by the receiving module in the order they were sent. +* A channel can be `ORDERED` so that packets from a sending module must be processed by the receiving module in the order they were sent. -- Recommended, a channel may be `UNORDERED` so that packets from a sending module are processed in the order they arrive, which may not be the order the packets were sent. +* Recommended, a channel may be `UNORDERED` so that packets from a sending module are processed in the order they arrive, which may not be the order the packets were sent. Modules may choose which channels they wish to communicate over with. IBC expects modules to implement callbacks that are called during the channel handshake. These callbacks may do custom channel initialization logic. If an error is returned, the channel handshake fails. By returning errors on callbacks, modules can programmatically reject and accept channels. @@ -95,19 +95,19 @@ Just as ports came with dynamic capabilities, channel initialization returns a d Modules communicate with each other by sending packets over IBC channels. All IBC packets contain: -- Destination `portID` +* Destination `portID` -- Destination `channelID` +* Destination `channelID` -- Source `portID` +* Source `portID` -- Source `channelID` +* Source `channelID` These port and channels allow the modules to know the sender module of a given packet. -- A sequence to optionally enforce ordering +* A sequence to optionally enforce ordering -- `TimeoutTimestamp` and `TimeoutHeight` +* `TimeoutTimestamp` and `TimeoutHeight` When non-zero, these timeout values determine the deadline before which the receiving module must process a packet. @@ -131,9 +131,9 @@ For this reason, most modules that use UNORDERED channels are recommended as the Modules also write application-specific acknowledgements when processing a packet. Acknowledgements can be done: -- Synchronously on `OnRecvPacket` if the module processes packets as soon as they are received from IBC module. +* Synchronously on `OnRecvPacket` if the module processes packets as soon as they are received from IBC module. -- Asynchronously if module processes packets at some later point after receiving the packet. +* Asynchronously if module processes packets at some later point after receiving the packet. This acknowledgement data is opaque to IBC much like the packet `Data` and is treated by IBC as a simple byte string `[]byte`. The receiver modules must encode their acknowledgement so that the sender module can decode it correctly. How the acknowledgement is encoded should be decided through version negotiation during the channel handshake. @@ -147,8 +147,8 @@ After an acknowledgement is received successfully on the original sender the cha To learn more about IBC, check out the following specifications: -- [IBC specs](https://github.com/cosmos/ibc/tree/master/spec) -- [IBC protocol on the Cosmos SDK](https://github.com/cosmos/ibc-go/tree/main/docs) +* [IBC specs](https://github.com/cosmos/ibc/tree/master/spec) +* [IBC protocol on the Cosmos SDK](https://github.com/cosmos/ibc-go/tree/main/docs) ## Next {hide} diff --git a/docs/ibc/relayer.md b/docs/ibc/relayer.md index 81f7b426b2d3..b25f95df3bfa 100644 --- a/docs/ibc/relayer.md +++ b/docs/ibc/relayer.md @@ -6,8 +6,8 @@ order: 4 ## Prerequisites Readings -- [IBC Overview](./overview.md) {prereq} -- [Events](https://github.com/cosmos/cosmos-sdk/blob/master/docs/core/events.md) {prereq} +* [IBC Overview](./overview.md) {prereq} +* [Events](https://github.com/cosmos/cosmos-sdk/blob/master/docs/core/events.md) {prereq} ## Events @@ -42,6 +42,6 @@ piece of information needed to relay a packet. ## Example Implementations -- [Golang Relayer](https://github.com/iqlusioninc/relayer) -- [Hermes](https://github.com/informalsystems/ibc-rs/tree/master/relayer) -- [Typescript Relayer](https://github.com/confio/ts-relayer) +* [Golang Relayer](https://github.com/iqlusioninc/relayer) +* [Hermes](https://github.com/informalsystems/ibc-rs/tree/master/relayer) +* [Typescript Relayer](https://github.com/confio/ts-relayer) diff --git a/docs/ibc/upgrades/README.md b/docs/ibc/upgrades/README.md index b9fe743b180c..3e482488e525 100644 --- a/docs/ibc/upgrades/README.md +++ b/docs/ibc/upgrades/README.md @@ -4,7 +4,7 @@ parent: order: 3 --> -### Upgrading IBC Chains Overview +# Upgrading IBC Chains Overview This directory contains information on how to upgrade an IBC chain without breaking counterparty clients and connections. diff --git a/docs/ibc/upgrades/quick-guide.md b/docs/ibc/upgrades/quick-guide.md index 99360042aac4..7a479a58bc18 100644 --- a/docs/ibc/upgrades/quick-guide.md +++ b/docs/ibc/upgrades/quick-guide.md @@ -8,7 +8,7 @@ Learn how to upgrade your chain and counterparty clients. {synopsis} The information in this doc for upgrading chains is relevant to Cosmos SDK chains. However, the guide for counterparty clients is relevant to any Tendermint client that enables upgrades. -### IBC Client Breaking Upgrades +## IBC Client Breaking Upgrades IBC-connected chains must perform an IBC upgrade if their upgrade will break counterparty IBC clients. The current IBC protocol supports upgrading tendermint chains for a specific subset of IBC-client-breaking upgrades. Here is the exhaustive list of IBC client-breaking upgrades and whether the IBC protocol currently supports such upgrades. @@ -26,7 +26,7 @@ Note: Since upgrades are only implemented for Tendermint clients, this doc only 8. Upgrading to a non-backwards compatible version of IBC: **Unsupported**, as IBC version is negotiated on connection handshake. 9. Changing the Tendermint LightClient algorithm: **Partially Supported**. Changes to the light client algorithm that do not change the ClientState or ConsensusState struct may be supported, provided that the counterparty is also upgraded to support the new light client algorithm. Changes that require updating the ClientState and ConsensusState structs themselves are theoretically possible by providing a path to translate an older ClientState struct into the new ClientState struct; however this is not currently implemented. -### Step-by-Step Upgrade Process for Cosmos SDK chains +## Step-by-Step Upgrade Process for Cosmos SDK chains If the IBC-connected chain is conducting an upgrade that will break counterparty clients, it must ensure that the upgrade is first supported by IBC using the list above and then execute the upgrade process described below in order to prevent counterparty clients from breaking. @@ -37,7 +37,7 @@ Upon the `UpgradeProposal` passing, the upgrade module will commit the UpgradedC Once the chain reaches the upgrade height and halts, a relayer can upgrade the counterparty clients to the last block of the old chain. They can then submit the proofs of the `UpgradedClient` and `UpgradedConsensusState` against this last block and upgrade the counterparty client. -### Step-by-Step Upgrade Process for Relayers Upgrading Counterparty Clients +## Step-by-Step Upgrade Process for Relayers Upgrading Counterparty Clients Once the upgrading chain has committed to upgrading, relayers must wait till the chain halts at the upgrade height before upgrading counterparty clients. This is because chains may reschedule or cancel upgrade plans before they occur. Thus, relayers must wait till the chain reaches the upgrade height and halts before they can be sure the upgrade will take place. diff --git a/docs/intro/overview.md b/docs/intro/overview.md index 463fee45b0e7..a58023f20b34 100644 --- a/docs/intro/overview.md +++ b/docs/intro/overview.md @@ -4,13 +4,13 @@ order: 1 # High-level Overview -## What is the Cosmos SDK? +## What is the Cosmos SDK The [Cosmos SDK](https://github.com/cosmos/cosmos-sdk) is an open-source framework for building multi-asset public Proof-of-Stake (PoS) blockchains, like the Cosmos Hub, as well as permissioned Proof-of-Authority (PoA) blockchains. Blockchains built with the Cosmos SDK are generally referred to as **application-specific blockchains**. The goal of the Cosmos SDK is to allow developers to easily create custom blockchains from scratch that can natively interoperate with other blockchains. We envision the Cosmos SDK as the npm-like framework to build secure blockchain applications on top of [Tendermint](https://github.com/tendermint/tendermint). SDK-based blockchains are built out of composable [modules](../building-modules/intro.md), most of which are open source and readily available for any developers to use. Anyone can create a module for the Cosmos SDK, and integrating already-built modules is as simple as importing them into your blockchain application. What's more, the Cosmos SDK is a capabilities-based system that allows developers to better reason about the security of interactions between modules. For a deeper look at capabilities, jump to [Object-Capability Model](../core/ocap.md). -## What are Application-Specific Blockchains? +## What are Application-Specific Blockchains One development paradigm in the blockchain world today is that of virtual-machine blockchains like Ethereum, where development generally revolves around building a decentralised applications on top of an existing blockchain as a set of smart contracts. While smart contracts can be very good for some use cases like single-use applications (e.g. ICOs), they often fall short for building complex decentralised platforms. More generally, smart contracts can be limiting in terms of flexibility, sovereignty and performance. @@ -18,19 +18,19 @@ Application-specific blockchains offer a radically different development paradig Learn more about [application-specific blockchains](./why-app-specific.md). -## Why the Cosmos SDK? +## Why the Cosmos SDK The Cosmos SDK is the most advanced framework for building custom application-specific blockchains today. Here are a few reasons why you might want to consider building your decentralised application with the Cosmos SDK: -- The default consensus engine available within the Cosmos SDK is [Tendermint Core](https://github.com/tendermint/tendermint). Tendermint is the most (and only) mature BFT consensus engine in existence. It is widely used across the industry and is considered the gold standard consensus engine for building Proof-of-Stake systems. -- The Cosmos SDK is open source and designed to make it easy to build blockchains out of composable [modules](../../x/). As the ecosystem of open source Cosmos SDK modules grows, it will become increasingly easier to build complex decentralised platforms with it. -- The Cosmos SDK is inspired by capabilities-based security, and informed by years of wrestling with blockchain state-machines. This makes the Cosmos SDK a very secure environment to build blockchains. -- Most importantly, the Cosmos SDK has already been used to build many application-specific blockchains that are already in production. Among others, we can cite [Cosmos Hub](https://hub.cosmos.network), [IRIS Hub](https://irisnet.org), [Binance Chain](https://docs.binance.org/), [Terra](https://terra.money/) or [Kava](https://www.kava.io/). [Many more](https://cosmos.network/ecosystem) are building on the Cosmos SDK. +* The default consensus engine available within the Cosmos SDK is [Tendermint Core](https://github.com/tendermint/tendermint). Tendermint is the most (and only) mature BFT consensus engine in existence. It is widely used across the industry and is considered the gold standard consensus engine for building Proof-of-Stake systems. +* The Cosmos SDK is open source and designed to make it easy to build blockchains out of composable [modules](../../x/). As the ecosystem of open source Cosmos SDK modules grows, it will become increasingly easier to build complex decentralised platforms with it. +* The Cosmos SDK is inspired by capabilities-based security, and informed by years of wrestling with blockchain state-machines. This makes the Cosmos SDK a very secure environment to build blockchains. +* Most importantly, the Cosmos SDK has already been used to build many application-specific blockchains that are already in production. Among others, we can cite [Cosmos Hub](https://hub.cosmos.network), [IRIS Hub](https://irisnet.org), [Binance Chain](https://docs.binance.org/), [Terra](https://terra.money/) or [Kava](https://www.kava.io/). [Many more](https://cosmos.network/ecosystem) are building on the Cosmos SDK. ## Getting started with the Cosmos SDK -- Learn more about the [architecture of a Cosmos SDK application](./sdk-app-architecture.md) -- Learn how to build an application-specific blockchain from scratch with the [Cosmos SDK Tutorial](https://cosmos.network/docs/tutorial) +* Learn more about the [architecture of a Cosmos SDK application](./sdk-app-architecture.md) +* Learn how to build an application-specific blockchain from scratch with the [Cosmos SDK Tutorial](https://cosmos.network/docs/tutorial) ## Next {hide} diff --git a/docs/intro/sdk-app-architecture.md b/docs/intro/sdk-app-architecture.md index 88f1de4039de..d03815a55f97 100644 --- a/docs/intro/sdk-app-architecture.md +++ b/docs/intro/sdk-app-architecture.md @@ -12,7 +12,7 @@ A state machine is a computer science concept whereby a machine can have multipl Given a state S and a transaction T, the state machine will return a new state S'. -``` +```text +--------+ +--------+ | | | | | S +---------------->+ S' | @@ -22,7 +22,7 @@ Given a state S and a transaction T, the state machine will return a new state S In practice, the transactions are bundled in blocks to make the process more efficient. Given a state S and a block of transactions B, the state machine will return a new state S'. -``` +```text +--------+ +--------+ | | | | | S +----------------------------> | S' | @@ -38,7 +38,7 @@ The Cosmos SDK gives developers maximum flexibility to define the state of their Thanks to the Cosmos SDK, developers just have to define the state machine, and [*Tendermint*](https://tendermint.com/docs/introduction/what-is-tendermint.html) will handle replication over the network for them. -``` +```text ^ +-------------------------------+ ^ | | | | Built with Cosmos SDK | | State-machine = Application | | @@ -62,7 +62,7 @@ The Tendermint [consensus algorithm](https://docs.tendermint.com/v0.34/introduct Tendermint passes transactions to the application through an interface called the [ABCI](https://docs.tendermint.com/v0.34/spec/abci/), which the application must implement. -``` +```text +---------------------+ | | | Application | @@ -84,9 +84,9 @@ Note that **Tendermint only handles transaction bytes**. It has no knowledge of Here are the most important messages of the ABCI: -- `CheckTx`: When a transaction is received by Tendermint Core, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam transactions. A special handler called the [`AnteHandler`](../basics/gas-fees.md#antehandler) is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the checks are valid, the transaction is added to the [mempool](https://docs.tendermint.com/v0.34/tendermint-core/mempool.html#mempool) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. -- `DeliverTx`: When a [valid block](https://docs.tendermint.com/v0.34/spec/blockchain/blockchain.html#validation) is received by Tendermint Core, each transaction in the block is passed to the application via `DeliverTx` in order to be processed. It is during this stage that the state transitions occur. The `AnteHandler` executes again along with the actual [`Msg` service](../building-modules/msg-services.md) RPC for each message in the transaction. -- `BeginBlock`/`EndBlock`: These messages are executed at the beginning and the end of each block, whether the block contains transaction or not. It is useful to trigger automatic execution of logic. Proceed with caution though, as computationally expensive loops could slow down your blockchain, or even freeze it if the loop is infinite. +* `CheckTx`: When a transaction is received by Tendermint Core, it is passed to the application to check if a few basic requirements are met. `CheckTx` is used to protect the mempool of full-nodes against spam transactions. A special handler called the [`AnteHandler`](../basics/gas-fees.md#antehandler) is used to execute a series of validation steps such as checking for sufficient fees and validating the signatures. If the checks are valid, the transaction is added to the [mempool](https://docs.tendermint.com/v0.34/tendermint-core/mempool.html#mempool) and relayed to peer nodes. Note that transactions are not processed (i.e. no modification of the state occurs) with `CheckTx` since they have not been included in a block yet. +* `DeliverTx`: When a [valid block](https://docs.tendermint.com/v0.34/spec/blockchain/blockchain.html#validation) is received by Tendermint Core, each transaction in the block is passed to the application via `DeliverTx` in order to be processed. It is during this stage that the state transitions occur. The `AnteHandler` executes again along with the actual [`Msg` service](../building-modules/msg-services.md) RPC for each message in the transaction. +* `BeginBlock`/`EndBlock`: These messages are executed at the beginning and the end of each block, whether the block contains transaction or not. It is useful to trigger automatic execution of logic. Proceed with caution though, as computationally expensive loops could slow down your blockchain, or even freeze it if the loop is infinite. Find a more detailed view of the ABCI methods from the [Tendermint docs](https://docs.tendermint.com/v0.34/spec/abci/abci.html#overview). diff --git a/docs/intro/sdk-design.md b/docs/intro/sdk-design.md index 169bb08e5068..ba923a008380 100644 --- a/docs/intro/sdk-design.md +++ b/docs/intro/sdk-design.md @@ -17,7 +17,7 @@ Here is a simplified view of how transactions are handled by an application buil `baseapp` is the boilerplate implementation of a Cosmos SDK application. It comes with an implementation of the ABCI to handle the connection with the underlying consensus engine. Typically, a Cosmos SDK application extends `baseapp` by embedding it in [`app.go`](../basics/app-anatomy.md#core-application-file). See an example of this from the Cosmos SDK application tutorial: -+++ https://github.com/cosmos/sdk-tutorials/blob/c6754a1e313eb1ed973c5c91dcc606f2fd288811/app.go#L72-L92 ++++ The goal of `baseapp` is to provide a secure interface between the store and the extensible state machine while defining as little about the state machine as possible (staying true to the ABCI). @@ -35,7 +35,7 @@ The power of the Cosmos SDK lies in its modularity. Cosmos SDK applications are Here is a simplified view of how a transaction is processed by the application of each full-node when it is received in a valid block: -``` +```text + | | Transaction relayed from the full-node's @@ -84,9 +84,9 @@ Each module can be seen as a little state-machine. Developers need to define the Cosmos SDK modules are defined in the `x/` folder of the Cosmos SDK. Some core modules include: -- `x/auth`: Used to manage accounts and signatures. -- `x/bank`: Used to enable tokens and token transfers. -- `x/staking` + `x/slashing`: Used to build Proof-Of-Stake blockchains. +* `x/auth`: Used to manage accounts and signatures. +* `x/bank`: Used to enable tokens and token transfers. +* `x/staking` + `x/slashing`: Used to build Proof-Of-Stake blockchains. In addition to the already existing modules in `x/`, that anyone can use in their app, the Cosmos SDK lets you build your own custom modules. You can check an [example of that in the tutorial](https://tutorials.cosmos.network/). diff --git a/docs/intro/why-app-specific.md b/docs/intro/why-app-specific.md index 9d8caedcd13f..8efb70cb7f3d 100644 --- a/docs/intro/why-app-specific.md +++ b/docs/intro/why-app-specific.md @@ -6,11 +6,11 @@ order: 2 This document explains what application-specific blockchains are, and why developers would want to build one as opposed to writing Smart Contracts. {synopsis} -## What are application-specific blockchains? +## What are application-specific blockchains Application-specific blockchains are blockchains customized to operate a single application. Instead of building a decentralised application on top of an underlying blockchain like Ethereum, developers build their own blockchain from the ground up. This means building a full-node client, a light-client, and all the necessary interfaces (CLI, REST, ...) to interact with the nodes. -``` +```text ^ +-------------------------------+ ^ | | | | Built with Cosmos SDK | | State-machine = Application | | @@ -26,15 +26,15 @@ Blockchain node | | Consensus | | v +-------------------------------+ v ``` -## What are the shortcomings of Smart Contracts? +## What are the shortcomings of Smart Contracts Virtual-machine blockchains like Ethereum addressed the demand for more programmability back in 2014. At the time, the options available for building decentralised applications were quite limited. Most developers would build on top of the complex and limited Bitcoin scripting language, or fork the Bitcoin codebase which was hard to work with and customize. Virtual-machine blockchains came in with a new value proposition. Their state-machine incorporates a virtual-machine that is able to interpret turing-complete programs called Smart Contracts. These Smart Contracts are very good for use cases like one-time events (e.g. ICOs), but they can fall short for building complex decentralised platforms. Here is why: -- Smart Contracts are generally developed with specific programming languages that can be interpreted by the underlying virtual-machine. These programming languages are often immature and inherently limited by the constraints of the virtual-machine itself. For example, the Ethereum Virtual Machine does not allow developers to implement automatic execution of code. Developers are also limited to the account-based system of the EVM, and they can only choose from a limited set of functions for their cryptographic operations. These are examples, but they hint at the lack of **flexibility** that a smart contract environment often entails. -- Smart Contracts are all run by the same virtual machine. This means that they compete for resources, which can severely restrain **performance**. And even if the state-machine were to be split in multiple subsets (e.g. via sharding), Smart Contracts would still need to be interpeted by a virtual machine, which would limit performance compared to a native application implemented at state-machine level (our benchmarks show an improvement on the order of 10x in performance when the virtual-machine is removed). -- Another issue with the fact that Smart Contracts share the same underlying environment is the resulting limitation in **sovereignty**. A decentralised application is an ecosystem that involves multiple players. If the application is built on a general-purpose virtual-machine blockchain, stakeholders have very limited sovereignty over their application, and are ultimately superseded by the governance of the underlying blockchain. If there is a bug in the application, very little can be done about it. +* Smart Contracts are generally developed with specific programming languages that can be interpreted by the underlying virtual-machine. These programming languages are often immature and inherently limited by the constraints of the virtual-machine itself. For example, the Ethereum Virtual Machine does not allow developers to implement automatic execution of code. Developers are also limited to the account-based system of the EVM, and they can only choose from a limited set of functions for their cryptographic operations. These are examples, but they hint at the lack of **flexibility** that a smart contract environment often entails. +* Smart Contracts are all run by the same virtual machine. This means that they compete for resources, which can severely restrain **performance**. And even if the state-machine were to be split in multiple subsets (e.g. via sharding), Smart Contracts would still need to be interpeted by a virtual machine, which would limit performance compared to a native application implemented at state-machine level (our benchmarks show an improvement on the order of 10x in performance when the virtual-machine is removed). +* Another issue with the fact that Smart Contracts share the same underlying environment is the resulting limitation in **sovereignty**. A decentralised application is an ecosystem that involves multiple players. If the application is built on a general-purpose virtual-machine blockchain, stakeholders have very limited sovereignty over their application, and are ultimately superseded by the governance of the underlying blockchain. If there is a bug in the application, very little can be done about it. Application-Specific Blockchains are designed to address these shortcomings. @@ -44,13 +44,13 @@ Application-Specific Blockchains are designed to address these shortcomings. Application-specific blockchains give maximum flexibility to developers: -- In Cosmos blockchains, the state-machine is typically connected to the underlying consensus engine via an interface called the [ABCI](https://docs.tendermint.com/v0.34/spec/abci/). This interface can be wrapped in any programming language, meaning developers can build their state-machine in the programming language of their choice. +* In Cosmos blockchains, the state-machine is typically connected to the underlying consensus engine via an interface called the [ABCI](https://docs.tendermint.com/v0.34/spec/abci/). This interface can be wrapped in any programming language, meaning developers can build their state-machine in the programming language of their choice. -- Developers can choose among multiple frameworks to build their state-machine. The most widely used today is the Cosmos SDK, but others exist (e.g. [Lotion](https://github.com/nomic-io/lotion), [Weave](https://github.com/iov-one/weave), ...). Typically the choice will be made based on the programming language they want to use (Cosmos SDK and Weave are in Golang, Lotion is in Javascript, ...). -- The ABCI also allows developers to swap the consensus engine of their application-specific blockchain. Today, only Tendermint is production-ready, but in the future other consensus engines are expected to emerge. -- Even when they settle for a framework and consensus engine, developers still have the freedom to tweak them if they don't perfectly match their requirements in their pristine forms. -- Developers are free to explore the full spectrum of tradeoffs (e.g. number of validators vs transaction throughput, safety vs availability in asynchrony, ...) and design choices (DB or IAVL tree for storage, UTXO or account model, ...). -- Developers can implement automatic execution of code. In the Cosmos SDK, logic can be automatically triggered at the beginning and the end of each block. They are also free to choose the cryptographic library used in their application, as opposed to being constrained by what is made available by the underlying environment in the case of virtual-machine blockchains. +* Developers can choose among multiple frameworks to build their state-machine. The most widely used today is the Cosmos SDK, but others exist (e.g. [Lotion](https://github.com/nomic-io/lotion), [Weave](https://github.com/iov-one/weave), ...). Typically the choice will be made based on the programming language they want to use (Cosmos SDK and Weave are in Golang, Lotion is in Javascript, ...). +* The ABCI also allows developers to swap the consensus engine of their application-specific blockchain. Today, only Tendermint is production-ready, but in the future other consensus engines are expected to emerge. +* Even when they settle for a framework and consensus engine, developers still have the freedom to tweak them if they don't perfectly match their requirements in their pristine forms. +* Developers are free to explore the full spectrum of tradeoffs (e.g. number of validators vs transaction throughput, safety vs availability in asynchrony, ...) and design choices (DB or IAVL tree for storage, UTXO or account model, ...). +* Developers can implement automatic execution of code. In the Cosmos SDK, logic can be automatically triggered at the beginning and the end of each block. They are also free to choose the cryptographic library used in their application, as opposed to being constrained by what is made available by the underlying environment in the case of virtual-machine blockchains. The list above contains a few examples that show how much flexibility application-specific blockchains give to developers. The goal of Cosmos and the Cosmos SDK is to make developer tooling as generic and composable as possible, so that each part of the stack can be forked, tweaked and improved without losing compatibility. As the community grows, more alternatives for each of the core building blocks will emerge, giving more options to developers. @@ -58,17 +58,17 @@ The list above contains a few examples that show how much flexibility applicatio Decentralised applications built with Smart Contracts are inherently capped in performance by the underlying environment. For a decentralised application to optimise performance, it needs to be built as an application-specific blockchain. Next are some of the benefits an application-specific blockchain brings in terms of performance: -- Developers of application-specific blockchains can choose to operate with a novel consensus engine such as Tendermint BFT. Compared to Proof-of-Work (used by most virtual-machine blockchains today), it offers significant gains in throughput. -- An application-specific blockchain only operates a single application, so that the application does not compete with others for computation and storage. This is the opposite of most non-sharded virtual-machine blockchains today, where smart contracts all compete for computation and storage. -- Even if a virtual-machine blockchain offered application-based sharding coupled with an efficient consensus algorithm, performance would still be limited by the virtual-machine itself. The real throughput bottleneck is the state-machine, and requiring transactions to be interpreted by a virtual-machine significantly increases the computational complexity of processing them. +* Developers of application-specific blockchains can choose to operate with a novel consensus engine such as Tendermint BFT. Compared to Proof-of-Work (used by most virtual-machine blockchains today), it offers significant gains in throughput. +* An application-specific blockchain only operates a single application, so that the application does not compete with others for computation and storage. This is the opposite of most non-sharded virtual-machine blockchains today, where smart contracts all compete for computation and storage. +* Even if a virtual-machine blockchain offered application-based sharding coupled with an efficient consensus algorithm, performance would still be limited by the virtual-machine itself. The real throughput bottleneck is the state-machine, and requiring transactions to be interpreted by a virtual-machine significantly increases the computational complexity of processing them. ### Security Security is hard to quantify, and greatly varies from platform to platform. That said here are some important benefits an application-specific blockchain can bring in terms of security: -- Developers can choose proven programming languages like Golang when building their application-specific blockchains, as opposed to smart contract programming languages that are often more immature. -- Developers are not constrained by the cryptographic functions made available by the underlying virtual-machines. They can use their own custom cryptography, and rely on well-audited crypto libraries. -- Developers do not have to worry about potential bugs or exploitable mechanisms in the underlying virtual-machine, making it easier to reason about the security of the application. +* Developers can choose proven programming languages like Golang when building their application-specific blockchains, as opposed to smart contract programming languages that are often more immature. +* Developers are not constrained by the cryptographic functions made available by the underlying virtual-machines. They can use their own custom cryptography, and rely on well-audited crypto libraries. +* Developers do not have to worry about potential bugs or exploitable mechanisms in the underlying virtual-machine, making it easier to reason about the security of the application. ### Sovereignty diff --git a/docs/migrations/chain-upgrade-guide-044.md b/docs/migrations/chain-upgrade-guide-044.md index 652324524a4b..4e8adf01fba4 100644 --- a/docs/migrations/chain-upgrade-guide-044.md +++ b/docs/migrations/chain-upgrade-guide-044.md @@ -12,9 +12,9 @@ You must upgrade to Stargate v0.42 before upgrading to v0.44. If you have not do ## Prerequisite Readings -- [Upgrading Modules](../building-modules/upgrade.html) {prereq} -- [In-Place Store Migrations](../core/upgrade.html) {prereq} -- [Cosmovisor](../run-node/cosmovisor.html) {prereq} +* [Upgrading Modules](../building-modules/upgrade.html) {prereq} +* [In-Place Store Migrations](../core/upgrade.html) {prereq} +* [Cosmovisor](../run-node/cosmovisor.html) {prereq} Cosmos SDK v0.44 introduces a new way of handling chain upgrades that no longer requires exporting state to JSON, making the necesssary changes, and then creating a new chain with the modified JSON as the new genesis file. @@ -56,25 +56,25 @@ In the following example, we start a new chain from `v0.42`. The binary for this From within the `cosmos-sdk` repository, check out the latest `v0.42.x` release: -``` +```sh git checkout release/v0.42.x ``` Build the `simd` binary for the latest `v0.42.x` release (the genesis binary): -``` +```sh make build ``` Reset `~/.simapp` (never do this in a production environment): -``` +```sh ./build/simd unsafe-reset-all ``` Configure the `simd` binary for testing: -``` +```sh ./build/simd config chain-id test ./build/simd config keyring-backend test ./build/simd config broadcast-mode block @@ -84,19 +84,19 @@ Initialize the node and overwrite any previous genesis file (never do this in a -``` +```sh ./build/simd init test --chain-id test --overwrite ``` Set the minimum gas price to `0stake` in `~/.simapp/config/app.toml`: -``` +```sh minimum-gas-prices = "0stake" ``` For the purpose of this demonstration, change `voting_period` in `genesis.json` to a reduced time of 20 seconds (`20s`): -``` +```sh cat <<< $(jq '.app_state.gov.voting_params.voting_period = "20s"' $HOME/.simapp/config/genesis.json) > $HOME/.simapp/config/genesis.json ``` @@ -105,7 +105,7 @@ Create a new key for the validator, then add a genesis account and transaction: -``` +```sh ./build/simd keys add validator ./build/simd add-genesis-account validator 5000000000stake --keyring-backend test ./build/simd gentx validator 1000000stake --chain-id test @@ -118,7 +118,7 @@ Now that our node is initialized and we are ready to start a new `simapp` chain, Install the `cosmovisor` binary: -``` +```sh go install github.com/cosmos/cosmos-sdk/cosmovisor/cmd/cosmovisor@v0.1.0 ``` @@ -128,20 +128,20 @@ If you are using go `v1.15` or earlier, you will need to change out of the `cosm Set the required environment variables: -``` +```sh export DAEMON_NAME=simd export DAEMON_HOME=$HOME/.simapp ``` Set the optional environment variable to trigger an automatic restart: -``` +```sh export DAEMON_RESTART_AFTER_UPGRADE=true ``` Create the folder for the genesis binary and copy the `v0.42.x` binary: -``` +```sh mkdir -p $DAEMON_HOME/cosmovisor/genesis/bin cp ./build/simd $DAEMON_HOME/cosmovisor/genesis/bin ``` @@ -154,7 +154,7 @@ Now that `cosmovisor` is installed and the genesis binary has been added, let's Check out `release/v0.44.x`: -``` +```sh git checkout release/v0.44.x ``` @@ -217,13 +217,13 @@ Add `storetypes` to imports: Build the `simd` binary for `v0.44.x` (the upgrade binary): -``` +```sh make build ``` Create the folder for the upgrade binary and copy the `v0.44.x` binary: -``` +```sh mkdir -p $DAEMON_HOME/cosmovisor/upgrades/v0.44/bin cp ./build/simd $DAEMON_HOME/cosmovisor/upgrades/v0.44/bin ``` @@ -234,13 +234,13 @@ Now that we have added the upgrade handler and prepared the upgrade binary, we a Start the node using `cosmovisor`: -``` +```sh cosmovisor start ``` Open a new terminal window and submit an upgrade proposal along with a deposit and a vote (these commands must be run within 20 seconds of each other): -``` +```sh ./build/simd tx gov submit-proposal software-upgrade v0.44 --title upgrade --description upgrade --upgrade-height 20 --from validator --yes ./build/simd tx gov deposit 1 10000000stake --from validator --yes ./build/simd tx gov vote 1 yes --from validator --yes diff --git a/docs/run-node/interact-node.md b/docs/run-node/interact-node.md index 62c3c17ad852..270326ad03ad 100644 --- a/docs/run-node/interact-node.md +++ b/docs/run-node/interact-node.md @@ -8,8 +8,8 @@ There are multiple ways to interact with a node: using the CLI, using gRPC or us ## Pre-requisite Readings -- [gRPC, REST and Tendermint Endpoints](../core/grpc_rest.md) {prereq} -- [Running a Node](./run-node.md) {prereq} +* [gRPC, REST and Tendermint Endpoints](../core/grpc_rest.md) {prereq} +* [Running a Node](./run-node.md) {prereq} ## Using the CLI @@ -54,9 +54,9 @@ The Protobuf ecosystem developed tools for different use cases, including code-g Since the code generation library largely depends on your own tech stack, we will only present three alternatives: -- `grpcurl` for generic debugging and testing, -- programmatically via Go, -- CosmJS for JavaScript/TypeScript developers. +* `grpcurl` for generic debugging and testing, +* programmatically via Go, +* CosmJS for JavaScript/TypeScript developers. ### grpcurl diff --git a/docs/run-node/keyring.md b/docs/run-node/keyring.md index 679a730f732a..db971d5a1794 100644 --- a/docs/run-node/keyring.md +++ b/docs/run-node/keyring.md @@ -22,11 +22,11 @@ securely. Typically, an operating system's credential sub-system handles passwor private keys storage, and user sessions according to the user's password policies. Here is a list of the most popular operating systems and their respective passwords manager: -- macOS (since Mac OS 8.6): [Keychain](https://support.apple.com/en-gb/guide/keychain-access/welcome/mac) -- Windows: [Credentials Management API](https://docs.microsoft.com/en-us/windows/win32/secauthn/credentials-management) -- GNU/Linux: - - [libsecret](https://gitlab.gnome.org/GNOME/libsecret) - - [kwallet](https://api.kde.org/frameworks/kwallet/html/index.html) +* macOS (since Mac OS 8.6): [Keychain](https://support.apple.com/en-gb/guide/keychain-access/welcome/mac) +* Windows: [Credentials Management API](https://docs.microsoft.com/en-us/windows/win32/secauthn/credentials-management) +* GNU/Linux: + * [libsecret](https://gitlab.gnome.org/GNOME/libsecret) + * [kwallet](https://api.kde.org/frameworks/kwallet/html/index.html) GNU/Linux distributions that use GNOME as default desktop environment typically come with [Seahorse](https://wiki.gnome.org/Apps/Seahorse). Users of KDE based distributions are diff --git a/docs/run-node/rosetta.md b/docs/run-node/rosetta.md index a9fe6a9dc9d8..c1a6a5cc93a4 100644 --- a/docs/run-node/rosetta.md +++ b/docs/run-node/rosetta.md @@ -42,13 +42,13 @@ An implementation example can be found in `simapp` package. To run Rosetta in your application CLI, use the following command: -``` +```sh appd rosetta --help ``` To test and run Rosetta API endpoints for applications that are running and exposed, use the following command: -``` +```sh appd rosetta --blockchain "your application name (ex: gaia)" --network "your chain identifier (ex: testnet-1)" diff --git a/docs/run-node/run-node.md b/docs/run-node/run-node.md index ee3141403000..7d133bd25a5c 100644 --- a/docs/run-node/run-node.md +++ b/docs/run-node/run-node.md @@ -8,8 +8,8 @@ Now that the application is ready and the keyring populated, it's time to see ho ## Pre-requisite Readings -- [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} -- [Setting up the keyring](./keyring.md) {prereq} +* [Anatomy of a Cosmos SDK Application](../basics/app-anatomy.md) {prereq} +* [Setting up the keyring](./keyring.md) {prereq} ## Initialize the Chain @@ -95,8 +95,8 @@ simd gentx --help The Cosmos SDK automatically generates two configuration files inside `~/.simapp/config`: -- `config.toml`: used to configure the Tendermint, learn more on [Tendermint's documentation](https://docs.tendermint.com/master/nodes/configuration.html), -- `app.toml`: generated by the Cosmos SDK, and used to configure your app, such as state pruning strategies, telemetry, gRPC and REST servers configuration, state sync... +* `config.toml`: used to configure the Tendermint, learn more on [Tendermint's documentation](https://docs.tendermint.com/master/nodes/configuration.html), +* `app.toml`: generated by the Cosmos SDK, and used to configure your app, such as state pruning strategies, telemetry, gRPC and REST servers configuration, state sync... Both files are heavily commented, please refer to them directly to tweak your node. diff --git a/docs/run-node/run-testnet.md b/docs/run-node/run-testnet.md index 0cbfe8cf9789..55ad21d67ee7 100644 --- a/docs/run-node/run-testnet.md +++ b/docs/run-node/run-testnet.md @@ -76,19 +76,19 @@ The first validator node is now running in-process, which means the test network Check the status of the first validator node: -``` +```sh simd status ``` Import the key from the provided mnemonic: -``` +```sh simd keys add test --recover --keyring-backend test ``` Check the balance of the account address: -``` +```sh simd q bank balances [address] ``` diff --git a/docs/run-node/txs.md b/docs/run-node/txs.md index 4e2313b34195..e5796a533e41 100644 --- a/docs/run-node/txs.md +++ b/docs/run-node/txs.md @@ -16,11 +16,11 @@ simd tx bank send $MY_VALIDATOR_ADDRESS $RECIPIENT 1000stake --chain-id my-test- will run the following steps: -- generate a transaction with one `Msg` (`x/bank`'s `MsgSend`), and print the generated transaction to the console. -- ask the user for confirmation to send the transaction from the `$MY_VALIDATOR_ADDRESS` account. -- fetch `$MY_VALIDATOR_ADDRESS` from the keyring. This is possible because we have [set up the CLI's keyring](./keyring.md) in a previous step. -- sign the generated transaction with the keyring's account. -- broadcast the signed transaction to the network. This is possible because the CLI connects to the node's Tendermint RPC endpoint. +* generate a transaction with one `Msg` (`x/bank`'s `MsgSend`), and print the generated transaction to the console. +* ask the user for confirmation to send the transaction from the `$MY_VALIDATOR_ADDRESS` account. +* fetch `$MY_VALIDATOR_ADDRESS` from the keyring. This is possible because we have [set up the CLI's keyring](./keyring.md) in a previous step. +* sign the generated transaction with the keyring's account. +* broadcast the signed transaction to the network. This is possible because the CLI connects to the node's Tendermint RPC endpoint. The CLI bundles all the necessary steps into a simple-to-use user experience. However, it's possible to run all the steps individually too. @@ -46,8 +46,8 @@ This command will decode the unsigned transaction and sign it with `SIGN_MODE_DI Some useful flags to consider in the `tx sign` command: -- `--sign-mode`: you may use `amino-json` to sign the transaction using `SIGN_MODE_LEGACY_AMINO_JSON`, -- `--offline`: sign in offline mode. This means that the `tx sign` command doesn't connect to the node to retrieve the signer's account number and sequence, both needed for signing. In this case, you must manually supply the `--account-number` and `--sequence` flags. This is useful for offline signing, i.e. signing in a secure environment which doesn't have access to the internet. +* `--sign-mode`: you may use `amino-json` to sign the transaction using `SIGN_MODE_LEGACY_AMINO_JSON`, +* `--offline`: sign in offline mode. This means that the `tx sign` command doesn't connect to the node to retrieve the signer's account number and sequence, both needed for signing. In this case, you must manually supply the `--account-number` and `--sequence` flags. This is useful for offline signing, i.e. signing in a secure environment which doesn't have access to the internet. #### Signing with Multiple Signers @@ -79,9 +79,9 @@ simd tx broadcast tx_signed.json You may optionally pass the `--broadcast-mode` flag to specify which response to receive from the node: -- `block`: the CLI waits for the tx to be committed in a block. -- `sync`: the CLI waits for a CheckTx execution response only. -- `async`: the CLI returns immediately (transaction might fail). +* `block`: the CLI waits for the tx to be committed in a block. +* `sync`: the CLI waits for a CheckTx execution response only. +* `async`: the CLI returns immediately (transaction might fail). ### Encoding a Transaction @@ -179,8 +179,8 @@ At this point, `TxBuilder`'s underlying transaction is ready to be signed. We set encoding config to use Protobuf, which will use `SIGN_MODE_DIRECT` by default. As per [ADR-020](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc6/docs/architecture/adr-020-protobuf-transaction-encoding.md), each signer needs to sign the `SignerInfo`s of all other signers. This means that we need to perform two steps sequentially: -- for each signer, populate the signer's `SignerInfo` inside `TxBuilder`, -- once all `SignerInfo`s are populated, for each signer, sign the `SignDoc` (the payload to be signed). +* for each signer, populate the signer's `SignerInfo` inside `TxBuilder`, +* once all `SignerInfo`s are populated, for each signer, sign the `SignDoc` (the payload to be signed). In the current `TxBuilder`'s API, both steps are done using the same method: `SetSignatures()`. The current API requires us to first perform a round of `SetSignatures()` _with empty signatures_, only to populate `SignerInfo`s, and a second round of `SetSignatures()` to actually sign the correct payload. diff --git a/docs/spec/README.md b/docs/spec/README.md index 19fda12f4b1b..c1962ea83502 100644 --- a/docs/spec/README.md +++ b/docs/spec/README.md @@ -13,8 +13,8 @@ block. ## Cosmos SDK specifications -- [Store](./store) - The core Merkle store that holds the state. -- [Bech32](./addresses/bech32.md) - Address format for Cosmos SDK applications. +* [Store](./store) - The core Merkle store that holds the state. +* [Bech32](./addresses/bech32.md) - Address format for Cosmos SDK applications. ## Modules specifications diff --git a/docs/spec/SPEC-SPEC.md b/docs/spec/SPEC-SPEC.md index 3b7be53cdec0..9705440bbeed 100644 --- a/docs/spec/SPEC-SPEC.md +++ b/docs/spec/SPEC-SPEC.md @@ -25,39 +25,39 @@ beginning of the file name should be replaced with a number to indicate document flow (ex. read `01_state.md` before `02_state_transitions.md`). The following list is nonbinding and all files are optional. -- `README.md` - overview of the module -- `XX_concepts.md` - describe specialized concepts and definitions used throughout the spec -- `XX_state.md` - specify and describe structures expected to marshalled into the store, and their keys -- `XX_state_transitions.md` - standard state transition operations triggered by hooks, messages, etc. -- `XX_messages.md` - specify message structure(s) and expected state machine behaviour(s) -- `XX_begin_block.md` - specify any begin-block operations -- `XX_end_block.md` - specify any end-block operations -- `XX_hooks.md` - describe available hooks to be called by/from this module -- `XX_events.md` - list and describe event tags used -- `XX_client.md` - list and describe CLI commands and gRPC and REST endpoints -- `XX_params.md` - list all module parameters, their types (in JSON) and examples -- `XX_future_improvements.md` - describe future improvements of this module -- `XX_tests.md` - acceptance tests -- `XX_appendix.md` - supplementary details referenced elsewhere within the spec +* `README.md` - overview of the module +* `XX_concepts.md` - describe specialized concepts and definitions used throughout the spec +* `XX_state.md` - specify and describe structures expected to marshalled into the store, and their keys +* `XX_state_transitions.md` - standard state transition operations triggered by hooks, messages, etc. +* `XX_messages.md` - specify message structure(s) and expected state machine behaviour(s) +* `XX_begin_block.md` - specify any begin-block operations +* `XX_end_block.md` - specify any end-block operations +* `XX_hooks.md` - describe available hooks to be called by/from this module +* `XX_events.md` - list and describe event tags used +* `XX_client.md` - list and describe CLI commands and gRPC and REST endpoints +* `XX_params.md` - list all module parameters, their types (in JSON) and examples +* `XX_future_improvements.md` - describe future improvements of this module +* `XX_tests.md` - acceptance tests +* `XX_appendix.md` - supplementary details referenced elsewhere within the spec ### Notation for key-value mapping Within `state.md` the following notation `->` should be used to describe key to value mapping: -``` +```text key -> value ``` to represent byte concatenation the `|` may be used. In addition, encoding type may be specified, for example: -``` +```text 0x00 | addressBytes | address2Bytes -> amino(value_object) ``` Additionally, index mappings may be specified by mapping to the `nil` value, for example: -``` +```text 0x01 | address2Bytes | addressBytes -> nil ``` diff --git a/docs/spec/_ics/README.md b/docs/spec/_ics/README.md index b2fc1f5c0073..803e0c89c062 100644 --- a/docs/spec/_ics/README.md +++ b/docs/spec/_ics/README.md @@ -1,3 +1,3 @@ # Cosmos ICS -- [ICS030 - Signed Messages](./ics-030-signed-messages.md) +* [ICS030 - Signed Messages](./ics-030-signed-messages.md) diff --git a/docs/spec/addresses/README.md b/docs/spec/addresses/README.md index a577828eff4a..61db3aa93d70 100644 --- a/docs/spec/addresses/README.md +++ b/docs/spec/addresses/README.md @@ -1,3 +1,3 @@ # Addresses spec -- [Bech32](./bech32.md) +* [Bech32](./bech32.md) diff --git a/docs/spec/circuit-breaker/01_concepts.md b/docs/spec/circuit-breaker/01_concepts.md index 630a49190966..1956704bd592 100644 --- a/docs/spec/circuit-breaker/01_concepts.md +++ b/docs/spec/circuit-breaker/01_concepts.md @@ -5,9 +5,9 @@ running network which maintains network liveness. This can be achieved through selectively "pausing" functionality of specific modules on a running network. The circuit breaker is intended to be enabled through either: -- governance -- for emergencies a special subset of accounts selected by the state machine -- a transaction which proves the expected behaviour is broken +* governance +* for emergencies a special subset of accounts selected by the state machine +* a transaction which proves the expected behaviour is broken ## Pause state diff --git a/docs/spec/reserve-pool/TODO.md b/docs/spec/reserve-pool/TODO.md index 2e83776b647e..5eaf6d356b80 100644 --- a/docs/spec/reserve-pool/TODO.md +++ b/docs/spec/reserve-pool/TODO.md @@ -1,4 +1,4 @@ -TODO +# TODO The reserve pool is the pool of collected funds for use by governance taken via the `CommunityTax`. Currently with the Cosmos SDK, tokens collected by the CommunityTax are accounted for but unspendable. diff --git a/docs/using-the-sdk/README.md b/docs/using-the-sdk/README.md index c19a9223be71..2b78e200f346 100644 --- a/docs/using-the-sdk/README.md +++ b/docs/using-the-sdk/README.md @@ -5,5 +5,5 @@ parent: # Using the Cosmos SDK -- [Modules](../../x/README.md) -- [Simulation](../core/simulation.md) +* [Modules](../../x/README.md) +* [Simulation](../core/simulation.md) diff --git a/errors/CHANGELOG.md b/errors/CHANGELOG.md index 6b6faf4c5cd5..ddfd57edf320 100644 --- a/errors/CHANGELOG.md +++ b/errors/CHANGELOG.md @@ -37,4 +37,5 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## v1.0.0 ### Features + * [\#10779](https://github.com/cosmos/cosmos-sdk/pull/10779) Import code from the `github.com/cosmos/cosmos-sdk/types/errors` package. diff --git a/proto/README.md b/proto/README.md index 62b602620fbf..d3ffe874b02d 100644 --- a/proto/README.md +++ b/proto/README.md @@ -6,4 +6,4 @@ a maintainer by running `buf push` in this folder. User facing documentation should not be placed here but instead goes in `buf.md` and in each protobuf package following the guidelines in -https://docs.buf.build/bsr/documentation. \ No newline at end of file +. diff --git a/proto/buf.md b/proto/buf.md index 14250488a3d0..a44cb1bbfeec 100644 --- a/proto/buf.md +++ b/proto/buf.md @@ -1 +1,3 @@ -This is the public protocol buffers API for the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk). \ No newline at end of file +# Protobufs + +This is the public protocol buffers API for the [Cosmos SDK](https://github.com/cosmos/cosmos-sdk). diff --git a/scripts/README.md b/scripts/README.md index 2f9dc4d40336..d6f64c78df95 100644 --- a/scripts/README.md +++ b/scripts/README.md @@ -1,8 +1,10 @@ +# Scripts + Generally we should avoid shell scripting and write tests purely in Golang. However, some libraries are not Goroutine-safe (e.g. app simulations cannot be run safely in parallel), and OS-native threading may be more efficient for many parallel simulations, so we use shell scripts here. -### Validate Gentxs +## Validate Gentxs A custom utility script is available to [validate gentxs](./validate-gentxs.sh). Though we have `ValidateBasic()` for validating gentx data, it cannot validate signatures. This custom script helps @@ -22,4 +24,4 @@ export GENTXS_DIR=~/go/src/github.com/cosmos/mainnet/$CHAIN_ID/gentxs Though this script is handy for verifying the gentxs locally, it is advised to use Github Action to validate gentxs. An example can be found here: -https://github.com/regen-network/mainnet/blob/0bcd387671b9574e893289e39c08a1643cac7d62/.github/workflows/validate-gentx.yml + diff --git a/server/README.md b/server/README.md index 31926f69c1c8..0d7d30ac0f74 100644 --- a/server/README.md +++ b/server/README.md @@ -9,8 +9,8 @@ and `ExportCmd` which creates commands to start the application and export state The root command of an application typically is constructed with: -+ command to start an application binary -+ three meta commands: `query`, `tx`, and a few auxiliary commands such as `genesis`. +* command to start an application binary +* three meta commands: `query`, `tx`, and a few auxiliary commands such as `genesis`. utilities. It is vital that the root command of an application uses `PersistentPreRun()` cobra command diff --git a/simapp/README.md b/simapp/README.md index 4d00c0c2d166..4179392c9a0d 100644 --- a/simapp/README.md +++ b/simapp/README.md @@ -37,7 +37,7 @@ in this testnet. 9. Modify your `config/config.toml` (in the simapp working directory) to include the other participants as persistent peers: - ``` + ```text # Comma separated list of nodes to keep persistent connections to persistent_peers = "[validator_address]@[ip_address]:[port],[validator_address]@[ip_address]:[port]" ``` diff --git a/store/README.md b/store/README.md index 578d1e5f8dd1..49b2e5e804e2 100644 --- a/store/README.md +++ b/store/README.md @@ -56,7 +56,7 @@ type Store struct { 2. Iteration efficiently returns the sorted elements within the range 3. Each tree version is immutable and can be retrieved even after a commit(depending on the pruning settings) -Specification and implementation of IAVL tree can be found in [https://github.com/tendermint/iavl]. +Specification and implementation of IAVL tree can be found in . ## GasKV diff --git a/store/streaming/file/README.md b/store/streaming/file/README.md index 3e4a248e1a95..f5e0dab86a3f 100644 --- a/store/streaming/file/README.md +++ b/store/streaming/file/README.md @@ -31,7 +31,7 @@ In order to expose *all* KVStores, we can include `*` in this list. An empty lis 3. `streamers.file.prefix` contains an optional prefix to prepend to the output files to prevent potential collisions with other App `StreamingService` output files. -##### Encoding +### Encoding For each pair of `BeginBlock` requests and responses, a file is created and named `block-{N}-begin`, where N is the block number. At the head of this file the length-prefixed protobuf encoded `BeginBlock` request is written. @@ -55,7 +55,7 @@ In between these two encoded messages, the state changes that occurred due to th a series of length-prefixed protobuf encoded `StoreKVPair`s representing `Set` and `Delete` operations within the KVStores the service is configured to listen to. -##### Decoding +### Decoding To decode the files written in the above format we read all the bytes from a given file into memory and segment them into proto messages based on the length-prefixing of each message. Once segmented, it is known that the first message is the ABCI request, diff --git a/types/address/README.md b/types/address/README.md index 2697548d6dd2..92c092e04680 100644 --- a/types/address/README.md +++ b/types/address/README.md @@ -4,4 +4,4 @@ This package defines Cosmos SDK address-related functions. ## References -+ [ADR-028](../../docs/architecture/adr-028-public-key-addresses.md) +* [ADR-028](../../docs/architecture/adr-028-public-key-addresses.md) diff --git a/x/README.md b/x/README.md index 2b7b78ed0454..32e7b5df8ca0 100644 --- a/x/README.md +++ b/x/README.md @@ -6,21 +6,21 @@ order: 0 Here are some production-grade modules that can be used in Cosmos SDK applications, along with their respective documentation: -- [Auth](auth/spec/README.md) - Authentication of accounts and transactions for Cosmos SDK applications. -- [Authz](authz/spec/README.md) - Authorization for accounts to perform actions on behalf of other accounts. -- [Bank](bank/spec/README.md) - Token transfer functionalities. -- [Capability](capability/spec/README.md) - Object capability implementation. -- [Crisis](crisis/spec/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken). -- [Distribution](distribution/spec/README.md) - Fee distribution, and staking token provision distribution. -- [Epoching](epoching/spec/README.md) - Allows modules to queue messages for execution at a certain block height. -- [Evidence](evidence/spec/README.md) - Evidence handling for double signing, misbehaviour, etc. -- [Feegrant](feegrant/spec/README.md) - Grant fee allowances for executing transactions. -- [Governance](gov/spec/README.md) - On-chain proposals and voting. -- [Mint](mint/spec/README.md) - Creation of new units of staking token. -- [Params](params/spec/README.md) - Globally available parameter store. -- [Slashing](slashing/spec/README.md) - Validator punishment mechanisms. -- [Staking](staking/spec/README.md) - Proof-of-Stake layer for public blockchains. -- [Upgrade](upgrade/spec/README.md) - Software upgrades handling and coordination. +* [Auth](auth/spec/README.md) - Authentication of accounts and transactions for Cosmos SDK applications. +* [Authz](authz/spec/README.md) - Authorization for accounts to perform actions on behalf of other accounts. +* [Bank](bank/spec/README.md) - Token transfer functionalities. +* [Capability](capability/spec/README.md) - Object capability implementation. +* [Crisis](crisis/spec/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken). +* [Distribution](distribution/spec/README.md) - Fee distribution, and staking token provision distribution. +* [Epoching](epoching/spec/README.md) - Allows modules to queue messages for execution at a certain block height. +* [Evidence](evidence/spec/README.md) - Evidence handling for double signing, misbehaviour, etc. +* [Feegrant](feegrant/spec/README.md) - Grant fee allowances for executing transactions. +* [Governance](gov/spec/README.md) - On-chain proposals and voting. +* [Mint](mint/spec/README.md) - Creation of new units of staking token. +* [Params](params/spec/README.md) - Globally available parameter store. +* [Slashing](slashing/spec/README.md) - Validator punishment mechanisms. +* [Staking](staking/spec/README.md) - Proof-of-Stake layer for public blockchains. +* [Upgrade](upgrade/spec/README.md) - Software upgrades handling and coordination. To learn more about the process of building modules, visit the [building modules reference documentation](../docs/building-modules/README.md). diff --git a/x/auth/README.md b/x/auth/README.md index 67aaaf7e710d..6581a5e743ac 100644 --- a/x/auth/README.md +++ b/x/auth/README.md @@ -4,4 +4,4 @@ order: 0 # Auth -- [Auth](spec/README.md) - Authentication of accounts and transactions for Cosmos SDK applications. +* [Auth](spec/README.md) - Authentication of accounts and transactions for Cosmos SDK applications. diff --git a/x/auth/spec/02_state.md b/x/auth/spec/02_state.md index b9008603d158..560e93421f02 100644 --- a/x/auth/spec/02_state.md +++ b/x/auth/spec/02_state.md @@ -15,7 +15,7 @@ Accounts are exposed externally as an interface, and stored internally as either a base account or vesting account. Module clients wishing to add more account types may do so. -- `0x01 | Address -> ProtocolBuffer(account)` +* `0x01 | Address -> ProtocolBuffer(account)` ### Account Interface diff --git a/x/auth/spec/03_antehandlers.md b/x/auth/spec/03_antehandlers.md index ce1dc85c50f1..b695d8597dc5 100644 --- a/x/auth/spec/03_antehandlers.md +++ b/x/auth/spec/03_antehandlers.md @@ -13,28 +13,28 @@ Note that the `AnteHandler` is called on both `CheckTx` and `DeliverTx`, as Tend The auth module provides `AnteDecorator`s that are recursively chained together into a single `AnteHandler` in the following order: -- `SetUpContextDecorator`: Sets the `GasMeter` in the `Context` and wraps the next `AnteHandler` with a defer clause to recover from any downstream `OutOfGas` panics in the `AnteHandler` chain to return an error with information on gas provided and gas used. +* `SetUpContextDecorator`: Sets the `GasMeter` in the `Context` and wraps the next `AnteHandler` with a defer clause to recover from any downstream `OutOfGas` panics in the `AnteHandler` chain to return an error with information on gas provided and gas used. -- `RejectExtensionOptionsDecorator`: Rejects all extension options which can optionally be included in protobuf transactions. +* `RejectExtensionOptionsDecorator`: Rejects all extension options which can optionally be included in protobuf transactions. -- `MempoolFeeDecorator`: Checks if the `tx` fee is above local mempool `minFee` parameter during `CheckTx`. +* `MempoolFeeDecorator`: Checks if the `tx` fee is above local mempool `minFee` parameter during `CheckTx`. -- `ValidateBasicDecorator`: Calls `tx.ValidateBasic` and returns any non-nil error. +* `ValidateBasicDecorator`: Calls `tx.ValidateBasic` and returns any non-nil error. -- `TxTimeoutHeightDecorator`: Check for a `tx` height timeout. +* `TxTimeoutHeightDecorator`: Check for a `tx` height timeout. -- `ValidateMemoDecorator`: Validates `tx` memo with application parameters and returns any non-nil error. +* `ValidateMemoDecorator`: Validates `tx` memo with application parameters and returns any non-nil error. -- `ConsumeGasTxSizeDecorator`: Consumes gas proportional to the `tx` size based on application parameters. +* `ConsumeGasTxSizeDecorator`: Consumes gas proportional to the `tx` size based on application parameters. -- `DeductFeeDecorator`: Deducts the `FeeAmount` from first signer of the `tx`. If the `x/feegrant` module is enabled and a fee granter is set, it deducts fees from the fee granter account. +* `DeductFeeDecorator`: Deducts the `FeeAmount` from first signer of the `tx`. If the `x/feegrant` module is enabled and a fee granter is set, it deducts fees from the fee granter account. -- `SetPubKeyDecorator`: Sets the pubkey from a `tx`'s signers that does not already have its corresponding pubkey saved in the state machine and in the current context. +* `SetPubKeyDecorator`: Sets the pubkey from a `tx`'s signers that does not already have its corresponding pubkey saved in the state machine and in the current context. -- `ValidateSigCountDecorator`: Validates the number of signatures in `tx` based on app-parameters. +* `ValidateSigCountDecorator`: Validates the number of signatures in `tx` based on app-parameters. -- `SigGasConsumeDecorator`: Consumes parameter-defined amount of gas for each signature. This requires pubkeys to be set in context for all signers as part of `SetPubKeyDecorator`. +* `SigGasConsumeDecorator`: Consumes parameter-defined amount of gas for each signature. This requires pubkeys to be set in context for all signers as part of `SetPubKeyDecorator`. -- `SigVerificationDecorator`: Verifies all signatures are valid. This requires pubkeys to be set in context for all signers as part of `SetPubKeyDecorator`. +* `SigVerificationDecorator`: Verifies all signatures are valid. This requires pubkeys to be set in context for all signers as part of `SetPubKeyDecorator`. -- `IncrementSequenceDecorator`: Increments the account sequence for each signer to prevent replay attacks. +* `IncrementSequenceDecorator`: Increments the account sequence for each signer to prevent replay attacks. diff --git a/x/auth/spec/05_vesting.md b/x/auth/spec/05_vesting.md index 29f830ac7b72..06e153157628 100644 --- a/x/auth/spec/05_vesting.md +++ b/x/auth/spec/05_vesting.md @@ -4,28 +4,34 @@ order: 5 # Vesting -- [Vesting](#vesting) - - [Intro and Requirements](#intro-and-requirements) - - [Note](#note) - - [Vesting Account Types](#vesting-account-types) - - [Vesting Account Specification](#vesting-account-specification) - - [Determining Vesting & Vested Amounts](#determining-vesting--vested-amounts) - - [Continuously Vesting Accounts](#continuously-vesting-accounts) - - [Periodic Vesting Accounts](#periodic-vesting-accounts) - - [Delayed/Discrete Vesting Accounts](#delayeddiscrete-vesting-accounts) - - [Transferring/Sending](#transferringsending) - - [Keepers/Handlers](#keepershandlers) - - [Delegating](#delegating) - - [Keepers/Handlers](#keepershandlers-1) - - [Undelegating](#undelegating) - - [Keepers/Handlers](#keepershandlers-2) - - [Keepers & Handlers](#keepers--handlers) - - [Genesis Initialization](#genesis-initialization) - - [Examples](#examples) - - [Simple](#simple) - - [Slashing](#slashing) - - [Periodic Vesting](#periodic-vesting) - - [Glossary](#glossary) +* [Vesting](#vesting) + * [Intro and Requirements](#intro-and-requirements) + * [Note](#note) + * [Vesting Account Types](#vesting-account-types) + * [BaseVestingAccount](#basevestingaccount) + * [ContinuousVestingAccount](#continuousvestingaccount) + * [DelayedVestingAccount](#delayedvestingaccount) + * [Period](#period) + * [PeriodicVestingAccount](#periodicvestingaccount) + * [PermanentLockedAccount](#permanentlockedaccount) + * [Vesting Account Specification](#vesting-account-specification) + * [Determining Vesting & Vested Amounts](#determining-vesting--vested-amounts) + * [Continuously Vesting Accounts](#continuously-vesting-accounts) + * [Periodic Vesting Accounts](#periodic-vesting-accounts) + * [Delayed/Discrete Vesting Accounts](#delayeddiscrete-vesting-accounts) + * [Transferring/Sending](#transferringsending) + * [Keepers/Handlers](#keepershandlers) + * [Delegating](#delegating) + * [Keepers/Handlers](#keepershandlers-1) + * [Undelegating](#undelegating) + * [Keepers/Handlers](#keepershandlers-2) + * [Keepers & Handlers](#keepers--handlers) + * [Genesis Initialization](#genesis-initialization) + * [Examples](#examples) + * [Simple](#simple) + * [Slashing](#slashing) + * [Periodic Vesting](#periodic-vesting) + * [Glossary](#glossary) ## Intro and Requirements @@ -42,10 +48,10 @@ and undelegate from validators, however they cannot transfer coins to another account until those coins are vested. This specification allows for four different kinds of vesting: -- Delayed vesting, where all coins are vested once `ET` is reached. -- Continous vesting, where coins begin to vest at `ST` and vest linearly with +* Delayed vesting, where all coins are vested once `ET` is reached. +* Continous vesting, where coins begin to vest at `ST` and vest linearly with respect to time until `ET` is reached -- Periodic vesting, where coins begin to vest at `ST` and vest periodically +* Periodic vesting, where coins begin to vest at `ST` and vest periodically according to number of periods and the vesting amount per period. The number of periods, length per period, and amount per period are configurable. A periodic vesting account is distinguished from a continuous @@ -53,7 +59,7 @@ vesting account in that coins can be released in staggered tranches. For example, a periodic vesting account could be used for vesting arrangements where coins are relased quarterly, yearly, or over any other function of tokens over time. -- Permanent locked vesting, where coins are locked forever. Coins in this account can +* Permanent locked vesting, where coins are locked forever. Coins in this account can still be used for delegating and for governance votes even while locked. ## Note @@ -94,19 +100,19 @@ type VestingAccount interface { ### BaseVestingAccount -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/vesting/v1beta1/vesting.proto#L10-L33 ++++ ### ContinuousVestingAccount -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/vesting/v1beta1/vesting.proto#L35-L43 ++++ ### DelayedVestingAccount -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/vesting/v1beta1/vesting.proto#L45-L53 ++++ ### Period -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/vesting/v1beta1/vesting.proto#L56-L62 ++++ ```go // Stores all vesting periods passed as part of a PeriodicVestingAccount @@ -116,7 +122,7 @@ type Periods []Period ### PeriodicVestingAccount -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/vesting/v1beta1/vesting.proto#L64-L73 ++++ In order to facilitate less ad-hoc type checking and assertions and to support flexibility in account balance usage, the existing `x/bank` `ViewKeeper` interface @@ -136,23 +142,23 @@ type ViewKeeper interface { ### PermanentLockedAccount -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/vesting/v1beta1/vesting.proto#L78-L83 ++++ ## Vesting Account Specification Given a vesting account, we define the following in the proceeding operations: -- `OV`: The original vesting coin amount. It is a constant value. -- `V`: The number of `OV` coins that are still _vesting_. It is derived by +* `OV`: The original vesting coin amount. It is a constant value. +* `V`: The number of `OV` coins that are still _vesting_. It is derived by `OV`, `StartTime` and `EndTime`. This value is computed on demand and not on a per-block basis. -- `V'`: The number of `OV` coins that are _vested_ (unlocked). This value is +* `V'`: The number of `OV` coins that are _vested_ (unlocked). This value is computed on demand and not a per-block basis. -- `DV`: The number of delegated _vesting_ coins. It is a variable value. It is +* `DV`: The number of delegated _vesting_ coins. It is a variable value. It is stored and modified directly in the vesting account. -- `DF`: The number of delegated _vested_ (unlocked) coins. It is a variable +* `DF`: The number of delegated _vested_ (unlocked) coins. It is a variable value. It is stored and modified directly in the vesting account. -- `BC`: The number of `OV` coins less any coins that are transferred +* `BC`: The number of `OV` coins less any coins that are transferred (which can be negative or delegated). It is considered to be balance of the embedded base account. It is stored and modified directly in the vesting account. @@ -461,7 +467,7 @@ func ToAccount(gacc GenesisAccount) Account { Given a continuous vesting account with 10 vesting coins. -``` +```text OV = 10 DF = 0 DV = 0 @@ -472,33 +478,33 @@ V' = 0 1. Immediately receives 1 coin - ``` + ```text BC = 11 ``` 2. Time passes, 2 coins vest - ``` + ```text V = 8 V' = 2 ``` 3. Delegates 4 coins to validator A - ``` + ```text DV = 4 BC = 7 ``` 4. Sends 3 coins - ``` + ```text BC = 4 ``` 5. More time passes, 2 more coins vest - ``` + ```text V = 6 V' = 4 ``` @@ -506,7 +512,7 @@ V' = 0 6. Sends 2 coins. At this point the account cannot send anymore until further coins vest or it receives additional coins. It can still however, delegate. - ``` + ```text BC = 2 ``` @@ -516,21 +522,21 @@ Same initial starting conditions as the simple example. 1. Time passes, 5 coins vest - ``` + ```text V = 5 V' = 5 ``` 2. Delegate 5 coins to validator A - ``` + ```text DV = 5 BC = 5 ``` 3. Delegate 5 coins to validator B - ``` + ```text DF = 5 BC = 0 ``` @@ -538,7 +544,7 @@ Same initial starting conditions as the simple example. 4. Validator A gets slashed by 50%, making the delegation to A now worth 2.5 coins 5. Undelegate from validator A (2.5 coins) - ``` + ```text DF = 5 - 2.5 = 2.5 BC = 0 + 2.5 = 2.5 ``` @@ -547,7 +553,7 @@ Same initial starting conditions as the simple example. send 2.5 coins unless it receives more coins or until more coins vest. It can still however, delegate. - ``` + ```text DV = 5 - 2.5 = 2.5 DF = 2.5 - 2.5 = 0 BC = 2.5 + 5 = 7.5 @@ -568,7 +574,7 @@ Periods: - amount: 25stake, length: 7884000 ``` -``` +```text OV = 100 DF = 0 DV = 0 @@ -579,46 +585,46 @@ V' = 0 1. Immediately receives 1 coin - ``` + ```text BC = 101 ``` 2. Vesting period 1 passes, 25 coins vest - ``` + ```text V = 75 V' = 25 ``` 3. During vesting period 2, 5 coins are transfered and 5 coins are delegated - ``` + ```text DV = 5 BC = 91 ``` 4. Vesting period 2 passes, 25 coins vest - ``` + ```text V = 50 V' = 50 ``` ## Glossary -- OriginalVesting: The amount of coins (per denomination) that are initially +* OriginalVesting: The amount of coins (per denomination) that are initially part of a vesting account. These coins are set at genesis. -- StartTime: The BFT time at which a vesting account starts to vest. -- EndTime: The BFT time at which a vesting account is fully vested. -- DelegatedFree: The tracked amount of coins (per denomination) that are +* StartTime: The BFT time at which a vesting account starts to vest. +* EndTime: The BFT time at which a vesting account is fully vested. +* DelegatedFree: The tracked amount of coins (per denomination) that are delegated from a vesting account that have been fully vested at time of delegation. -- DelegatedVesting: The tracked amount of coins (per denomination) that are +* DelegatedVesting: The tracked amount of coins (per denomination) that are delegated from a vesting account that were vesting at time of delegation. -- ContinuousVestingAccount: A vesting account implementation that vests coins +* ContinuousVestingAccount: A vesting account implementation that vests coins linearly over time. -- DelayedVestingAccount: A vesting account implementation that only fully vests +* DelayedVestingAccount: A vesting account implementation that only fully vests all coins at a given time. -- PeriodicVestingAccount: A vesting account implementation that vests coins +* PeriodicVestingAccount: A vesting account implementation that vests coins according to a custom vesting schedule. -- PermanentLockedAccount: It does not ever release coins, locking them indefinitely. +* PermanentLockedAccount: It does not ever release coins, locking them indefinitely. Coins in this account can still be used for delegating and for governance votes even while locked. diff --git a/x/auth/spec/README.md b/x/auth/spec/README.md index 1faca6e2734b..789c376e96fd 100644 --- a/x/auth/spec/README.md +++ b/x/auth/spec/README.md @@ -21,26 +21,26 @@ This module is used in the Cosmos Hub. ## Contents 1. **[Concepts](01_concepts.md)** - - [Gas & Fees](01_concepts.md#gas-&-fees) + * [Gas & Fees](01_concepts.md#gas-&-fees) 2. **[State](02_state.md)** - - [Accounts](02_state.md#accounts) + * [Accounts](02_state.md#accounts) 3. **[AnteHandlers](03_antehandlers.md)** - - [Handlers](03_antehandlers.md#handlers) + * [Handlers](03_antehandlers.md#handlers) 4. **[Keepers](04_keepers.md)** - - [Account Keeper](04_keepers.md#account-keeper) + * [Account Keeper](04_keepers.md#account-keeper) 5. **[Vesting](05_vesting.md)** - - [Intro and Requirements](05_vesting.md#intro-and-requirements) - - [Vesting Account Types](05_vesting.md#vesting-account-types) - - [Vesting Account Specification](05_vesting.md#vesting-account-specification) - - [Keepers & Handlers](05_vesting.md#keepers-&-handlers) - - [Genesis Initialization](05_vesting.md#genesis-initialization) - - [Examples](05_vesting.md#examples) - - [Glossary](05_vesting.md#glossary) + * [Intro and Requirements](05_vesting.md#intro-and-requirements) + * [Vesting Account Types](05_vesting.md#vesting-account-types) + * [Vesting Account Specification](05_vesting.md#vesting-account-specification) + * [Keepers & Handlers](05_vesting.md#keepers-&-handlers) + * [Genesis Initialization](05_vesting.md#genesis-initialization) + * [Examples](05_vesting.md#examples) + * [Glossary](05_vesting.md#glossary) 6. **[Parameters](06_params.md)** 7. **[Client](07_client.md)** - - **[Auth](07_client.md#auth)** - - [CLI](07_client.md#cli) - - [gRPC](07_client.md#grpc) - - [REST](07_client.md#rest) - - **[Vesting](07_client.md#vesting)** - - [CLI](07_client.md#vesting#cli) + * **[Auth](07_client.md#auth)** + * [CLI](07_client.md#cli) + * [gRPC](07_client.md#grpc) + * [REST](07_client.md#rest) + * **[Vesting](07_client.md#vesting)** + * [CLI](07_client.md#vesting#cli) diff --git a/x/authz/README.md b/x/authz/README.md index 904cc3755c06..a4e6fcca3c9f 100644 --- a/x/authz/README.md +++ b/x/authz/README.md @@ -4,4 +4,4 @@ order: 0 # Authz -- [Authz](spec/README.md) - Authorization for accounts to perform actions on behalf of other accounts. +* [Authz](spec/README.md) - Authorization for accounts to perform actions on behalf of other accounts. diff --git a/x/authz/spec/01_concepts.md b/x/authz/spec/01_concepts.md index a93348097107..7776ae237069 100644 --- a/x/authz/spec/01_concepts.md +++ b/x/authz/spec/01_concepts.md @@ -14,7 +14,7 @@ Authorization is an interface that must be implemented by a concrete authorizati **Note:** The authz module is different from the [auth (authentication)](../modules/auth/) module that is responsible for specifying the base transaction and account types. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/authz/authorizations.go#L11-L25 ++++ ## Built-in Authorizations @@ -24,29 +24,29 @@ The Cosmos SDK `x/authz` module comes with following authorization types: `GenericAuthorization` implements the `Authorization` interface that gives unrestricted permission to execute the provided Msg on behalf of granter's account. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/authz/v1beta1/authz.proto#L14-L19 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/authz/generic_authorization.go#L18-L31 ++++ -- `msg` stores Msg type URL. +* `msg` stores Msg type URL. ### SendAuthorization `SendAuthorization` implements the `Authorization` interface for the `cosmos.bank.v1beta1.MsgSend` Msg. It takes a `SpendLimit` that specifies the maximum amount of tokens the grantee can spend. The `SpendLimit` is updated as the tokens are spent. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/bank/v1beta1/authz.proto#L10-L19 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/bank/types/send_authorization.go#L25-L40 ++++ -- `spend_limit` keeps track of how many coins are left in the authorization. +* `spend_limit` keeps track of how many coins are left in the authorization. ### StakeAuthorization `StakeAuthorization` implements the `Authorization` interface for messages in the [staking module](https://docs.cosmos.network/v0.44/modules/staking/). It takes an `AuthorizationType` to specify whether you want to authorise delegating, undelegating or redelegating (i.e. these have to be authorised seperately). It also takes a `MaxTokens` that keeps track of a limit to the amount of tokens that can be delegated/undelegated/redelegated. If left empty, the amount is unlimited. Additionally, this Msg takes an `AllowList` and a `DenyList`, which allows you to select which validators you allow grantees to stake with. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/staking/v1beta1/authz.proto#L11-L31 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/x/staking/types/authz.go#L18-L38 ++++ ## Gas diff --git a/x/authz/spec/02_state.md b/x/authz/spec/02_state.md index 5b07f645a120..2a7e3aa403b9 100644 --- a/x/authz/spec/02_state.md +++ b/x/authz/spec/02_state.md @@ -8,8 +8,8 @@ order: 2 Grants are identified by combining granter address (the address bytes of the granter), grantee address (the address bytes of the grantee) and Authorization type (its type URL). Hence we only allow one grant for the (granter, grantee, Authorization) triple. -- Grant: `0x01 | granter_address_len (1 byte) | granter_address_bytes | grantee_address_len (1 byte) | grantee_address_bytes | msgType_bytes-> ProtocolBuffer(AuthorizationGrant)` +* Grant: `0x01 | granter_address_len (1 byte) | granter_address_bytes | grantee_address_len (1 byte) | grantee_address_bytes | msgType_bytes-> ProtocolBuffer(AuthorizationGrant)` The grant object encapsulates an `Authorization` type and an expiration timestamp: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/authz/v1beta1/authz.proto#L21-L26 ++++ diff --git a/x/authz/spec/03_messages.md b/x/authz/spec/03_messages.md index 7ff1b7548aca..e4da7203b507 100644 --- a/x/authz/spec/03_messages.md +++ b/x/authz/spec/03_messages.md @@ -11,25 +11,25 @@ In this section we describe the processing of messages for the authz module. An authorization grant is created using the `MsgGrant` message. If there is already a grant for the `(granter, grantee, Authorization)` triple, then the new grant overwrites the previous one. To update or extend an existing grant, a new grant with the same `(granter, grantee, Authorization)` triple should be created. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/authz/v1beta1/tx.proto#L32-L37 ++++ The message handling should fail if: -- both granter and grantee have the same address. -- provided `Expiration` time is less than current unix timestamp. -- provided `Grant.Authorization` is not implemented. -- `Authorization.MsgTypeURL()` is not defined in the router (there is no defined handler in the app router to handle that Msg types). +* both granter and grantee have the same address. +* provided `Expiration` time is less than current unix timestamp. +* provided `Grant.Authorization` is not implemented. +* `Authorization.MsgTypeURL()` is not defined in the router (there is no defined handler in the app router to handle that Msg types). ## MsgRevoke A grant can be removed with the `MsgRevoke` message. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/authz/v1beta1/tx.proto#L60-L64 ++++ The message handling should fail if: -- both granter and grantee have the same address. -- provided `MsgTypeUrl` is empty. +* both granter and grantee have the same address. +* provided `MsgTypeUrl` is empty. NOTE: The `MsgExec` message removes a grant if the grant has expired. @@ -37,10 +37,10 @@ NOTE: The `MsgExec` message removes a grant if the grant has expired. When a grantee wants to execute a transaction on behalf of a granter, they must send `MsgExec`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-beta1/proto/cosmos/authz/v1beta1/tx.proto#L47-L53 ++++ The message handling should fail if: -- provided `Authorization` is not implemented. -- grantee doesn't have permission to run the transaction. -- if granted authorization is expired. +* provided `Authorization` is not implemented. +* grantee doesn't have permission to run the transaction. +* if granted authorization is expired. diff --git a/x/authz/spec/README.md b/x/authz/spec/README.md index 85461871ea5f..3eda2ae6ab8c 100644 --- a/x/authz/spec/README.md +++ b/x/authz/spec/README.md @@ -15,16 +15,16 @@ parent: granting arbitrary privileges from one account (the granter) to another account (the grantee). Authorizations must be granted for a particular Msg service method one by one using an implementation of the `Authorization` interface. 1. **[Concept](01_concepts.md)** - - [Authorization and Grant](01_concepts.md#Authorization-and-Grant) - - [Built-in Authorizations](01_concepts.md#Built-in-Authorizations) - - [Gas](01_concepts.md#gas) + * [Authorization and Grant](01_concepts.md#Authorization-and-Grant) + * [Built-in Authorizations](01_concepts.md#Built-in-Authorizations) + * [Gas](01_concepts.md#gas) 2. **[State](02_state.md)** 3. **[Messages](03_messages.md)** - - [MsgGrant](03_messages.md#MsgGrant) - - [MsgRevoke](03_messages.md#MsgRevoke) - - [MsgExec](03_messages.md#MsgExec) + * [MsgGrant](03_messages.md#MsgGrant) + * [MsgRevoke](03_messages.md#MsgRevoke) + * [MsgExec](03_messages.md#MsgExec) 4. **[Events](04_events.md)** 5. **[Client](05_client.md)** - - [CLI](05_client.md#cli) - - [gRPC](05_client.md#grpc) - - [REST](05_client.md#rest) + * [CLI](05_client.md#cli) + * [gRPC](05_client.md#grpc) + * [REST](05_client.md#rest) diff --git a/x/bank/README.md b/x/bank/README.md index 2964523ae4d8..6c1412840a0f 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -4,4 +4,4 @@ order: 0 # Bank -- [Bank](spec/README.md) - Token transfer functionalities. +* [Bank](spec/README.md) - Token transfer functionalities. diff --git a/x/bank/atlas/atlas-v0.39.1.md b/x/bank/atlas/atlas-v0.39.1.md index bdd6d15089c2..55c086ac7927 100644 --- a/x/bank/atlas/atlas-v0.39.1.md +++ b/x/bank/atlas/atlas-v0.39.1.md @@ -140,7 +140,7 @@ The `x/bank` supports the following transactional commands. 1. Send tokens via a `MsgSend` message. - ```shell + ```sh app tx send [from_key_or_address] [to_address] [amount] [...flags] ``` @@ -155,8 +155,8 @@ endpoint. 1. Construct an unsigned `MsgSend` transaction. - | Method | Path | - | :----- | :----------------------- | + | Method | Path | + | :----- | :----------------------------------- | | `POST` | `/bank/accounts/{address}/transfers` | Sample payload: @@ -185,9 +185,9 @@ endpoint. 2. Query for an account's balance. - | Method | Path | - | :----- | :----------------------- | - | `GET` | `/bank/balances/{address}` | + | Method | Path | + | :----- | :------------------------- | + | `GET` | `/bank/balances/{address}` | Sample response: diff --git a/x/bank/spec/01_state.md b/x/bank/spec/01_state.md index 97584ca1abb6..f24725242bf3 100644 --- a/x/bank/spec/01_state.md +++ b/x/bank/spec/01_state.md @@ -13,7 +13,7 @@ The `x/bank` module keeps state of three primary objects: In addition, the `x/bank` module keeps the following indexes to manage the aforementioned state: -- Supply Index: `0x0 | byte(denom) -> byte(amount)` -- Denom Metadata Index: `0x1 | byte(denom) -> ProtocolBuffer(Metadata)` -- Balances Index: `0x2 | byte(address length) | []byte(address) | []byte(balance.Denom) -> ProtocolBuffer(balance)` -- Reverse Denomination to Address Index: `0x03 | byte(denom) | 0x00 | []byte(address) -> 0` +* Supply Index: `0x0 | byte(denom) -> byte(amount)` +* Denom Metadata Index: `0x1 | byte(denom) -> ProtocolBuffer(Metadata)` +* Balances Index: `0x2 | byte(address length) | []byte(address) | []byte(balance.Denom) -> ProtocolBuffer(balance)` +* Reverse Denomination to Address Index: `0x03 | byte(denom) | 0x00 | []byte(address) -> 0` diff --git a/x/bank/spec/03_messages.md b/x/bank/spec/03_messages.md index 61f83abf3d80..23590bf00c74 100644 --- a/x/bank/spec/03_messages.md +++ b/x/bank/spec/03_messages.md @@ -7,21 +7,21 @@ order: 3 ## MsgSend Send coins from one address to another. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L19-L28 ++++ The message will fail under the following conditions: -- The coins do not have sending enabled -- The `to` address is restricted +* The coins do not have sending enabled +* The `to` address is restricted ## MsgMultiSend Send coins from and to a series of different address. If any of the receiving addresses do not correspond to an existing account, a new account is created. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/bank/v1beta1/tx.proto#L33-L39 ++++ The message will fail under the following conditions: -- Any of the coins do not have sending enabled -- Any of the `to` addresses are restricted -- Any of the coins are locked -- The inputs and outputs do not correctly correspond to one another +* Any of the coins do not have sending enabled +* Any of the `to` addresses are restricted +* Any of the coins are locked +* The inputs and outputs do not correctly correspond to one another diff --git a/x/bank/spec/06_client.md b/x/bank/spec/06_client.md index 077e950e8baf..2377b0d92021 100644 --- a/x/bank/spec/06_client.md +++ b/x/bank/spec/06_client.md @@ -12,7 +12,7 @@ A user can query and interact with the `bank` module using the CLI. The `query` commands allow users to query `bank` state. -``` +```sh simd query bank --help ``` @@ -20,19 +20,19 @@ simd query bank --help The `balances` command allows users to query account balances by address. -``` +```sh simd query bank balances [address] [flags] ``` Example: -``` +```sh simd query bank balances cosmos1.. ``` Example Output: -``` +```yml balances: - amount: "1000000000" denom: stake @@ -45,19 +45,19 @@ pagination: The `denom-metadata` command allows users to query metadata for coin denominations. A user can query metadata for a single denomination using the `--denom` flag or all denominations without it. -``` +```sh simd query bank denom-metadata [flags] ``` Example: -``` +```sh simd query bank denom-metadata --denom stake ``` Example Output: -``` +```yml metadata: base: stake denom_units: @@ -74,19 +74,19 @@ metadata: The `total` command allows users to query the total supply of coins. A user can query the total supply for a single coin using the `--denom` flag or all coins without it. -``` +```sh simd query bank total [flags] ``` Example: -``` +```sh simd query bank total --denom stake ``` Example Output: -``` +```yml amount: "10000000000" denom: stake ``` @@ -95,7 +95,7 @@ denom: stake The `tx` commands allow users to interact with the `bank` module. -``` +```sh simd tx bank --help ``` @@ -103,13 +103,13 @@ simd tx bank --help The `send` command allows users to send funds from one account to another. -``` +```sh simd tx bank send [from_key_or_address] [to_address] [amount] [flags] ``` Example: -``` +```sh simd tx bank send cosmos1.. cosmos1.. 100stake ``` @@ -121,13 +121,13 @@ A user can query the `bank` module using gRPC endpoints. The `Balance` endpoint allows users to query account balance by address for a given denomination. -``` +```sh cosmos.bank.v1beta1.Query/Balance ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"address":"cosmos1..","denom":"stake"}' \ localhost:9090 \ @@ -136,7 +136,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "balance": { "denom": "stake", @@ -149,13 +149,13 @@ Example Output: The `AllBalances` endpoint allows users to query account balance by address for all denominations. -``` +```sh cosmos.bank.v1beta1.Query/AllBalances ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"address":"cosmos1.."}' \ localhost:9090 \ @@ -164,7 +164,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "balances": [ { @@ -182,13 +182,13 @@ Example Output: The `DenomMetadata` endpoint allows users to query metadata for a single coin denomination. -``` +```sh cosmos.bank.v1beta1.Query/DenomMetadata ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"denom":"stake"}' \ localhost:9090 \ @@ -197,7 +197,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "metadata": { "description": "native staking token of simulation app", @@ -221,13 +221,13 @@ Example Output: The `DenomsMetadata` endpoint allows users to query metadata for all coin denominations. -``` +```sh cosmos.bank.v1beta1.Query/DenomsMetadata ``` Example: -``` +```sh grpcurl -plaintext \ localhost:9090 \ cosmos.bank.v1beta1.Query/DenomsMetadata @@ -235,7 +235,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "metadatas": [ { @@ -264,13 +264,13 @@ Example Output: The `DenomOwners` endpoint allows users to query metadata for a single coin denomination. -``` +```sh cosmos.bank.v1beta1.Query/DenomOwners ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"denom":"stake"}' \ localhost:9090 \ @@ -279,7 +279,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "denomOwners": [ { @@ -307,13 +307,13 @@ Example Output: The `TotalSupply` endpoint allows users to query the total supply of all coins. -``` +```sh cosmos.bank.v1beta1.Query/TotalSupply ``` Example: -``` +```sh grpcurl -plaintext \ localhost:9090 \ cosmos.bank.v1beta1.Query/TotalSupply @@ -321,7 +321,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "supply": [ { @@ -339,13 +339,13 @@ Example Output: The `SupplyOf` endpoint allows users to query the total supply of a single coin. -``` +```sh cosmos.bank.v1beta1.Query/SupplyOf ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"denom":"stake"}' \ localhost:9090 \ @@ -354,7 +354,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "amount": { "denom": "stake", @@ -367,13 +367,13 @@ Example Output: The `Params` endpoint allows users to query the parameters of the `bank` module. -``` +```sh cosmos.bank.v1beta1.Query/Params ``` Example: -``` +```sh grpcurl -plaintext \ localhost:9090 \ cosmos.bank.v1beta1.Query/Params @@ -381,7 +381,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "params": { "defaultSendEnabled": true diff --git a/x/bank/spec/README.md b/x/bank/spec/README.md index c9b19ccae690..caec29e290c9 100644 --- a/x/bank/spec/README.md +++ b/x/bank/spec/README.md @@ -26,9 +26,9 @@ This module will be used in the Cosmos Hub. The `supply` functionality: -- passively tracks the total supply of coins within a chain, -- provides a pattern for modules to hold/interact with `Coins`, and -- introduces the invariant check to verify a chain's total supply. +* passively tracks the total supply of coins within a chain, +* provides a pattern for modules to hold/interact with `Coins`, and +* introduces the invariant check to verify a chain's total supply. ### Total Supply @@ -68,10 +68,10 @@ The supply `Keeper` also introduces new wrapper functions for the auth `Keeper` and the bank `Keeper` that are related to `ModuleAccount`s in order to be able to: -- Get and set `ModuleAccount`s by providing the `Name`. -- Send coins from and to other `ModuleAccount`s or standard `Account`s +* Get and set `ModuleAccount`s by providing the `Name`. +* Send coins from and to other `ModuleAccount`s or standard `Account`s (`BaseAccount` or `VestingAccount`) by passing only the `Name`. -- `Mint` or `Burn` coins for a `ModuleAccount` (restricted to its permissions). +* `Mint` or `Burn` coins for a `ModuleAccount` (restricted to its permissions). ### Permissions @@ -83,23 +83,23 @@ permissions to that specific account and perform or not the action. The available permissions are: -- `Minter`: allows for a module to mint a specific amount of coins. -- `Burner`: allows for a module to burn a specific amount of coins. -- `Staking`: allows for a module to delegate and undelegate a specific amount of coins. +* `Minter`: allows for a module to mint a specific amount of coins. +* `Burner`: allows for a module to burn a specific amount of coins. +* `Staking`: allows for a module to delegate and undelegate a specific amount of coins. ## Contents 1. **[State](01_state.md)** 2. **[Keepers](02_keepers.md)** - - [Common Types](02_keepers.md#common-types) - - [BaseKeeper](02_keepers.md#basekeeper) - - [SendKeeper](02_keepers.md#sendkeeper) - - [ViewKeeper](02_keepers.md#viewkeeper) + * [Common Types](02_keepers.md#common-types) + * [BaseKeeper](02_keepers.md#basekeeper) + * [SendKeeper](02_keepers.md#sendkeeper) + * [ViewKeeper](02_keepers.md#viewkeeper) 3. **[Messages](03_messages.md)** - - [MsgSend](03_messages.md#msgsend) + * [MsgSend](03_messages.md#msgsend) 4. **[Events](04_events.md)** - - [Handlers](04_events.md#handlers) + * [Handlers](04_events.md#handlers) 5. **[Parameters](05_params.md)** 6. **[Client](06_client.md)** - - [CLI](06_client.md#cli) - - [gRPC](06_client.md#grpc) + * [CLI](06_client.md#cli) + * [gRPC](06_client.md#grpc) diff --git a/x/capability/README.md b/x/capability/README.md index d7a0ae2e892a..258df71fbf7a 100644 --- a/x/capability/README.md +++ b/x/capability/README.md @@ -4,4 +4,4 @@ order: 0 # Capability -- [Capability](spec/README.md) - Object capability implementation. +* [Capability](spec/README.md) - Object capability implementation. diff --git a/x/capability/spec/01_concepts.md b/x/capability/spec/01_concepts.md index 7751df4c0817..bb236a21ea86 100644 --- a/x/capability/spec/01_concepts.md +++ b/x/capability/spec/01_concepts.md @@ -31,4 +31,4 @@ not own. ## Stores -- MemStore +* MemStore diff --git a/x/crisis/README.md b/x/crisis/README.md index 2d811fa10375..e67297b0852e 100644 --- a/x/crisis/README.md +++ b/x/crisis/README.md @@ -4,4 +4,4 @@ order: 0 # Crisis -- [Crisis](spec/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken). +* [Crisis](spec/README.md) - Halting the blockchain under certain circumstances (e.g. if an invariant is broken). diff --git a/x/crisis/spec/01_state.md b/x/crisis/spec/01_state.md index 1efc7fe04ff8..50003e63dbdc 100644 --- a/x/crisis/spec/01_state.md +++ b/x/crisis/spec/01_state.md @@ -14,4 +14,4 @@ with the standard gas consumption method. The ConstantFee param is held in the global params store. -- Params: `mint/params -> legacy_amino(sdk.Coin)` +* Params: `mint/params -> legacy_amino(sdk.Coin)` diff --git a/x/crisis/spec/02_messages.md b/x/crisis/spec/02_messages.md index 640d2c46159d..c06d56aac344 100644 --- a/x/crisis/spec/02_messages.md +++ b/x/crisis/spec/02_messages.md @@ -11,12 +11,12 @@ corresponding updates to the state. Blockchain invariants can be checked using the `MsgVerifyInvariant` message. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc7/proto/cosmos/crisis/v1beta1/tx.proto#L14-L22 ++++ This message is expected to fail if: -- the sender does not have enough coins for the constant fee -- the invariant route is not registered +* the sender does not have enough coins for the constant fee +* the invariant route is not registered This message checks the invariant provided, and if the invariant is broken it panics, halting the blockchain. If the invariant is broken, the constant fee is diff --git a/x/crisis/spec/README.md b/x/crisis/spec/README.md index 358fe38e3da6..79d688b4168f 100644 --- a/x/crisis/spec/README.md +++ b/x/crisis/spec/README.md @@ -16,11 +16,11 @@ application initialization process. ## Contents 1. **[State](01_state.md)** - - [ConstantFee](01_state.md#constantfee) + * [ConstantFee](01_state.md#constantfee) 2. **[Messages](02_messages.md)** - - [MsgVerifyInvariant](02_messages.md#msgverifyinvariant) + * [MsgVerifyInvariant](02_messages.md#msgverifyinvariant) 3. **[Events](03_events.md)** - - [Handlers](03_events.md#handlers) + * [Handlers](03_events.md#handlers) 4. **[Parameters](04_params.md)** 5. **[Client](05_client.md)** - - [CLI](05_client.md#cli) + * [CLI](05_client.md#cli) diff --git a/x/distribution/README.md b/x/distribution/README.md index b3f136913ad8..2c542da71611 100644 --- a/x/distribution/README.md +++ b/x/distribution/README.md @@ -4,4 +4,4 @@ order: 0 # Distribution -- [Distribution](spec/README.md) - Fee distribution, and staking token provision distribution. +* [Distribution](spec/README.md) - Fee distribution, and staking token provision distribution. diff --git a/x/distribution/spec/02_state.md b/x/distribution/spec/02_state.md index df85f3f7eda2..06e0f5b125ca 100644 --- a/x/distribution/spec/02_state.md +++ b/x/distribution/spec/02_state.md @@ -15,7 +15,7 @@ for fractions of coins to be received from operations like inflation. When coins are distributed from the pool they are truncated back to `sdk.Coins` which are non-decimal. -- FeePool: `0x00 -> ProtocolBuffer(FeePool)` +* FeePool: `0x00 -> ProtocolBuffer(FeePool)` ```go // coins with decimal @@ -27,7 +27,7 @@ type DecCoin struct { } ``` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/distribution/v1beta1/distribution.proto#L94-L101 ++++ ## Validator Distribution @@ -38,7 +38,7 @@ Validator distribution information for the relevant validator is updated each ti 3. any delegator withdraws from a validator, or 4. the validator withdraws its commission. -- ValidatorDistInfo: `0x02 | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(validatorDistribution)` +* ValidatorDistInfo: `0x02 | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(validatorDistribution)` ```go type ValidatorDistInfo struct { @@ -56,7 +56,7 @@ properties change (aka bonded tokens etc.) its properties will remain constant and the delegator's _accumulation_ factor can be calculated passively knowing only the height of the last withdrawal and its current properties. -- DelegationDistInfo: `0x02 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(delegatorDist)` +* DelegationDistInfo: `0x02 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValOperatorAddrLen (1 byte) | ValOperatorAddr -> ProtocolBuffer(delegatorDist)` ```go type DelegationDistInfo struct { diff --git a/x/distribution/spec/03_begin_block.md b/x/distribution/spec/03_begin_block.md index bf279759da7e..0b68aa7963eb 100644 --- a/x/distribution/spec/03_begin_block.md +++ b/x/distribution/spec/03_begin_block.md @@ -9,9 +9,9 @@ the distribution `ModuleAccount` account. When a delegator or validator withdraws their rewards, they are taken out of the `ModuleAccount`. During begin block, the different claims on the fees collected are updated as follows: -- The block proposer of the previous height and its delegators receive between 1% and 5% of fee rewards. -- The reserve community tax is charged. -- The remainder is distributed proportionally by voting power to all bonded validators +* The block proposer of the previous height and its delegators receive between 1% and 5% of fee rewards. +* The reserve community tax is charged. +* The remainder is distributed proportionally by voting power to all bonded validators To incentivize validators to wait and include additional pre-commits in the block, the block proposer reward is calculated from Tendermint pre-commit messages. @@ -45,7 +45,7 @@ only bonded validators can supply valid precommits) and is always larger than Any remaining fees are distributed among all the bonded validators, including the proposer, in proportion to their consensus power. -``` +```text powFrac = validator power / total bonded validator power proposerMul = baseproposerreward + bonusproposerreward * P voteMul = 1 - communitytax - proposerMul @@ -79,7 +79,7 @@ blocks. Then hold `(precommits included) / (total bonded validator power)` constant so that the amortized block reward for the validator is `( validator power / total bonded power) * (1 - community tax rate)` of the total rewards. Consequently, the reward for a single delegator is: -``` +```text (delegator proportion of the validator power / validator power) * (validator power / total bonded power) * (1 - community tax rate) * (1 - validator commision rate) = (delegator proportion of the validator power / total bonded power) * (1 - diff --git a/x/distribution/spec/04_messages.md b/x/distribution/spec/04_messages.md index 65fde1af039a..74bf027c6c80 100644 --- a/x/distribution/spec/04_messages.md +++ b/x/distribution/spec/04_messages.md @@ -13,7 +13,7 @@ The withdraw address cannot be any of the module accounts. These accounts are bl Response: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L29-L37 ++++ ```go func (k Keeper) SetWithdrawAddr(ctx sdk.Context, delegatorAddr sdk.AccAddress, withdrawAddr sdk.AccAddress) error @@ -47,7 +47,7 @@ Taking the slashes into account requires iteration. Let `F(X)` be the fraction a validator is to be slashed for a slashing event that happened at period `X`. If the validator was slashed at periods `P1, ..., PN`, where `A < P1`, `PN < B`, the distribution module calculates the individual delegator's rewards, `T(A, B)`, as follows: -``` +```go stake := initial stake rewards := 0 previous := A @@ -63,7 +63,7 @@ The final calculated stake is equivalent to the actual staked coins in the deleg Response: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.42.4/proto/cosmos/distribution/v1beta1/tx.proto#L42-L50 ++++ ## WithdrawValidatorCommission diff --git a/x/distribution/spec/05_hooks.md b/x/distribution/spec/05_hooks.md index 417a0cc08ff1..a1702ef73b0b 100644 --- a/x/distribution/spec/05_hooks.md +++ b/x/distribution/spec/05_hooks.md @@ -8,15 +8,15 @@ Available hooks that can be called by and from this module. ## Create or modify delegation distribution -- triggered-by: `staking.MsgDelegate`, `staking.MsgBeginRedelegate`, `staking.MsgUndelegate` +* triggered-by: `staking.MsgDelegate`, `staking.MsgBeginRedelegate`, `staking.MsgUndelegate` ### Before -- The delegation rewards are withdrawn to the withdraw address of the delegator. +* The delegation rewards are withdrawn to the withdraw address of the delegator. The rewards include the current period and exclude the starting period. -- The validator period is incremented. +* The validator period is incremented. The validator period is incremented because the validator's power and share distribution might have changed. -- The reference count for the delegator's starting period is decremented. +* The reference count for the delegator's starting period is decremented. ### After @@ -25,21 +25,21 @@ Because of the `Before`-hook, this period is the last period for which the deleg ## Validator created -- triggered-by: `staking.MsgCreateValidator` +* triggered-by: `staking.MsgCreateValidator` When a validator is created, the following validator variables are initialized: -- Historical rewards -- Current accumulated rewards -- Accumulated commission -- Total outstanding rewards -- Period +* Historical rewards +* Current accumulated rewards +* Accumulated commission +* Total outstanding rewards +* Period By default, all values are set to a `0`, except period, which is set to `1`. ## Validator removed -- triggered-by: `staking.RemoveValidator` +* triggered-by: `staking.RemoveValidator` Outstanding commission is sent to the validator's self-delegation withdrawal address. Remaining delegator rewards get sent to the community fee pool. @@ -50,10 +50,10 @@ Any remaining rewards are dust amounts. ## Validator is slashed -- triggered-by: `staking.Slash` +* triggered-by: `staking.Slash` -- The current validator period reference count is incremented. +* The current validator period reference count is incremented. The reference count is incremented because the slash event has created a reference to it. -- The validator period is incremented. -- The slash event is stored for later use. +* The validator period is incremented. +* The slash event is stored for later use. The slash event will be referenced when calculating delegator rewards. diff --git a/x/distribution/spec/08_client.md b/x/distribution/spec/08_client.md index 0e80a2f2d431..8e547ba46926 100644 --- a/x/distribution/spec/08_client.md +++ b/x/distribution/spec/08_client.md @@ -12,7 +12,7 @@ A user can query and interact with the `distribution` module using the CLI. The `query` commands allow users to query `distribution` state. -``` +```sh simd query distribution --help ``` @@ -20,19 +20,19 @@ simd query distribution --help The `commission` command allows users to query validator commission rewards by address. -``` +```sh simd query distribution commission [address] [flags] ``` Example: -``` +```sh simd query distribution commission cosmosvaloper1.. ``` Example Output: -``` +```yml commission: - amount: "1000000.000000000000000000" denom: stake @@ -42,19 +42,19 @@ commission: The `community-pool` command allows users to query all coin balances within the community pool. -``` +```sh simd query distribution community-pool [flags] ``` Example: -``` +```sh simd query distribution community-pool ``` Example Output: -``` +```yml pool: - amount: "1000000.000000000000000000" denom: stake @@ -64,19 +64,19 @@ pool: The `params` command allows users to query the parameters of the `distribution` module. -``` +```sh simd query distribution params [flags] ``` Example: -``` +```sh simd query distribution params ``` Example Output: -``` +```yml base_proposer_reward: "0.010000000000000000" bonus_proposer_reward: "0.040000000000000000" community_tax: "0.020000000000000000" @@ -87,19 +87,19 @@ withdraw_addr_enabled: true The `rewards` command allows users to query delegator rewards. Users can optionally include the validator address to query rewards earned from a specific validator. -``` +```sh simd query distribution rewards [delegator-addr] [validator-addr] [flags] ``` Example: -``` +```sh simd query distribution rewards cosmos1.. ``` Example Output: -``` +```yml rewards: - reward: - amount: "1000000.000000000000000000" @@ -114,19 +114,19 @@ total: The `slashes` command allows users to query all slashes for a given block range. -``` +```sh simd query distribution slashes [validator] [start-height] [end-height] [flags] ``` Example: -``` +```sh simd query distribution slashes cosmosvaloper1.. 1 1000 ``` Example Output: -``` +```yml pagination: next_key: null total: "0" @@ -139,19 +139,19 @@ slashes: The `validator-outstanding-rewards` command allows users to query all outstanding (un-withdrawn) rewards for a validator and all their delegations. -``` +```sh simd query distribution validator-outstanding-rewards [validator] [flags] ``` Example: -``` +```sh simd query distribution validator-outstanding-rewards cosmosvaloper1.. ``` Example Output: -``` +```yml rewards: - amount: "1000000.000000000000000000" denom: stake @@ -161,7 +161,7 @@ rewards: The `tx` commands allow users to interact with the `distribution` module. -``` +```sh simd tx distribution --help ``` @@ -169,13 +169,13 @@ simd tx distribution --help The `fund-community-pool` command allows users to send funds to the community pool. -``` +```sh simd tx distribution fund-community-pool [amount] [flags] ``` Example: -``` +```sh simd tx distribution fund-community-pool 100stake --from cosmos1.. ``` @@ -183,13 +183,13 @@ simd tx distribution fund-community-pool 100stake --from cosmos1.. The `set-withdraw-addr` command allows users to set the withdraw address for rewards associated with a delegator address. -``` +```sh simd tx distribution set-withdraw-addr [withdraw-addr] [flags] ``` Example: -``` +```sh simd tx distribution set-withdraw-addr cosmos1.. --from cosmos1.. ``` @@ -197,13 +197,13 @@ simd tx distribution set-withdraw-addr cosmos1.. --from cosmos1.. The `withdraw-all-rewards` command allows users to withdraw all rewards for a delegator. -``` +```sh simd tx distribution withdraw-all-rewards [flags] ``` Example: -``` +```sh simd tx distribution withdraw-all-rewards --from cosmos1.. ``` @@ -212,13 +212,13 @@ simd tx distribution withdraw-all-rewards --from cosmos1.. The `withdraw-rewards` command allows users to withdraw all rewards from a given delegation address, and optionally withdraw validator commission if the delegation address given is a validator operator and the user proves the `--commision` flag. -``` +```sh simd tx distribution withdraw-rewards [validator-addr] [flags] ``` Example: -``` +```sh simd tx distribution withdraw-rewards cosmosvaloper1.. --from cosmos1.. --commision ``` @@ -232,7 +232,7 @@ The `Params` endpoint allows users to query parameters of the `distribution` mod Example: -``` +```sh grpcurl -plaintext \ localhost:9090 \ cosmos.distribution.v1beta1.Query/Params @@ -240,7 +240,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "params": { "communityTax": "20000000000000000", @@ -257,7 +257,7 @@ The `ValidatorOutstandingRewards` endpoint allows users to query rewards of a va Example: -``` +```sh grpcurl -plaintext \ -d '{"validator_address":"cosmosvalop1.."}' \ localhost:9090 \ @@ -266,7 +266,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "rewards": { "rewards": [ @@ -285,7 +285,7 @@ The `ValidatorCommission` endpoint allows users to query accumulated commission Example: -``` +```sh grpcurl -plaintext \ -d '{"validator_address":"cosmosvalop1.."}' \ localhost:9090 \ @@ -294,7 +294,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "commission": { "commission": [ @@ -313,7 +313,7 @@ The `ValidatorSlashes` endpoint allows users to query slash events of a validato Example: -``` +```sh grpcurl -plaintext \ -d '{"validator_address":"cosmosvalop1.."}' \ localhost:9090 \ @@ -322,7 +322,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "slashes": [ { @@ -342,7 +342,7 @@ The `DelegationRewards` endpoint allows users to query the total rewards accrued Example: -``` +```sh grpcurl -plaintext \ -d '{"delegator_address":"cosmos1..","validator_address":"cosmosvalop1.."}' \ localhost:9090 \ @@ -351,7 +351,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "rewards": [ { @@ -368,7 +368,7 @@ The `DelegationTotalRewards` endpoint allows users to query the total rewards ac Example: -``` +```sh grpcurl -plaintext \ -d '{"delegator_address":"cosmos1.."}' \ localhost:9090 \ @@ -377,7 +377,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "rewards": [ { @@ -405,7 +405,7 @@ The `DelegatorValidators` endpoint allows users to query all validators for give Example: -``` +```sh grpcurl -plaintext \ -d '{"delegator_address":"cosmos1.."}' \ localhost:9090 \ @@ -414,7 +414,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "validators": [ "cosmosvaloper1.." @@ -428,7 +428,7 @@ The `DelegatorWithdrawAddress` endpoint allows users to query the withdraw addre Example: -``` +```sh grpcurl -plaintext \ -d '{"delegator_address":"cosmos1.."}' \ localhost:9090 \ @@ -437,7 +437,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "withdrawAddress": "cosmos1.." } @@ -449,7 +449,7 @@ The `CommunityPool` endpoint allows users to query the community pool coins. Example: -``` +```sh grpcurl -plaintext \ localhost:9090 \ cosmos.distribution.v1beta1.Query/CommunityPool @@ -457,7 +457,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "pool": [ { diff --git a/x/distribution/spec/README.md b/x/distribution/spec/README.md index f8fdb8285540..c5a841ceb7c3 100644 --- a/x/distribution/spec/README.md +++ b/x/distribution/spec/README.md @@ -22,12 +22,12 @@ and validator proposer-reward pool. Due to the nature of passive accounting, whenever changes to parameters which affect the rate of reward distribution occurs, withdrawal of rewards must also occur. -- Whenever withdrawing, one must withdraw the maximum amount they are entitled +* Whenever withdrawing, one must withdraw the maximum amount they are entitled to, leaving nothing in the pool. -- Whenever bonding, unbonding, or re-delegating tokens to an existing account, a +* Whenever bonding, unbonding, or re-delegating tokens to an existing account, a full withdrawal of the rewards must occur (as the rules for lazy accounting change). -- Whenever a validator chooses to change the commission on rewards, all accumulated +* Whenever a validator chooses to change the commission on rewards, all accumulated commission rewards must be simultaneously withdrawn. The above scenarios are covered in `hooks.md`. @@ -35,10 +35,10 @@ The above scenarios are covered in `hooks.md`. The distribution mechanism outlined herein is used to lazily distribute the following rewards between validators and associated delegators: -- multi-token fees to be socially distributed -- proposer reward pool -- inflated atom provisions -- validator commission on all rewards earned by their delegators stake +* multi-token fees to be socially distributed +* proposer reward pool +* inflated atom provisions +* validator commission on all rewards earned by their delegators stake Fees are pooled within a global pool, as well as validator specific proposer-reward pools. The mechanisms used allow for validators and delegators @@ -50,7 +50,7 @@ As a part of the lazy computations, each delegator holds an accumulation term specific to each validator which is used to estimate what their approximate fair portion of tokens held in the global fee pool is owed to them. -``` +```text entitlement = delegator-accumulation / all-delegators-accumulation ``` @@ -85,22 +85,22 @@ to set up a script to periodically withdraw and rebond rewards. ## Contents 1. **[Concepts](01_concepts.md)** - - [Reference Counting in F1 Fee Distribution](01_concepts.md#reference-counting-in-f1-fee-distribution) + * [Reference Counting in F1 Fee Distribution](01_concepts.md#reference-counting-in-f1-fee-distribution) 2. **[State](02_state.md)** 3. **[Begin Block](03_begin_block.md)** 4. **[Messages](04_messages.md)** - - [MsgSetWithdrawAddress](04_messages.md#msgsetwithdrawaddress) - - [MsgWithdrawDelegatorReward](04_messages.md#msgwithdrawdelegatorreward) - - [Withdraw Validator Rewards All](04_messages.md#withdraw-validator-rewards-all) - - [Common calculations](04_messages.md#common-calculations-) + * [MsgSetWithdrawAddress](04_messages.md#msgsetwithdrawaddress) + * [MsgWithdrawDelegatorReward](04_messages.md#msgwithdrawdelegatorreward) + * [Withdraw Validator Rewards All](04_messages.md#withdraw-validator-rewards-all) + * [Common calculations](04_messages.md#common-calculations-) 5. **[Hooks](05_hooks.md)** - - [Create or modify delegation distribution](05_hooks.md#create-or-modify-delegation-distribution) - - [Commission rate change](05_hooks.md#commission-rate-change) - - [Change in Validator State](05_hooks.md#change-in-validator-state) + * [Create or modify delegation distribution](05_hooks.md#create-or-modify-delegation-distribution) + * [Commission rate change](05_hooks.md#commission-rate-change) + * [Change in Validator State](05_hooks.md#change-in-validator-state) 6. **[Events](06_events.md)** - - [BeginBlocker](06_events.md#beginblocker) - - [Handlers](06_events.md#handlers) + * [BeginBlocker](06_events.md#beginblocker) + * [Handlers](06_events.md#handlers) 7. **[Parameters](07_params.md)** 8. **[Parameters](07_params.md)** - - [CLI](08_client.md#cli) - - [gRPC](08_client.md#grpc) + * [CLI](08_client.md#cli) + * [gRPC](08_client.md#grpc) diff --git a/x/epoching/README.md b/x/epoching/README.md index 7796fc1a4cd1..a7fbf3df82da 100644 --- a/x/epoching/README.md +++ b/x/epoching/README.md @@ -4,4 +4,4 @@ order: 0 # Epoching -- [Epoching](epoching/spec/README.md) - Allows modules to queue messages for execution at a certain block height. +* [Epoching](epoching/spec/README.md) - Allows modules to queue messages for execution at a certain block height. diff --git a/x/epoching/spec/01_state.md b/x/epoching/spec/01_state.md index 485dace71158..9f8672aa3a29 100644 --- a/x/epoching/spec/01_state.md +++ b/x/epoching/spec/01_state.md @@ -52,7 +52,7 @@ We execute epoch after execution of genesis transactions to see the changes inst ## Execution on epochs -- Try executing the message for the epoch -- If success, make changes as it is -- If failure, try making revert extra actions done on handlers (e.g. EpochDelegationPool deposit) -- If revert fail, panic +* Try executing the message for the epoch +* If success, make changes as it is +* If failure, try making revert extra actions done on handlers (e.g. EpochDelegationPool deposit) +* If revert fail, panic diff --git a/x/epoching/spec/03_to_improve.md b/x/epoching/spec/03_to_improve.md index 5ee5bd2ad0d5..4794faafc292 100644 --- a/x/epoching/spec/03_to_improve.md +++ b/x/epoching/spec/03_to_improve.md @@ -8,10 +8,10 @@ order: 3 Cases that trigger unbonding process -- Validator undelegate can unbond more tokens than his minimum_self_delegation and it will automatically turn the validator into unbonding +* Validator undelegate can unbond more tokens than his minimum_self_delegation and it will automatically turn the validator into unbonding In this case, unbonding should start instantly. -- Validator miss blocks and get slashed -- Validator get slashed for double sign +* Validator miss blocks and get slashed +* Validator get slashed for double sign **Note:** When a validator begins the unbonding process, it could be required to turn the validator into unbonding state instantly. This is different than a specific delegator beginning to unbond. A validator beginning to unbond means that it's not in the set any more. diff --git a/x/evidence/README.md b/x/evidence/README.md index 8db5c1845345..7cdd2926c66c 100644 --- a/x/evidence/README.md +++ b/x/evidence/README.md @@ -4,4 +4,4 @@ order: 0 # Evidence -- [Evidence](spec/README.md) - Evidence handling for double signing, misbehaviour, etc. +* [Evidence](spec/README.md) - Evidence handling for double signing, misbehaviour, etc. diff --git a/x/evidence/spec/06_begin_block.md b/x/evidence/spec/06_begin_block.md index 5a04d19886a5..1c335d1e46b8 100644 --- a/x/evidence/spec/06_begin_block.md +++ b/x/evidence/spec/06_begin_block.md @@ -13,8 +13,8 @@ Tendermint blocks can include The Cosmos SDK handles two types of evidence inside the ABCI `BeginBlock`: -- `DuplicateVoteEvidence`, -- `LightClientAttackEvidence`. +* `DuplicateVoteEvidence`, +* `LightClientAttackEvidence`. The evidence module handles these two evidence types the same way. First, the Cosmos SDK converts the Tendermint concrete evidence type to an SDK `Evidence` interface using `Equivocation` as the concrete type. @@ -34,8 +34,8 @@ For some `Equivocation` submitted in `block` to be valid, it must satisfy: Where: -- `Evidence.Timestamp` is the timestamp in the block at height `Evidence.Height` -- `block.Timestamp` is the current block timestamp. +* `Evidence.Timestamp` is the timestamp in the block at height `Evidence.Height` +* `block.Timestamp` is the current block timestamp. If valid `Equivocation` evidence is included in a block, the validator's stake is reduced (slashed) by `SlashFractionDoubleSign` as defined by the `x/slashing` module diff --git a/x/feegrant/README.md b/x/feegrant/README.md index c80c8931c4b0..99cde43c0345 100644 --- a/x/feegrant/README.md +++ b/x/feegrant/README.md @@ -4,4 +4,4 @@ order: 0 # Fee Grant -- [Fee Grant](spec/README.md) - Grant fee allowances for executing transactions. +* [Fee Grant](spec/README.md) - Grant fee allowances for executing transactions. diff --git a/x/feegrant/spec/01_concepts.md b/x/feegrant/spec/01_concepts.md index 16af82792020..a7b7de00ad7b 100644 --- a/x/feegrant/spec/01_concepts.md +++ b/x/feegrant/spec/01_concepts.md @@ -8,58 +8,58 @@ order: 1 `Grant` is stored in the KVStore to record a grant with full context. Every grant will contain `granter`, `grantee` and what kind of `allowance` is granted. `granter` is an account address who is giving permission to `grantee` (the beneficiary account address) to pay for some or all of `grantee`'s transaction fees. `allowance` defines what kind of fee allowance (`BasicAllowance` or `PeriodicAllowance`, see below) is granted to `grantee`. `allowance` accepts an interface which implements `FeeAllowanceI`, encoded as `Any` type. There can be only one existing fee grant allowed for a `grantee` and `granter`, self grants are not allowed. -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/proto/cosmos/feegrant/v1beta1/feegrant.proto#L75-L81 ++++ `FeeAllowanceI` looks like: -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/x/feegrant/fees.go#L9-L32 ++++ ## Fee Allowance types There are two types of fee allowances present at the moment: -- `BasicAllowance` -- `PeriodicAllowance` +* `BasicAllowance` +* `PeriodicAllowance` ## BasicAllowance `BasicAllowance` is permission for `grantee` to use fee from a `granter`'s account. If any of the `spend_limit` or `expiration` reaches its limit, the grant will be removed from the state. -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/proto/cosmos/feegrant/v1beta1/feegrant.proto#L13-L26 ++++ -- `spend_limit` is the limit of coins that are allowed to be used from the `granter` account. If it is empty, it assumes there's no spend limit, `grantee` can use any number of available tokens from `granter` account address before the expiration. +* `spend_limit` is the limit of coins that are allowed to be used from the `granter` account. If it is empty, it assumes there's no spend limit, `grantee` can use any number of available tokens from `granter` account address before the expiration. -- `expiration` specifies an optional time when this allowance expires. If the value is left empty, there is no expiry for the grant. +* `expiration` specifies an optional time when this allowance expires. If the value is left empty, there is no expiry for the grant. -- When a grant is created with empty values for `spend_limit` and `expiration`, it is still a valid grant. It won't restrict the `grantee` to use any number of tokens from `granter` and it won't have any expiration. The only way to restrict the `grantee` is by revoking the grant. +* When a grant is created with empty values for `spend_limit` and `expiration`, it is still a valid grant. It won't restrict the `grantee` to use any number of tokens from `granter` and it won't have any expiration. The only way to restrict the `grantee` is by revoking the grant. ## PeriodicAllowance `PeriodicAllowance` is a repeating fee allowance for the mentioned period, we can mention when the grant can expire as well as when a period can reset. We can also define the maximum number of coins that can be used in a mentioned period of time. -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/proto/cosmos/feegrant/v1beta1/feegrant.proto#L28-L73 ++++ -- `basic` is the instance of `BasicAllowance` which is optional for periodic fee allowance. If empty, the grant will have no `expiration` and no `spend_limit`. +* `basic` is the instance of `BasicAllowance` which is optional for periodic fee allowance. If empty, the grant will have no `expiration` and no `spend_limit`. -- `period` is the specific period of time, after each period passes, `period_spend_limit` will be reset. +* `period` is the specific period of time, after each period passes, `period_spend_limit` will be reset. -- `period_spend_limit` specifies the maximum number of coins that can be spent in the period. +* `period_spend_limit` specifies the maximum number of coins that can be spent in the period. -- `period_can_spend` is the number of coins left to be spent before the period_reset time. +* `period_can_spend` is the number of coins left to be spent before the period_reset time. -- `period_reset` keeps track of when a next period reset should happen. +* `period_reset` keeps track of when a next period reset should happen. ## FeeGranter flag `feegrant` module introduces a `FeeGranter` flag for CLI for the sake of executing transactions with fee granter. When this flag is set, `clientCtx` will append the granter account address for transactions generated through CLI. -+++ https://github.com/cosmos/cosmos-sdk/blob/d97e7907f176777ed8a464006d360bb3e1a223e4/client/cmd.go#L224-L235 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/d97e7907f176777ed8a464006d360bb3e1a223e4/client/tx/tx.go#L120 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/d97e7907f176777ed8a464006d360bb3e1a223e4/x/auth/tx/builder.go#L268-L277 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/d97e7907f176777ed8a464006d360bb3e1a223e4/proto/cosmos/tx/v1beta1/tx.proto#L160-L181 ++++ Example cmd: @@ -79,4 +79,4 @@ In order to prevent DoS attacks, using a filtered `x/feegrant` incurs gas. The S ## Pruning -A queue in the state maintained with the prefix of expiration of the grants and checks them on EndBlock with the current block time for every block to prune. \ No newline at end of file +A queue in the state maintained with the prefix of expiration of the grants and checks them on EndBlock with the current block time for every block to prune. diff --git a/x/feegrant/spec/02_state.md b/x/feegrant/spec/02_state.md index 47106e006818..ce2b50958566 100644 --- a/x/feegrant/spec/02_state.md +++ b/x/feegrant/spec/02_state.md @@ -10,9 +10,9 @@ Fee Allowances are identified by combining `Grantee` (the account address of fee Fee allowance grants are stored in the state as follows: -- Grant: `0x00 | grantee_addr_len (1 byte) | grantee_addr_bytes | granter_addr_len (1 byte) | granter_addr_bytes -> ProtocolBuffer(Grant)` +* Grant: `0x00 | grantee_addr_len (1 byte) | grantee_addr_bytes | granter_addr_len (1 byte) | granter_addr_bytes -> ProtocolBuffer(Grant)` -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/x/feegrant/feegrant.pb.go#L221-L229 ++++ ## FeeAllowanceQueue @@ -20,4 +20,4 @@ Fee Allowances queue items are identified by combining the `FeeAllowancePrefixQu Fee allowance queue keys are stored in the state as follows: -- Grant: `0x01 | expiration_bytes | grantee_addr_len (1 byte) | grantee_addr_bytes | granter_addr_len (1 byte) | granter_addr_bytes -> EmptyBytes` \ No newline at end of file +* Grant: `0x01 | expiration_bytes | grantee_addr_len (1 byte) | grantee_addr_bytes | granter_addr_len (1 byte) | granter_addr_bytes -> EmptyBytes` diff --git a/x/feegrant/spec/03_messages.md b/x/feegrant/spec/03_messages.md index 602dd2b7125a..133112a5f8b2 100644 --- a/x/feegrant/spec/03_messages.md +++ b/x/feegrant/spec/03_messages.md @@ -8,10 +8,10 @@ order: 3 A fee allowance grant will be created with the `MsgGrantAllowance` message. -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/proto/cosmos/feegrant/v1beta1/tx.proto#L22-L33 ++++ ## Msg/RevokeAllowance An allowed grant fee allowance can be removed with the `MsgRevokeAllowance` message. -+++ https://github.com/cosmos/cosmos-sdk/blob/691032b8be0f7539ec99f8882caecefc51f33d1f/proto/cosmos/feegrant/v1beta1/tx.proto#L38-L45 ++++ diff --git a/x/feegrant/spec/04_events.md b/x/feegrant/spec/04_events.md index 55012f8c689d..e443558f7c54 100644 --- a/x/feegrant/spec/04_events.md +++ b/x/feegrant/spec/04_events.md @@ -8,26 +8,26 @@ The feegrant module emits the following events: # Msg Server -### MsgGrantAllowance +## MsgGrantAllowance -| Type | Attribute Key | Attribute Value | -| -------- | ------------- | ------------------ | -| message | action | set_feegrant | -| message | granter | {granterAddress} | -| message | grantee | {granteeAddress} | +| Type | Attribute Key | Attribute Value | +| ------- | ------------- | ---------------- | +| message | action | set_feegrant | +| message | granter | {granterAddress} | +| message | grantee | {granteeAddress} | -### MsgRevokeAllowance +## MsgRevokeAllowance -| Type | Attribute Key | Attribute Value | -| -------- | ------------- | ------------------ | -| message | action | revoke_feegrant | -| message | granter | {granterAddress} | -| message | grantee | {granteeAddress} | +| Type | Attribute Key | Attribute Value | +| ------- | ------------- | ---------------- | +| message | action | revoke_feegrant | +| message | granter | {granterAddress} | +| message | grantee | {granteeAddress} | -### Exec fee allowance +## Exec fee allowance -| Type | Attribute Key | Attribute Value | -| -------- | ------------- | ------------------ | -| message | action | use_feegrant | -| message | granter | {granterAddress} | -| message | grantee | {granteeAddress} | +| Type | Attribute Key | Attribute Value | +| ------- | ------------- | ---------------- | +| message | action | use_feegrant | +| message | granter | {granterAddress} | +| message | grantee | {granteeAddress} | diff --git a/x/feegrant/spec/05_client.md b/x/feegrant/spec/05_client.md index dbb5005bca64..52c1d97268f1 100644 --- a/x/feegrant/spec/05_client.md +++ b/x/feegrant/spec/05_client.md @@ -12,7 +12,7 @@ A user can query and interact with the `feegrant` module using the CLI. The `query` commands allow users to query `feegrant` state. -``` +```sh simd query feegrant --help ``` @@ -20,19 +20,19 @@ simd query feegrant --help The `grant` command allows users to query a grant for a given granter-grantee pair. -``` +```sh simd query feegrant grant [granter] [grantee] [flags] ``` Example: -``` +```sh simd query feegrant grant cosmos1.. cosmos1.. ``` Example Output: -``` +```yml allowance: '@type': /cosmos.feegrant.v1beta1.BasicAllowance expiration: null @@ -47,19 +47,19 @@ granter: cosmos1.. The `grants` command allows users to query all grants for a given grantee. -``` +```sh simd query feegrant grants [grantee] [flags] ``` Example: -``` +```sh simd query feegrant grants cosmos1.. ``` Example Output: -``` +```yml allowances: - allowance: '@type': /cosmos.feegrant.v1beta1.BasicAllowance @@ -78,7 +78,7 @@ pagination: The `tx` commands allow users to interact with the `feegrant` module. -``` +```sh simd tx feegrant --help ``` @@ -86,19 +86,19 @@ simd tx feegrant --help The `grant` command allows users to grant fee allowances to another account. The fee allowance can have an expiration date, a total spend limit, and/or a periodic spend limit. -``` +```sh simd tx feegrant grant [granter] [grantee] [flags] ``` Example (one-time spend limit): -``` +```sh simd tx feegrant grant cosmos1.. cosmos1.. --spend-limit 100stake ``` Example (periodic spend limit): -``` +```sh simd tx feegrant grant cosmos1.. cosmos1.. --period 3600 --period-limit 10stake ``` @@ -106,13 +106,13 @@ simd tx feegrant grant cosmos1.. cosmos1.. --period 3600 --period-limit 10stake The `revoke` command allows users to revoke a granted fee allowance. -``` +```sh simd tx feegrant revoke [granter] [grantee] [flags] ``` Example: -``` +```sh simd tx feegrant revoke cosmos1.. cosmos1.. ``` @@ -124,13 +124,13 @@ A user can query the `feegrant` module using gRPC endpoints. The `Allowance` endpoint allows users to query a granted fee allowance. -``` +```sh cosmos.feegrant.v1beta1.Query/Allowance ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"grantee":"cosmos1..","granter":"cosmos1.."}' \ localhost:9090 \ @@ -139,7 +139,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "allowance": { "granter": "cosmos1..", @@ -153,13 +153,13 @@ Example Output: The `Allowances` endpoint allows users to query all granted fee allowances for a given grantee. -``` +```sh cosmos.feegrant.v1beta1.Query/Allowances ``` Example: -``` +```sh grpcurl -plaintext \ -d '{"address":"cosmos1.."}' \ localhost:9090 \ @@ -168,7 +168,7 @@ grpcurl -plaintext \ Example Output: -``` +```json { "allowances": [ { diff --git a/x/feegrant/spec/README.md b/x/feegrant/spec/README.md index a31be94afd7d..b8f646f4d991 100644 --- a/x/feegrant/spec/README.md +++ b/x/feegrant/spec/README.md @@ -5,6 +5,8 @@ parent: title: "feegrant" --> +# Fee grant + ## Abstract This document specifies the fee grant module. For the full ADR, please see [Fee Grant ADR-029](https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/docs/architecture/adr-029-fee-grant-module.md). @@ -14,22 +16,22 @@ This module allows accounts to grant fee allowances and to use fees from their a ## Contents 1. **[Concepts](01_concepts.md)** - - [Grant](01_concepts.md#grant) - - [Fee Allowance types](01_concepts.md#fee-allowance-types) - - [BasicAllowance](01_concepts.md#basicallowance) - - [PeriodicAllowance](01_concepts.md#periodicallowance) - - [FeeAccount flag](01_concepts.md#feeaccount-flag) - - [Granted Fee Deductions](01_concepts.md#granted-fee-deductions) - - [Gas](01_concepts.md#gas) + * [Grant](01_concepts.md#grant) + * [Fee Allowance types](01_concepts.md#fee-allowance-types) + * [BasicAllowance](01_concepts.md#basicallowance) + * [PeriodicAllowance](01_concepts.md#periodicallowance) + * [FeeAccount flag](01_concepts.md#feeaccount-flag) + * [Granted Fee Deductions](01_concepts.md#granted-fee-deductions) + * [Gas](01_concepts.md#gas) 2. **[State](02_state.md)** - - [FeeAllowance](02_state.md#feeallowance) + * [FeeAllowance](02_state.md#feeallowance) 3. **[Messages](03_messages.md)** - - [Msg/GrantAllowance](03_messages.md#msggrantallowance) - - [Msg/RevokeAllowance](03_messages.md#msgrevokeallowance) + * [Msg/GrantAllowance](03_messages.md#msggrantallowance) + * [Msg/RevokeAllowance](03_messages.md#msgrevokeallowance) 4. **[Events](04_events.md)** - - [MsgGrantAllowance](04_events.md#msggrantallowance) - - [MsgRevokeAllowance](04_events.md#msgrevokeallowance) - - [Exec fee allowance](04_events.md#exec-fee-allowance) + * [MsgGrantAllowance](04_events.md#msggrantallowance) + * [MsgRevokeAllowance](04_events.md#msgrevokeallowance) + * [Exec fee allowance](04_events.md#exec-fee-allowance) 5. **[Client](05_client.md)** - - [CLI](05_client.md#cli) - - [gRPC](05_client.md#grpc) + * [CLI](05_client.md#cli) + * [gRPC](05_client.md#grpc) diff --git a/x/gov/README.md b/x/gov/README.md index 540b435d2823..66ab133646f0 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -4,4 +4,4 @@ order: 0 # Governance -- [Governance](spec/README.md) - On-chain proposals and voting. +* [Governance](spec/README.md) - On-chain proposals and voting. diff --git a/x/gov/spec/01_concepts.md b/x/gov/spec/01_concepts.md index ed895973e102..2168b0f2d571 100644 --- a/x/gov/spec/01_concepts.md +++ b/x/gov/spec/01_concepts.md @@ -8,12 +8,12 @@ _Disclaimer: This is work in progress. Mechanisms are susceptible to change._ The governance process is divided in a few steps that are outlined below: -- **Proposal submission:** Proposal is submitted to the blockchain with a +* **Proposal submission:** Proposal is submitted to the blockchain with a deposit. -- **Vote:** Once deposit reaches a certain value (`MinDeposit`), proposal is +* **Vote:** Once deposit reaches a certain value (`MinDeposit`), proposal is confirmed and vote opens. Bonded Atom holders can then send `TxGovVote` transactions to vote on the proposal. -- **Execution** After a period of time, the votes are tallied and depending +* **Execution** After a period of time, the votes are tallied and depending on the result, the messages in the proposal will be executed. ## Proposal submission @@ -58,13 +58,13 @@ proposal is finalized (passed or rejected). When a proposal is finalized, the coins from the deposit are either refunded or burned according to the final tally of the proposal: -- If the proposal is approved or rejected but _not_ vetoed, each deposit will be +* If the proposal is approved or rejected but _not_ vetoed, each deposit will be automatically refunded to its respective depositor (transferred from the governance `ModuleAccount`). -- When the proposal is vetoed with greater than 1/3, deposits will be burned from the +* When the proposal is vetoed with greater than 1/3, deposits will be burned from the governance `ModuleAccount` and the proposal information along with its deposit information will be removed from state. -- All refunded or burned deposits are removed from the state. Events are issued when +* All refunded or burned deposits are removed from the state. Events are issued when burning or refunding a deposit. ## Voting @@ -79,9 +79,9 @@ can submit and deposit on proposals. Note that some _participants_ can be forbidden to vote on a proposal under a certain validator if: -- _participant_ bonded or unbonded Atoms to said validator after proposal +* _participant_ bonded or unbonded Atoms to said validator after proposal entered voting period. -- _participant_ became validator after proposal entered voting period. +* _participant_ became validator after proposal entered voting period. This does not prevent _participant_ to vote with Atoms bonded to other validators. For example, if a _participant_ bonded some Atoms to validator A @@ -104,10 +104,10 @@ choose from when casting its vote. The initial option set includes the following options: -- `Yes` -- `No` -- `NoWithVeto` -- `Abstain` +* `Yes` +* `No` +* `NoWithVeto` +* `Abstain` `NoWithVeto` counts as `No` but also adds a `Veto` vote. `Abstain` option allows voters to signal that they do not intend to vote in favor or against the @@ -124,9 +124,9 @@ Often times the entity owning that address might not be a single individual. For To represent weighted vote on chain, we use the following Protobuf message. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-alpha1/proto/cosmos/gov/v1beta1/gov.proto#L32-L40 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.43.0-alpha1/proto/cosmos/gov/v1beta1/gov.proto#L126-L137 ++++ For a weighted vote to be valid, the `options` field must not contain duplicate vote options, and the sum of weights of all options must be equal to 1. @@ -151,9 +151,9 @@ votes). If a delegator does not vote, it will inherit its validator vote. -- If the delegator votes before its validator, it will not inherit from the +* If the delegator votes before its validator, it will not inherit from the validator's vote. -- If the delegator votes after its validator, it will override its validator +* If the delegator votes after its validator, it will override its validator vote with its own. If the proposal is urgent, it is possible that the vote will close before delegators have a chance to react and override their validator's vote. This is not a problem, as proposals require more than 2/3rd of the total voting power to pass before the end of the voting period. If more than 2/3rd of validators collude, they can censor the votes of delegators anyway. @@ -193,4 +193,4 @@ Once a block contains more than 2/3rd _precommits_ where a common nodes, non-validating full nodes and light-nodes) are expected to switch to the new version of the software. -_Note: Not clear how the flip is handled programmatically_ +_Note: Not clear how the flip is handled programmatically._ diff --git a/x/gov/spec/02_state.md b/x/gov/spec/02_state.md index 311676bb15ff..6e648f0a26a1 100644 --- a/x/gov/spec/02_state.md +++ b/x/gov/spec/02_state.md @@ -12,7 +12,7 @@ to resolve and then execute if the proposal passes. `Proposal`'s are identified unique id and contains a series of timestamps: `submit_time`, `deposit_end_time`, `voting_start_time`, `voting_end_time` which track the lifecycle of a proposal -+++ https://github.com/cosmos/cosmos-sdk/blob/4a129832eb16f37a89e97652a669f0cdc9196ca9/proto/cosmos/gov/v1beta2/gov.proto#L42-L52 ++++ A proposal will generally require more than just a set of messages to explain its purpose but need some greater justification and allow a means for interested participants @@ -58,15 +58,15 @@ parameter set has to be created and the previous one rendered inactive. ### DepositParams -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/gov/v1beta1/gov.proto#L127-L145 ++++ ### VotingParams -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/gov/v1beta1/gov.proto#L147-L156 ++++ ### TallyParams -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/gov/v1beta1/gov.proto#L158-L183 ++++ Parameters are stored in a global `GlobalParams` KVStore. @@ -104,7 +104,7 @@ const ( ## Deposit -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/gov/v1beta1/gov.proto#L43-L53 ++++ ## ValidatorGovInfo @@ -124,21 +124,21 @@ parameter in the list_` We will use one KVStore `Governance` to store two mappings: -- A mapping from `proposalID|'proposal'` to `Proposal`. -- A mapping from `proposalID|'addresses'|address` to `Vote`. This mapping allows +* A mapping from `proposalID|'proposal'` to `Proposal`. +* A mapping from `proposalID|'addresses'|address` to `Vote`. This mapping allows us to query all addresses that voted on the proposal along with their vote by doing a range query on `proposalID:addresses`. For pseudocode purposes, here are the two function we will use to read or write in stores: -- `load(StoreKey, Key)`: Retrieve item stored at key `Key` in store found at key `StoreKey` in the multistore -- `store(StoreKey, Key, value)`: Write value `Value` at key `Key` in store found at key `StoreKey` in the multistore +* `load(StoreKey, Key)`: Retrieve item stored at key `Key` in store found at key `StoreKey` in the multistore +* `store(StoreKey, Key, value)`: Write value `Value` at key `Key` in store found at key `StoreKey` in the multistore ## Proposal Processing Queue **Store:** -- `ProposalProcessingQueue`: A queue `queue[proposalID]` containing all the +* `ProposalProcessingQueue`: A queue `queue[proposalID]` containing all the `ProposalIDs` of proposals that reached `MinDeposit`. During each `EndBlock`, all the proposals that have reached the end of their voting period are processed. To process a finished proposal, the application tallies the votes, computes the diff --git a/x/gov/spec/03_messages.md b/x/gov/spec/03_messages.md index 714edd544240..69d095903435 100644 --- a/x/gov/spec/03_messages.md +++ b/x/gov/spec/03_messages.md @@ -9,7 +9,7 @@ order: 3 Proposals can be submitted by any account via a `MsgSubmitProposal` transaction. -+++ https://github.com/cosmos/cosmos-sdk/blob/ab9545527d630fe38761aa61cc5c95eabd68e0e6/proto/cosmos/gov/v1beta2/tx.proto#L34-L44 ++++ All `sdk.Msgs` passed into the `messages` field of a `MsgSubmitProposal` message must be registered in the app's `MsgServiceRouter`. Each of these messages must @@ -18,13 +18,13 @@ must not be larger than the `maxMetadataLen` config passed into the gov keeper. **State modifications:** -- Generate new `proposalID` -- Create new `Proposal` -- Initialise `Proposal`'s attributes -- Decrease balance of sender by `InitialDeposit` -- If `MinDeposit` is reached: - - Push `proposalID` in `ProposalProcessingQueue` -- Transfer `InitialDeposit` from the `Proposer` to the governance `ModuleAccount` +* Generate new `proposalID` +* Create new `Proposal` +* Initialise `Proposal`'s attributes +* Decrease balance of sender by `InitialDeposit` +* If `MinDeposit` is reached: + * Push `proposalID` in `ProposalProcessingQueue` +* Transfer `InitialDeposit` from the `Proposer` to the governance `ModuleAccount` A `MsgSubmitProposal` transaction can be handled according to the following pseudocode. @@ -78,16 +78,16 @@ Once a proposal is submitted, if `Proposal.TotalDeposit < ActiveParam.MinDeposit`, Atom holders can send `MsgDeposit` transactions to increase the proposal's deposit. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/gov/v1beta1/tx.proto#L61-L72 ++++ **State modifications:** -- Decrease balance of sender by `deposit` -- Add `deposit` of sender in `proposal.Deposits` -- Increase `proposal.TotalDeposit` by sender's `deposit` -- If `MinDeposit` is reached: - - Push `proposalID` in `ProposalProcessingQueueEnd` -- Transfer `Deposit` from the `proposer` to the governance `ModuleAccount` +* Decrease balance of sender by `deposit` +* Add `deposit` of sender in `proposal.Deposits` +* Increase `proposal.TotalDeposit` by sender's `deposit` +* If `MinDeposit` is reached: + * Push `proposalID` in `ProposalProcessingQueueEnd` +* Transfer `Deposit` from the `proposer` to the governance `ModuleAccount` A `MsgDeposit` transaction has to go through a number of checks to be valid. These checks are outlined in the following pseudocode. @@ -144,13 +144,13 @@ Once `ActiveParam.MinDeposit` is reached, voting period starts. From there, bonded Atom holders are able to send `MsgVote` transactions to cast their vote on the proposal. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/gov/v1beta1/tx.proto#L46-L56 ++++ **State modifications:** -- Record `Vote` of sender +* Record `Vote` of sender -_Note: Gas cost for this message has to take into account the future tallying of the vote in EndBlocker_ +_Note: Gas cost for this message has to take into account the future tallying of the vote in EndBlocker._ Next is a pseudocode outline of the way `MsgVote` transactions are handled: diff --git a/x/gov/spec/04_events.md b/x/gov/spec/04_events.md index 300d4d187c80..3c0d72ce987d 100644 --- a/x/gov/spec/04_events.md +++ b/x/gov/spec/04_events.md @@ -29,7 +29,7 @@ The governance module emits the following events: | message | action | submit_proposal | | message | sender | {senderAddress} | -- [0] Event only emitted if the voting period starts during the submission. +* [0] Event only emitted if the voting period starts during the submission. ### MsgVote @@ -62,4 +62,4 @@ The governance module emits the following events: | message | action | deposit | | message | sender | {senderAddress} | -- [0] Event only emitted if the voting period starts during the submission. +* [0] Event only emitted if the voting period starts during the submission. diff --git a/x/gov/spec/README.md b/x/gov/spec/README.md index c1cbf6fa20ba..897e9f936097 100644 --- a/x/gov/spec/README.md +++ b/x/gov/spec/README.md @@ -18,12 +18,12 @@ system. In this system, holders of the native staking token of the chain can vot on proposals on a 1 token 1 vote basis. Next is a list of features the module currently supports: -- **Proposal submission:** Users can submit proposals with a deposit. Once the +* **Proposal submission:** Users can submit proposals with a deposit. Once the minimum deposit is reached, proposal enters voting period -- **Vote:** Participants can vote on proposals that reached MinDeposit -- **Inheritance and penalties:** Delegators inherit their validator's vote if +* **Vote:** Participants can vote on proposals that reached MinDeposit +* **Inheritance and penalties:** Delegators inherit their validator's vote if they don't vote themselves. -- **Claiming deposit:** Users that deposited on proposals can recover their +* **Claiming deposit:** Users that deposited on proposals can recover their deposits if the proposal was accepted OR if the proposal never entered voting period. This module will be used in the Cosmos Hub, the first Hub in the Cosmos network. @@ -36,26 +36,26 @@ can be adapted to any Proof-Of-Stake blockchain by replacing *ATOM* with the nat staking token of the chain. 1. **[Concepts](01_concepts.md)** - - [Proposal submission](01_concepts.md#proposal-submission) - - [Vote](01_concepts.md#vote) - - [Software Upgrade](01_concepts.md#software-upgrade) + * [Proposal submission](01_concepts.md#proposal-submission) + * [Vote](01_concepts.md#vote) + * [Software Upgrade](01_concepts.md#software-upgrade) 2. **[State](02_state.md)** - - [Parameters and base types](02_state.md#parameters-and-base-types) - - [Deposit](02_state.md#deposit) - - [ValidatorGovInfo](02_state.md#validatorgovinfo) - - [Proposals](02_state.md#proposals) - - [Stores](02_state.md#stores) - - [Proposal Processing Queue](02_state.md#proposal-processing-queue) + * [Parameters and base types](02_state.md#parameters-and-base-types) + * [Deposit](02_state.md#deposit) + * [ValidatorGovInfo](02_state.md#validatorgovinfo) + * [Proposals](02_state.md#proposals) + * [Stores](02_state.md#stores) + * [Proposal Processing Queue](02_state.md#proposal-processing-queue) 3. **[Messages](03_messages.md)** - - [Proposal Submission](03_messages.md#proposal-submission) - - [Deposit](03_messages.md#deposit) - - [Vote](03_messages.md#vote) + * [Proposal Submission](03_messages.md#proposal-submission) + * [Deposit](03_messages.md#deposit) + * [Vote](03_messages.md#vote) 4. **[Events](04_events.md)** - - [EndBlocker](04_events.md#endblocker) - - [Handlers](04_events.md#handlers) + * [EndBlocker](04_events.md#endblocker) + * [Handlers](04_events.md#handlers) 5. **[Future Improvements](05_future_improvements.md)** 6. **[Parameters](06_params.md)** 7. **[Client](07_client.md)** - - [CLI](07_client.md#cli) - - [gRPC](07_client.md#grpc) - - [REST](07_client.md#rest) + * [CLI](07_client.md#cli) + * [gRPC](07_client.md#grpc) + * [REST](07_client.md#rest) diff --git a/x/group/internal/orm/spec/01_table.md b/x/group/internal/orm/spec/01_table.md index 5663b2056984..53fc6be1eba0 100644 --- a/x/group/internal/orm/spec/01_table.md +++ b/x/group/internal/orm/spec/01_table.md @@ -2,17 +2,17 @@ A table can be built given a `codec.ProtoMarshaler` model type, a prefix to access the underlying prefix store used to store table data as well as a `Codec` for marshalling/unmarshalling. -+++ https://github.com/cosmos/cosmos-sdk/blob/9f78f16ae75cc42fc5fe636bde18a453ba74831f/x/group/internal/orm/table.go#L24-L30 ++++ In the prefix store, entities should be stored by an unique identifier called `RowID` which can be based either on an `uint64` auto-increment counter, string or dynamic size bytes. Regular CRUD operations can be performed on a table, these methods take a `sdk.KVStore` as parameter to get the table prefix store. The `table` struct does not: -- enforce uniqueness of the `RowID` -- enforce prefix uniqueness of keys, i.e. not allowing one key to be a prefix +* enforce uniqueness of the `RowID` +* enforce prefix uniqueness of keys, i.e. not allowing one key to be a prefix of another -- optimize Gas usage conditions +* optimize Gas usage conditions The `table` struct is private, so that we only have custom tables built on top of it, that do satisfy these requirements. `table` provides methods for exporting (using a [`PrefixScan` `Iterator`](03_iterator_pagination.md#iterator)) and importing genesis data. For the import to be successful, objects have to be aware of their primary key by implementing the [`PrimaryKeyed`](#primarykeyed) interface. @@ -21,7 +21,7 @@ The `table` struct is private, so that we only have custom tables built on top o `AutoUInt64Table` is a table type with an auto incrementing `uint64` ID. -+++ https://github.com/cosmos/cosmos-sdk/blob/9f78f16ae75cc42fc5fe636bde18a453ba74831f/x/group/internal/orm/auto_uint64.go#L11-L14 ++++ It's based on the `Sequence` struct which is a persistent unique key generator based on a counter encoded using 8 byte big endian. @@ -33,7 +33,7 @@ It's based on the `Sequence` struct which is a persistent unique key generator b The model provided for creating a `PrimaryKeyTable` should implement the `PrimaryKeyed` interface: -+++ https://github.com/cosmos/cosmos-sdk/blob/9f78f16ae75cc42fc5fe636bde18a453ba74831f/x/group/internal/orm/primary_key.go#L28-L41 ++++ `PrimaryKeyFields()` method returns the list of key parts for a given object. The primary key parts can be []byte, string, and `uint64` types. @@ -42,6 +42,6 @@ The primary key parts can be []byte, string, and `uint64` types. Key parts, except the last part, follow these rules: -- []byte is encoded with a single byte length prefix -- strings are null-terminated -- `uint64` are encoded using 8 byte big endian. +* []byte is encoded with a single byte length prefix +* strings are null-terminated +* `uint64` are encoded using 8 byte big endian. diff --git a/x/group/internal/orm/spec/02_secondary_index.md b/x/group/internal/orm/spec/02_secondary_index.md index fd25a606f571..74742faf8249 100644 --- a/x/group/internal/orm/spec/02_secondary_index.md +++ b/x/group/internal/orm/spec/02_secondary_index.md @@ -2,19 +2,19 @@ Secondary indexes can be used on `Indexable` [tables](01_table.md). Indeed, those tables implement the `Indexable` interface that provides a set of functions that can be called by indexes to register and interact with the tables, like callback functions that are called on entries creation, update or deletion to create, update or remove corresponding entries in the table secondary indexes. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/types.go#L88-L92 ++++ ## MultiKeyIndex A `MultiKeyIndex` is an index where multiple entries can point to the same underlying object. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/index.go#L25-L31 ++++ Internally, it uses an `Indexer` that manages the persistence of the index based on searchable keys and create/update/delete operations. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/index.go#L15-L19 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/indexer.go#L15-L18 ++++ The currently used implementation of an `indexer`, `Indexer`, relies on an `IndexerFunc` that should be provided when instantiating the index. Based on the source object, this function returns one or multiple index keys as `[]interface{}`. Such secondary index keys should be bytes, string or `uint64` in order to be handled properly by the [key codec](01_table.md#key-codec) which defines specific encoding for those types. In the index prefix store, the keys are built based on the source object's `RowID` and its secondary index key(s) using the key codec and the values are set as empty bytes. diff --git a/x/group/internal/orm/spec/03_iterator_pagination.md b/x/group/internal/orm/spec/03_iterator_pagination.md index ac0839623321..f7fda6393f32 100644 --- a/x/group/internal/orm/spec/03_iterator_pagination.md +++ b/x/group/internal/orm/spec/03_iterator_pagination.md @@ -6,15 +6,15 @@ Both [tables](01_table.md) and [secondary indexes](02_secondary_index.md) suppor An `Iterator` allows iteration through a sequence of key value pairs. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/types.go#L77-L83 ++++ Tables rely on a `typeSafeIterator` that is used by `PrefixScan` and `ReversePrefixScan` `table` methods to iterate through a range of `RowID`s. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/table.go#235-L239 ++++ Secondary indexes rely on an `indexIterator` that can strip the `RowID` from the full index key in order to get the underlying value in the table prefix store. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/index.go#L227-L232 ++++ Under the hood, both use a prefix store `Iterator` (alias for tm-db `Iterator`). @@ -23,6 +23,6 @@ Under the hood, both use a prefix store `Iterator` (alias for tm-db `Iterator`). The `Paginate` function does pagination given an [`Iterator`](#iterator) and a `query.PageRequest`, and returns a `query.PageResponse`. It unmarshals the results into the provided dest interface that should be a pointer to a slice of models. -+++ https://github.com/cosmos/cosmos-sdk/blob/430163ed4eefcc0d67b706411ffc0b7c5414cd90/x/group/internal/orm/iterator.go#L117-L216 ++++ Secondary indexes have a `GetPaginated` method that returns an `Iterator` for the given searched secondary index key, starting from the `query.PageRequest` key if provided. It's important to note that this `query.PageRequest` key should be a `RowID` (that could have been returned by a previous paginated request). The returned `Iterator` can then be used with the `Paginate` function and the same `query.PageRequest`. diff --git a/x/group/internal/orm/spec/README.md b/x/group/internal/orm/spec/README.md index f2d83b63897c..7aed09315fcf 100644 --- a/x/group/internal/orm/spec/README.md +++ b/x/group/internal/orm/spec/README.md @@ -5,11 +5,11 @@ The orm package provides a framework for creating relational database tables wit ## Contents 1. **[Table](01_table.md)** - - [AutoUInt64Table](01_table.md#autouint64table) - - [PrimaryKeyTable](01_table.md#primarykeytable) + * [AutoUInt64Table](01_table.md#autouint64table) + * [PrimaryKeyTable](01_table.md#primarykeytable) 2. **[Secondary Index](02_secondary_index.md)** - - [MultiKeyIndex](02_secondary_index.md#multikeyindex) - - [UniqueIndex](02_secondary_index.md#uniqueindex) + * [MultiKeyIndex](02_secondary_index.md#multikeyindex) + * [UniqueIndex](02_secondary_index.md#uniqueindex) 3. **[Iterator and Pagination](03_iterator_pagination.md)** - - [Iterator](03_iterator_pagination.md#iterator) - - [Pagination](03_iterator_pagination.md#pagination) + * [Iterator](03_iterator_pagination.md#iterator) + * [Pagination](03_iterator_pagination.md#pagination) diff --git a/x/group/spec/01_concepts.md b/x/group/spec/01_concepts.md index e2ea7d89b14f..b8e7af52dcde 100644 --- a/x/group/spec/01_concepts.md +++ b/x/group/spec/01_concepts.md @@ -71,4 +71,4 @@ could be executed later on. In the current implementation, changing a group's membership (adding or removing members or changing their weight) will cause all existing proposals for group policy accounts linked to this group to be invalidated. They will simply fail if someone calls `Msg/Exec` and will -eventually be garbage collected. \ No newline at end of file +eventually be garbage collected. diff --git a/x/group/spec/03_messages.md b/x/group/spec/03_messages.md index de772cc7be6e..813e199adb82 100644 --- a/x/group/spec/03_messages.md +++ b/x/group/spec/03_messages.md @@ -11,7 +11,7 @@ A new group can be created with the `MsgCreateGroup`, which has an admin address The metadata has a maximum length that is chosen by the app developer, and passed into the group keeper as a config. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L54-L65 ++++ It's expecting to fail if metadata length is greater than `MaxMetadataLen` config. @@ -19,7 +19,7 @@ It's expecting to fail if metadata length is greater than `MaxMetadataLen` confi Group members can be updated with the `UpdateGroupMembers`. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L74-L86 ++++ In the list of `MemberUpdates`, an existing member can be removed by setting its weight to 0. @@ -29,7 +29,7 @@ It's expecting to fail if the signer is not the admin of the group. The `UpdateGroupAdmin` can be used to update a group admin. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L91-L102 ++++ It's expecting to fail if the signer is not the admin of the group. @@ -37,17 +37,18 @@ It's expecting to fail if the signer is not the admin of the group. The `UpdateGroupMetadata` can be used to update a group metadata. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L107-L118 ++++ It's expecting to fail if: -- new metadata length is greater than `MaxMetadataLen` config. -- the signer is not the admin of the group. + +* new metadata length is greater than `MaxMetadataLen` config. +* the signer is not the admin of the group. ## Msg/CreateGroupPolicy A new group policy can be created with the `MsgCreateGroupPolicy`, which has an admin address, a group id, a decision policy and some optional metadata bytes. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L121-L142 ++++ It's expecting to fail if metadata length is greater than `MaxMetadataLen` config. @@ -55,7 +56,7 @@ It's expecting to fail if metadata length is greater than `MaxMetadataLen` confi The `UpdateGroupPolicyAdmin` can be used to update a group policy admin. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L151-L162 ++++ It's expecting to fail if the signer is not the admin of the group policy. @@ -63,7 +64,7 @@ It's expecting to fail if the signer is not the admin of the group policy. The `UpdateGroupPolicyDecisionPolicy` can be used to update a decision policy. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L167-L179 ++++ It's expecting to fail if the signer is not the admin of the group policy. @@ -71,18 +72,19 @@ It's expecting to fail if the signer is not the admin of the group policy. The `UpdateGroupPolicyMetadata` can be used to update a group policy metadata. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L184-L195 ++++ It's expecting to fail if: -- new metadata length is greater than `MaxMetadataLen` config. -- the signer is not the admin of the group. + +* new metadata length is greater than `MaxMetadataLen` config. +* the signer is not the admin of the group. ## Msg/CreateProposal A new proposal can be created with the `MsgCreateProposal`, which has a group policy account address, a list of proposers addresses, a list of messages to execute if the proposal is accepted and some optional metadata bytes. An optional `Exec` value can be provided to try to execute the proposal immediately after proposal creation. Proposers signatures are considered as yes votes in this case. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L218-L239 ++++ It's expecting to fail if metadata length is greater than `MaxMetadataLen` config. @@ -90,18 +92,19 @@ It's expecting to fail if metadata length is greater than `MaxMetadataLen` confi A proposal can be withdrawn using `MsgWithdrawProposal` which has a `address` (can be either proposer or policy admin) and a `proposal_id` (which has to be withdrawn). -+++ https://github.com/cosmos/cosmos-sdk/blob/f2d6f0e4bb1a9bd7f7ae3cdc4702c9d3d1fc0329/proto/cosmos/group/v1beta1/tx.proto#L251-L258 ++++ It's expecting to fail if: -- the signer is neither policy address nor proposer of the proposal. -- the proposal is already closed or aborted. + +* the signer is neither policy address nor proposer of the proposal. +* the proposal is already closed or aborted. ## Msg/Vote A new vote can be created with the `MsgVote`, given a proposal id, a voter address, a choice (yes, no, veto or abstain) and some optional metadata bytes. An optional `Exec` value can be provided to try to execute the proposal immediately after voting. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L248-L265 ++++ It's expecting to fail if metadata length is greater than `MaxMetadataLen` config. @@ -109,11 +112,12 @@ It's expecting to fail if metadata length is greater than `MaxMetadataLen` confi A proposal can be executed with the `MsgExec`. -+++ https://github.com/cosmos/cosmos-sdk/blob/6f58963e7f6ce820e9b33f02f06f7b96f6d2e347/proto/cosmos/group/v1beta1/tx.proto#L270-L278 ++++ The messages that are part of this proposal won't be executed if: -- the group has been modified before tally. -- the group policy has been modified before tally. -- the proposal has not been accepted. -- the proposal status is not closed. -- the proposal has already been successfully executed. \ No newline at end of file + +* the group has been modified before tally. +* the group policy has been modified before tally. +* the proposal has not been accepted. +* the proposal status is not closed. +* the proposal has already been successfully executed. diff --git a/x/group/spec/04_events.md b/x/group/spec/04_events.md index 3fda91e1aafc..1918a7099bd8 100644 --- a/x/group/spec/04_events.md +++ b/x/group/spec/04_events.md @@ -60,4 +60,4 @@ The group module emits the following events: | Type | Attribute Key | Attribute Value | |--------------------------------|---------------|--------------------------------| | message | action | /cosmos.group.v1beta1.Msg/Exec | -| cosmos.group.v1beta1.EventExec | proposal_id | {proposalId} | \ No newline at end of file +| cosmos.group.v1beta1.EventExec | proposal_id | {proposalId} | diff --git a/x/group/spec/README.md b/x/group/spec/README.md index 2be92e04ba90..a8e69b5596aa 100644 --- a/x/group/spec/README.md +++ b/x/group/spec/README.md @@ -16,41 +16,41 @@ This module allows the creation and management of on-chain multisig accounts and ## Contents 1. **[Concepts](01_concepts.md)** - - [Group](01_concepts.md#group) - - [Group Policy](01_concepts.md#group-policy) - - [Decision Policy](01_concepts.md#decision-policy) - - [Proposal](01_concepts.md#proposal) - - [Voting](01_concepts.md#voting) - - [Executing Proposals](01_concepts.md#executing-proposals) + * [Group](01_concepts.md#group) + * [Group Policy](01_concepts.md#group-policy) + * [Decision Policy](01_concepts.md#decision-policy) + * [Proposal](01_concepts.md#proposal) + * [Voting](01_concepts.md#voting) + * [Executing Proposals](01_concepts.md#executing-proposals) 2. **[State](02_state.md)** - - [Group Table](02_state.md#group-table) - - [Group Member Table](02_state.md#group-member-table) - - [Group Policy Table](02_state.md#group-policy-table) - - [Proposal](02_state.md#proposal-table) - - [Vote Table](02_state.md#vote-table) + * [Group Table](02_state.md#group-table) + * [Group Member Table](02_state.md#group-member-table) + * [Group Policy Table](02_state.md#group-policy-table) + * [Proposal](02_state.md#proposal-table) + * [Vote Table](02_state.md#vote-table) 3. **[Msg Service](03_messages.md)** - - [Msg/CreateGroup](03_messages.md#msgcreategroup) - - [Msg/UpdateGroupMembers](03_messages.md#msgupdategroupmembers) - - [Msg/UpdateGroupAdmin](03_messages.md#msgupdategroupadmin) - - [Msg/UpdateGroupMetadata](03_messages.md#msgupdategroupmetadata) - - [Msg/CreateGroupPolicy](03_messages.md#msgcreategrouppolicy) - - [Msg/UpdateGroupPolicyAdmin](03_messages.md#msgupdategrouppolicyadmin) - - [Msg/UpdateGroupPolicyDecisionPolicy](03_messages.md#msgupdategrouppolicydecisionpolicy) - - [Msg/UpdateGroupPolicyMetadata](03_messages.md#msgupdategrouppolicymetadata) - - [Msg/CreateProposal](03_messages.md#msgcreateproposal) - - [Msg/WithdrawProposal](03_messages.md#msgwithdrawproposal) - - [Msg/Vote](03_messages.md#msgvote) - - [Msg/Exec](03_messages.md#msgexec) + * [Msg/CreateGroup](03_messages.md#msgcreategroup) + * [Msg/UpdateGroupMembers](03_messages.md#msgupdategroupmembers) + * [Msg/UpdateGroupAdmin](03_messages.md#msgupdategroupadmin) + * [Msg/UpdateGroupMetadata](03_messages.md#msgupdategroupmetadata) + * [Msg/CreateGroupPolicy](03_messages.md#msgcreategrouppolicy) + * [Msg/UpdateGroupPolicyAdmin](03_messages.md#msgupdategrouppolicyadmin) + * [Msg/UpdateGroupPolicyDecisionPolicy](03_messages.md#msgupdategrouppolicydecisionpolicy) + * [Msg/UpdateGroupPolicyMetadata](03_messages.md#msgupdategrouppolicymetadata) + * [Msg/CreateProposal](03_messages.md#msgcreateproposal) + * [Msg/WithdrawProposal](03_messages.md#msgwithdrawproposal) + * [Msg/Vote](03_messages.md#msgvote) + * [Msg/Exec](03_messages.md#msgexec) 4. **[Events](04_events.md)** - - [EventCreateGroup](04_events.md#eventcreategroup) - - [EventUpdateGroup](04_events.md#eventupdategroup) - - [EventCreateGroupPolicy](04_events.md#eventcreategrouppolicy) - - [EventUpdateGroupPolicy](04_events.md#eventupdategrouppolicy) - - [EventCreateProposal](04_events.md#eventcreateproposal) - - [EventWithdrawProposal](04_events.md#eventwithdrawproposal) - - [EventVote](04_events.md#eventvote) - - [EventExec](04_events.md#eventexec) + * [EventCreateGroup](04_events.md#eventcreategroup) + * [EventUpdateGroup](04_events.md#eventupdategroup) + * [EventCreateGroupPolicy](04_events.md#eventcreategrouppolicy) + * [EventUpdateGroupPolicy](04_events.md#eventupdategrouppolicy) + * [EventCreateProposal](04_events.md#eventcreateproposal) + * [EventWithdrawProposal](04_events.md#eventwithdrawproposal) + * [EventVote](04_events.md#eventvote) + * [EventExec](04_events.md#eventexec) 5. **[Client](05_client.md)** - - [CLI](05_client.md#cli) - - [gRPC](05_client.md#grpc) - - [REST](05_client.md#rest) + * [CLI](05_client.md#cli) + * [gRPC](05_client.md#grpc) + * [REST](05_client.md#rest) diff --git a/x/mint/README.md b/x/mint/README.md index fbdb897be21e..e5c3f70c11dc 100644 --- a/x/mint/README.md +++ b/x/mint/README.md @@ -4,4 +4,4 @@ order: 0 # Mint -- [Mint](spec/README.md) - Creation of new units of staking token. +* [Mint](spec/README.md) - Creation of new units of staking token. diff --git a/x/mint/spec/01_concepts.md b/x/mint/spec/01_concepts.md index 38cfb8acdf70..11669404d195 100644 --- a/x/mint/spec/01_concepts.md +++ b/x/mint/spec/01_concepts.md @@ -8,8 +8,8 @@ order: 1 The minting mechanism was designed to: -- allow for a flexible inflation rate determined by market demand targeting a particular bonded-stake ratio -- effect a balance between market liquidity and staked supply +* allow for a flexible inflation rate determined by market demand targeting a particular bonded-stake ratio +* effect a balance between market liquidity and staked supply In order to best determine the appropriate market rate for inflation rewards, a moving change rate is used. The moving change rate mechanism ensures that if @@ -20,9 +20,9 @@ which should help provide some liquidity. It can be broken down in the following way: -- If the inflation rate is below the goal %-bonded the inflation rate will +* If the inflation rate is below the goal %-bonded the inflation rate will increase until a maximum value is reached -- If the goal % bonded (67% in Cosmos-Hub) is maintained, then the inflation +* If the goal % bonded (67% in Cosmos-Hub) is maintained, then the inflation rate will stay constant -- If the inflation rate is above the goal %-bonded the inflation rate will +* If the inflation rate is above the goal %-bonded the inflation rate will decrease until a minimum value is reached diff --git a/x/mint/spec/02_state.md b/x/mint/spec/02_state.md index 9e25ac1b3488..0d336b93c28a 100644 --- a/x/mint/spec/02_state.md +++ b/x/mint/spec/02_state.md @@ -8,14 +8,14 @@ order: 2 The minter is a space for holding current inflation information. -- Minter: `0x00 -> ProtocolBuffer(minter)` +* Minter: `0x00 -> ProtocolBuffer(minter)` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc7/proto/cosmos/mint/v1beta1/mint.proto#L8-L19 ++++ ## Params Minting params are held in the global params store. -- Params: `mint/params -> legacy_amino(params)` +* Params: `mint/params -> legacy_amino(params)` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0-rc7/proto/cosmos/mint/v1beta1/mint.proto#L21-L53 ++++ diff --git a/x/mint/spec/03_begin_block.md b/x/mint/spec/03_begin_block.md index 2f23f0aeb1fb..ede3d2c328a6 100644 --- a/x/mint/spec/03_begin_block.md +++ b/x/mint/spec/03_begin_block.md @@ -15,7 +15,7 @@ depending on the distance from the desired ratio (67%). The maximum rate change possible is defined to be 13% per year, however the annual inflation is capped as between 7% and 20%. -``` +```go NextInflationRate(params Params, bondedRatio sdk.Dec) (inflation sdk.Dec) { inflationRateChangePerYear = (1 - bondedRatio/params.GoalBonded) * params.InflationRateChange inflationRateChange = inflationRateChangePerYear/blocksPerYr @@ -38,7 +38,7 @@ NextInflationRate(params Params, bondedRatio sdk.Dec) (inflation sdk.Dec) { Calculate the annual provisions based on current total supply and inflation rate. This parameter is calculated once per block. -``` +```go NextAnnualProvisions(params Params, totalSupply sdk.Dec) (provisions sdk.Dec) { return Inflation * totalSupply ``` @@ -47,7 +47,7 @@ NextAnnualProvisions(params Params, totalSupply sdk.Dec) (provisions sdk.Dec) { Calculate the provisions generated for each block based on current annual provisions. The provisions are then minted by the `mint` module's `ModuleMinterAccount` and then transferred to the `auth`'s `FeeCollector` `ModuleAccount`. -``` +```go BlockProvision(params Params) sdk.Coin { provisionAmt = AnnualProvisions/ params.BlocksPerYear return sdk.NewCoin(params.MintDenom, provisionAmt.Truncate()) diff --git a/x/mint/spec/06_client.md b/x/mint/spec/06_client.md index e2c366d932be..a79063a99be1 100644 --- a/x/mint/spec/06_client.md +++ b/x/mint/spec/06_client.md @@ -12,7 +12,7 @@ A user can query and interact with the `mint` module using the CLI. The `query` commands allow users to query `mint` state. -``` +```sh simd query mint --help ``` @@ -20,19 +20,19 @@ simd query mint --help The `annual-provisions` command allow users to query the current minting annual provisions value -``` +```sh simd query mint annual-provisions [flags] ``` Example: -``` +```sh simd query mint annual-provisions ``` Example Output: -``` +```sh 22268504368893.612100895088410693 ``` @@ -40,19 +40,19 @@ Example Output: The `inflation` command allow users to query the current minting inflation value -``` +```sh simd query mint inflation [flags] ``` Example: -``` +```sh simd query mint inflation ``` Example Output: -``` +```sh 0.199200302563256955 ``` @@ -60,13 +60,13 @@ Example Output: The `params` command allow users to query the current minting parameters -``` +```sh simd query mint params [flags] ``` Example: -``` +```yml blocks_per_year: "4360000" goal_bonded: "0.670000000000000000" inflation_max: "0.200000000000000000" @@ -83,19 +83,19 @@ A user can query the `mint` module using gRPC endpoints. The `AnnualProvisions` endpoint allow users to query the current minting annual provisions value -``` +```sh /cosmos.mint.v1beta1.Query/AnnualProvisions ``` Example: -``` +```sh grpcurl -plaintext localhost:9090 cosmos.mint.v1beta1.Query/AnnualProvisions ``` Example Output: -``` +```json { "annualProvisions": "1432452520532626265712995618" } @@ -105,19 +105,19 @@ Example Output: The `Inflation` endpoint allow users to query the current minting inflation value -``` +```sh /cosmos.mint.v1beta1.Query/Inflation ``` Example: -``` +```sh grpcurl -plaintext localhost:9090 cosmos.mint.v1beta1.Query/Inflation ``` Example Output: -``` +```json { "inflation": "130197115720711261" } @@ -127,19 +127,19 @@ Example Output: The `Params` endpoint allow users to query the current minting parameters -``` +```sh /cosmos.mint.v1beta1.Query/Params ``` Example: -``` +```sh grpcurl -plaintext localhost:9090 cosmos.mint.v1beta1.Query/Params ``` Example Output: -``` +```json { "params": { "mintDenom": "stake", @@ -158,19 +158,19 @@ A user can query the `mint` module using REST endpoints. ### annual-provisions -``` +```sh /cosmos/mint/v1beta1/annual_provisions ``` Example: -``` +```sh curl "localhost:1317/cosmos/mint/v1beta1/annual_provisions" ``` Example Output: -``` +```json { "annualProvisions": "1432452520532626265712995618" } @@ -178,19 +178,19 @@ Example Output: ### inflation -``` +```sh /cosmos/mint/v1beta1/inflation ``` Example: -``` +```sh curl "localhost:1317/cosmos/mint/v1beta1/inflation" ``` Example Output: -``` +```json { "inflation": "130197115720711261" } @@ -198,19 +198,19 @@ Example Output: ### params -``` +```sh /cosmos/mint/v1beta1/params ``` Example: -``` +```sh curl "localhost:1317/cosmos/mint/v1beta1/params" ``` Example Output: -``` +```json { "params": { "mintDenom": "stake", diff --git a/x/mint/spec/README.md b/x/mint/spec/README.md index f5c41b53f6fd..400d723b2a3c 100644 --- a/x/mint/spec/README.md +++ b/x/mint/spec/README.md @@ -11,16 +11,16 @@ parent: 1. **[Concept](01_concepts.md)** 2. **[State](02_state.md)** - - [Minter](02_state.md#minter) - - [Params](02_state.md#params) + * [Minter](02_state.md#minter) + * [Params](02_state.md#params) 3. **[Begin-Block](03_begin_block.md)** - - [NextInflationRate](03_begin_block.md#nextinflationrate) - - [NextAnnualProvisions](03_begin_block.md#nextannualprovisions) - - [BlockProvision](03_begin_block.md#blockprovision) + * [NextInflationRate](03_begin_block.md#nextinflationrate) + * [NextAnnualProvisions](03_begin_block.md#nextannualprovisions) + * [BlockProvision](03_begin_block.md#blockprovision) 4. **[Parameters](04_params.md)** 5. **[Events](05_events.md)** - - [BeginBlocker](05_events.md#beginblocker) + * [BeginBlocker](05_events.md#beginblocker) 6. **[Client](06_client.md)** - - [CLI](06_client.md#cli) - - [gRPC](06_client.md#grpc) - - [REST](06_client.md#rest) + * [CLI](06_client.md#cli) + * [gRPC](06_client.md#grpc) + * [REST](06_client.md#rest) diff --git a/x/params/README.md b/x/params/README.md index e3066a0cad3f..82fb82fde69f 100644 --- a/x/params/README.md +++ b/x/params/README.md @@ -4,4 +4,4 @@ order: 0 # Params -- [Params](spec/README.md) - Globally available parameter store. +* [Params](spec/README.md) - Globally available parameter store. diff --git a/x/params/spec/README.md b/x/params/spec/README.md index 4a136cce57e3..6f0387a01c9c 100644 --- a/x/params/spec/README.md +++ b/x/params/spec/README.md @@ -24,6 +24,6 @@ The following contents explains how to use params module for master and user mod 1. **[Keeper](01_keeper.md)** 2. **[Subspace](02_subspace.md)** - - [Key](02_subspace.md#key) - - [KeyTable](02_subspace.md#keytable) - - [ParamSet](02_subspace.md#paramset) + * [Key](02_subspace.md#key) + * [KeyTable](02_subspace.md#keytable) + * [ParamSet](02_subspace.md#paramset) diff --git a/x/slashing/README.md b/x/slashing/README.md index 43d0e3e20d33..9f79636b9892 100644 --- a/x/slashing/README.md +++ b/x/slashing/README.md @@ -4,4 +4,4 @@ order: 0 # Slashing -- [Slashing](spec/README.md) - validator punishment mechanisms. +* [Slashing](spec/README.md) - validator punishment mechanisms. diff --git a/x/slashing/spec/02_state.md b/x/slashing/spec/02_state.md index b296105feccd..3b20da035da0 100644 --- a/x/slashing/spec/02_state.md +++ b/x/slashing/spec/02_state.md @@ -14,7 +14,7 @@ Proposers are incentivized to include precommits from all validators in the Tend by receiving additional fees proportional to the difference between the voting power included in the `LastCommitInfo` and +2/3 (see [fee distribution](x/distribution/spec/03_begin_block.md)). -``` +```go type LastCommitInfo struct { Round int32 Votes []VoteInfo @@ -27,8 +27,8 @@ number of blocks by being automatically jailed, potentially slashed, and unbonde Information about validator's liveness activity is tracked through `ValidatorSigningInfo`. It is indexed in the store as follows: -- ValidatorSigningInfo: `0x01 | ConsAddrLen (1 byte) | ConsAddress -> ProtocolBuffer(ValSigningInfo)` -- MissedBlocksBitArray: `0x02 | ConsAddrLen (1 byte) | ConsAddress | LittleEndianUint64(signArrayIndex) -> VarInt(didMiss)` (varint is a number encoding format) +* ValidatorSigningInfo: `0x01 | ConsAddrLen (1 byte) | ConsAddress -> ProtocolBuffer(ValSigningInfo)` +* MissedBlocksBitArray: `0x02 | ConsAddrLen (1 byte) | ConsAddress | LittleEndianUint64(signArrayIndex) -> VarInt(didMiss)` (varint is a number encoding format) The first mapping allows us to easily lookup the recent signing info for a validator based on the validator's consensus address. @@ -48,4 +48,4 @@ bonded validator. The `SignedBlocksWindow` parameter defines the size The information stored for tracking validator liveness is as follows: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/slashing/v1beta1/slashing.proto#L11-L33 ++++ diff --git a/x/slashing/spec/03_messages.md b/x/slashing/spec/03_messages.md index d680b83cdfee..8749315794d9 100644 --- a/x/slashing/spec/03_messages.md +++ b/x/slashing/spec/03_messages.md @@ -22,7 +22,7 @@ message MsgUnjail { Below is a pseudocode of the `MsgSrv/Unjail` RPC: -``` +```go unjail(tx MsgUnjail) validator = getValidator(tx.ValidatorAddr) if validator == nil diff --git a/x/slashing/spec/05_hooks.md b/x/slashing/spec/05_hooks.md index c280d34ebdc6..d1234e58ee05 100644 --- a/x/slashing/spec/05_hooks.md +++ b/x/slashing/spec/05_hooks.md @@ -12,16 +12,16 @@ The slashing module implements the `StakingHooks` defined in `x/staking` and are The following hooks impact the slashing state: -+ `AfterValidatorBonded` creates a `ValidatorSigningInfo` instance as described in the following section. -+ `AfterValidatorCreated` stores a validator's consensus key. -+ `AfterValidatorRemoved` removes a validator's consensus key. +* `AfterValidatorBonded` creates a `ValidatorSigningInfo` instance as described in the following section. +* `AfterValidatorCreated` stores a validator's consensus key. +* `AfterValidatorRemoved` removes a validator's consensus key. ## Validator Bonded Upon successful first-time bonding of a new validator, we create a new `ValidatorSigningInfo` structure for the now-bonded validator, which `StartHeight` of the current block. -``` +```go onValidatorBonded(address sdk.ValAddress) signingInfo, found = GetValidatorSigningInfo(address) diff --git a/x/slashing/spec/06_events.md b/x/slashing/spec/06_events.md index 861af11f4b57..c7dbf5723efa 100644 --- a/x/slashing/spec/06_events.md +++ b/x/slashing/spec/06_events.md @@ -10,9 +10,9 @@ The slashing module emits the following events: ### MsgUnjail -| Type | Attribute Key | Attribute Value | -| ------- | ------------- | --------------- | -| message | module | slashing | +| Type | Attribute Key | Attribute Value | +| ------- | ------------- | ------------------ | +| message | module | slashing | | message | sender | {validatorAddress} | ## Keeper @@ -27,7 +27,7 @@ The slashing module emits the following events: | slash | jailed [0] | {validatorConsensusAddress} | | slash | burned coins | {sdk.Int} | -- [0] Only included if the validator is jailed. +* [0] Only included if the validator is jailed. | Type | Attribute Key | Attribute Value | | -------- | ------------- | --------------------------- | @@ -37,7 +37,7 @@ The slashing module emits the following events: ### Slash -+ same as `"slash"` event from `HandleValidatorSignature`, but without the `jailed` attribute. +* same as `"slash"` event from `HandleValidatorSignature`, but without the `jailed` attribute. ### Jail diff --git a/x/slashing/spec/07_tombstone.md b/x/slashing/spec/07_tombstone.md index 216d1836f5a3..ab06c94563ac 100644 --- a/x/slashing/spec/07_tombstone.md +++ b/x/slashing/spec/07_tombstone.md @@ -113,11 +113,11 @@ comparing potential future ones to find the max. Currently the only Tendermint ABCI fault is: -- Unjustified precommits (double signs) +* Unjustified precommits (double signs) It is currently planned to include the following fault in the near future: -- Signing a precommit when you're in unbonding phase (needed to make light client bisection safe) +* Signing a precommit when you're in unbonding phase (needed to make light client bisection safe) Given that these faults are both attributable byzantine faults, we will likely want to slash them equally, and thus we can enact the above change. diff --git a/x/slashing/spec/09_client.md b/x/slashing/spec/09_client.md index fd5b2030fe43..11d82961e622 100644 --- a/x/slashing/spec/09_client.md +++ b/x/slashing/spec/09_client.md @@ -6,31 +6,31 @@ order: 9 A user can query and interact with the `slashing` module using the CLI. -### Query +## Query The `query` commands allow users to query `slashing` state. -```bash +```sh simd query slashing --help ``` -#### params +### params The `params` command allows users to query genesis parameters for the slashing module. -```bash +```sh simd query slashing params [flags] ``` Example: -```bash +```sh simd query slashing params ``` Example Output: -```bash +```yml downtime_jail_duration: 600s min_signed_per_window: "0.500000000000000000" signed_blocks_window: "100" @@ -38,24 +38,24 @@ slash_fraction_double_sign: "0.050000000000000000" slash_fraction_downtime: "0.010000000000000000" ``` -#### signing-info +### signing-info The `signing-info` command allows users to query signing-info of the validator using consensus public key. -```bash +```sh simd query slashing signing-infos [flags] ``` Example: -```bash +```sh simd query slashing signing-info '{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Auxs3865HpB/EfssYOzfqNhEJjzys6jD5B6tPgC8="}' ``` Example Output: -```bash +```yml address: cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c index_offset: "2068" jailed_until: "1970-01-01T00:00:00Z" @@ -64,23 +64,23 @@ start_height: "0" tombstoned: false ``` -#### signing-infos +### signing-infos The `signing-infos` command allows users to query signing infos of all validators. -```bash +```sh simd query slashing signing-infos [flags] ``` Example: -```bash +```sh simd query slashing signing-infos ``` Example Output: -```bash +```yml info: - address: cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c index_offset: "2075" @@ -93,7 +93,7 @@ pagination: total: "0" ``` -### Transactions +## Transactions The `tx` commands allow users to interact with the `slashing` module. @@ -101,7 +101,7 @@ The `tx` commands allow users to interact with the `slashing` module. simd tx slashing --help ``` -#### unjail +### unjail The `unjail` command allows users to unjail a validator previously jailed for downtime. @@ -123,19 +123,19 @@ A user can query the `slashing` module using gRPC endpoints. The `Params` endpoint allows users to query the parameters of slashing module. -```bash +```sh cosmos.slashing.v1beta1.Query/Params ``` Example: -```bash +```sh grpcurl -plaintext localhost:9090 cosmos.slashing.v1beta1.Query/Params ``` Example Output: -```bash +```json { "params": { "signedBlocksWindow": "100", @@ -151,19 +151,19 @@ Example Output: The SigningInfo queries the signing info of given cons address. -```bash +```sh cosmos.slashing.v1beta1.Query/SigningInfo ``` Example: -```bash +```sh grpcurl -plaintext -d '{"cons_address":"cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c"}' localhost:9090 cosmos.slashing.v1beta1.Query/SigningInfo ``` Example Output: -```bash +```json { "valSigningInfo": { "address": "cosmosvalcons1nrqsld3aw6lh6t082frdqc84uwxn0t958c", @@ -177,19 +177,19 @@ Example Output: The SigningInfos queries signing info of all validators. -```bash +```sh cosmos.slashing.v1beta1.Query/SigningInfos ``` Example: -```bash +```sh grpcurl -plaintext localhost:9090 cosmos.slashing.v1beta1.Query/SigningInfos ``` Example Output: -```bash +```json { "info": [ { @@ -210,19 +210,19 @@ A user can query the `slashing` module using REST endpoints. ### Params -```bash +```sh /cosmos/slashing/v1beta1/params ``` Example: -```bash +```sh curl "localhost:1317/cosmos/slashing/v1beta1/params" ``` Example Output: -```bash +```json { "params": { "signed_blocks_window": "100", @@ -235,19 +235,19 @@ Example Output: ### signing_info -```bash +```sh /cosmos/slashing/v1beta1/signing_infos/%s ``` Example: -```bash +```sh curl "localhost:1317/cosmos/slashing/v1beta1/signing_infos/cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c" ``` Example Output: -```bash +```json { "val_signing_info": { "address": "cosmosvalcons1nrqslkwd3pz096lh6t082frdqc84uwxn0t958c", @@ -262,19 +262,19 @@ Example Output: ### signing_infos -```bash +```sh /cosmos/slashing/v1beta1/signing_infos ``` Example: -```bash +```sh curl "localhost:1317/cosmos/slashing/v1beta1/signing_infos ``` Example Output: -```bash +```json { "info": [ { diff --git a/x/slashing/spec/README.md b/x/slashing/spec/README.md index 4f1fec931f0d..d1988cb964d0 100644 --- a/x/slashing/spec/README.md +++ b/x/slashing/spec/README.md @@ -17,33 +17,33 @@ by a protocol-recognized actor with value at stake by penalizing them ("slashing Penalties may include, but are not limited to: -- Burning some amount of their stake -- Removing their ability to vote on future blocks for a period of time. +* Burning some amount of their stake +* Removing their ability to vote on future blocks for a period of time. This module will be used by the Cosmos Hub, the first hub in the Cosmos ecosystem. ## Contents 1. **[Concepts](01_concepts.md)** - - [States](01_concepts.md#states) - - [Tombstone Caps](01_concepts.md#tombstone-caps) - - [ASCII timelines](01_concepts.md#ascii-timelines) + * [States](01_concepts.md#states) + * [Tombstone Caps](01_concepts.md#tombstone-caps) + * [ASCII timelines](01_concepts.md#ascii-timelines) 2. **[State](02_state.md)** - - [Signing Info](02_state.md#signing-info) + * [Signing Info](02_state.md#signing-info) 3. **[Messages](03_messages.md)** - - [Unjail](03_messages.md#unjail) + * [Unjail](03_messages.md#unjail) 4. **[Begin-Block](04_begin_block.md)** - - [Evidence handling](04_begin_block.md#evidence-handling) - - [Uptime tracking](04_begin_block.md#uptime-tracking) + * [Evidence handling](04_begin_block.md#evidence-handling) + * [Uptime tracking](04_begin_block.md#uptime-tracking) 5. **[05_hooks.md](05_hooks.md)** - - [Hooks](05_hooks.md#hooks) + * [Hooks](05_hooks.md#hooks) 6. **[Events](06_events.md)** - - [BeginBlocker](06_events.md#beginblocker) - - [Handlers](06_events.md#handlers) + * [BeginBlocker](06_events.md#beginblocker) + * [Handlers](06_events.md#handlers) 7. **[Staking Tombstone](07_tombstone.md)** - - [Abstract](07_tombstone.md#abstract) + * [Abstract](07_tombstone.md#abstract) 8. **[Parameters](08_params.md)** 9. **[Client](09_client.md)** - - [CLI](09_client.md#cli) - - [gRPC](09_client.md#grpc) - - [REST](09_client.md#rest) + * [CLI](09_client.md#cli) + * [gRPC](09_client.md#grpc) + * [REST](09_client.md#rest) diff --git a/x/staking/README.md b/x/staking/README.md index 725105a1ed2a..5736c3914943 100644 --- a/x/staking/README.md +++ b/x/staking/README.md @@ -4,4 +4,4 @@ order: 0 # Staking -- [Staking](spec/README.md) - Proof-of-Stake layer for public blockchains. +* [Staking](spec/README.md) - Proof-of-Stake layer for public blockchains. diff --git a/x/staking/spec/01_state.md b/x/staking/spec/01_state.md index 9dacbb22fdec..5b1226a9a890 100644 --- a/x/staking/spec/01_state.md +++ b/x/staking/spec/01_state.md @@ -13,31 +13,31 @@ Pool is used for tracking bonded and not-bonded token supply of the bond denomin LastTotalPower tracks the total amounts of bonded tokens recorded during the previous end block. Store entries prefixed with "Last" must remain unchanged until EndBlock. -- LastTotalPower: `0x12 -> ProtocolBuffer(sdk.Int)` +* LastTotalPower: `0x12 -> ProtocolBuffer(sdk.Int)` ## Params Params is a module-wide configuration structure that stores system parameters and defines overall functioning of the staking module. -- Params: `Paramsspace("staking") -> legacy_amino(params)` +* Params: `Paramsspace("staking") -> legacy_amino(params)` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.1/proto/cosmos/staking/v1beta1/staking.proto#L230-L241 ++++ ## Validator Validators can have one of three statuses -- `Unbonded`: The validator is not in the active set. They cannot sign blocks and do not earn +* `Unbonded`: The validator is not in the active set. They cannot sign blocks and do not earn rewards. They can receive delegations. -- `Bonded`": Once the validator receives sufficient bonded tokens they automtically join the +* `Bonded`": Once the validator receives sufficient bonded tokens they automtically join the active set during [`EndBlock`](./05_end_block.md#validator-set-changes) and their status is updated to `Bonded`. They are signing blocks and receiving rewards. They can receive further delegations. They can be slashed for misbehavior. Delegators to this validator who unbond their delegation must wait the duration of the UnbondingTime, a chain-specific param, during which time they are still slashable for offences of the source validator if those offences were committed during the period of time that the tokens were bonded. -- `Unbonding`: When a validator leaves the active set, either by choice or due to slashing, jailing or +* `Unbonding`: When a validator leaves the active set, either by choice or due to slashing, jailing or tombstoning, an unbonding of all their delegations begins. All delegations must then wait the UnbondingTime before their tokens are moved to their accounts from the `BondedPool`. @@ -49,10 +49,10 @@ required lookups for slashing and validator-set updates. A third special index throughout each block, unlike the first two indices which mirror the validator records within a block. -- Validators: `0x21 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(validator)` -- ValidatorsByConsAddr: `0x22 | ConsAddrLen (1 byte) | ConsAddr -> OperatorAddr` -- ValidatorsByPower: `0x23 | BigEndian(ConsensusPower) | OperatorAddrLen (1 byte) | OperatorAddr -> OperatorAddr` -- LastValidatorsPower: `0x11 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(ConsensusPower)` +* Validators: `0x21 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(validator)` +* ValidatorsByConsAddr: `0x22 | ConsAddrLen (1 byte) | ConsAddr -> OperatorAddr` +* ValidatorsByPower: `0x23 | BigEndian(ConsensusPower) | OperatorAddrLen (1 byte) | OperatorAddr -> OperatorAddr` +* LastValidatorsPower: `0x11 | OperatorAddrLen (1 byte) | OperatorAddr -> ProtocolBuffer(ConsensusPower)` `Validators` is the primary index - it ensures that each operator can have only one associated validator, where the public key of that validator can change in the @@ -75,23 +75,23 @@ is updated during the validator set update process which takes place in [`EndBlo Each validator's state is stored in a `Validator` struct: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L65-L99 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L24-L63 ++++ ## Delegation Delegations are identified by combining `DelegatorAddr` (the address of the delegator) with the `ValidatorAddr` Delegators are indexed in the store as follows: -- Delegation: `0x31 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(delegation)` +* Delegation: `0x31 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(delegation)` Stake holders may delegate coins to validators; under this circumstance their funds are held in a `Delegation` data structure. It is owned by one delegator, and is associated with the shares for one validator. The sender of the transaction is the owner of the bond. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L159-L170 ++++ ### Delegator Shares @@ -120,8 +120,8 @@ detected. `UnbondingDelegation` are indexed in the store as: -- UnbondingDelegation: `0x32 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(unbondingDelegation)` -- UnbondingDelegationsFromValidator: `0x33 | ValidatorAddrLen (1 byte) | ValidatorAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` +* UnbondingDelegation: `0x32 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorAddr -> ProtocolBuffer(unbondingDelegation)` +* UnbondingDelegationsFromValidator: `0x33 | ValidatorAddrLen (1 byte) | ValidatorAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` The first map here is used in queries, to lookup all unbonding delegations for a given delegator, while the second map is used in slashing, to lookup all @@ -130,7 +130,7 @@ slashed. A UnbondingDelegation object is created every time an unbonding is initiated. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L172-L198 ++++ ## Redelegation @@ -142,9 +142,9 @@ committed by the source validator. `Redelegation` are indexed in the store as: -- Redelegations: `0x34 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddr -> ProtocolBuffer(redelegation)` -- RedelegationsBySrc: `0x35 | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` -- RedelegationsByDst: `0x36 | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` +* Redelegations: `0x34 | DelegatorAddrLen (1 byte) | DelegatorAddr | ValidatorAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddr -> ProtocolBuffer(redelegation)` +* RedelegationsBySrc: `0x35 | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` +* RedelegationsByDst: `0x36 | ValidatorDstAddrLen (1 byte) | ValidatorDstAddr | ValidatorSrcAddrLen (1 byte) | ValidatorSrcAddr | DelegatorAddrLen (1 byte) | DelegatorAddr -> nil` The first map here is used for queries, to lookup all redelegations for a given delegator. The second map is used for slashing based on the `ValidatorSrcAddr`, @@ -153,12 +153,12 @@ while the third map is for slashing based on the `ValidatorDstAddr`. A redelegation object is created every time a redelegation occurs. To prevent "redelegation hopping" redelegations may not occur under the situation that: -- the (re)delegator already has another immature redelegation in progress +* the (re)delegator already has another immature redelegation in progress with a destination to a validator (let's call it `Validator X`) -- and, the (re)delegator is attempting to create a _new_ redelegation +* and, the (re)delegator is attempting to create a _new_ redelegation where the source validator for this new redelegation is `Validator X`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L200-L228 ++++ ## Queues @@ -167,8 +167,8 @@ first rounded to the nearest nanosecond then sorted. The sortable time format used is a slight modification of the RFC3339Nano and uses the the format string `"2006-01-02T15:04:05.000000000"`. Notably this format: -- right pads all zeros -- drops the time zone info (uses UTC) +* right pads all zeros +* drops the time zone info (uses UTC) In all cases, the stored timestamp represents the maturation time of the queue element. @@ -178,25 +178,25 @@ element. For the purpose of tracking progress of unbonding delegations the unbonding delegations queue is kept. -- UnbondingDelegation: `0x41 | format(time) -> []DVPair` +* UnbondingDelegation: `0x41 | format(time) -> []DVPair` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L123-L133 ++++ ### RedelegationQueue For the purpose of tracking progress of redelegations the redelegation queue is kept. -- RedelegationQueue: `0x42 | format(time) -> []DVVTriplet` +* RedelegationQueue: `0x42 | format(time) -> []DVVTriplet` -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L140-L152 ++++ ### ValidatorQueue For the purpose of tracking progress of unbonding validators the validator queue is kept. -- ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress` +* ValidatorQueueTime: `0x43 | format(time) -> []sdk.ValAddress` The stored object as each key is an array of validator operator addresses from which the validator object can be accessed. Typically it is expected that only @@ -208,7 +208,7 @@ that multiple validators exist in the queue at the same location. HistoricalInfo objects are stored and pruned at each block such that the staking keeper persists the `n` most recent historical info defined by staking module parameter: `HistoricalEntries`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/staking.proto#L15-L22 ++++ At each BeginBlock, the staking keeper will persist the current Header and the Validators that committed the current block in a `HistoricalInfo` object. The Validators are sorted on their address to ensure that diff --git a/x/staking/spec/02_state_transitions.md b/x/staking/spec/02_state_transitions.md index d62761d16a5a..c64ed498f544 100644 --- a/x/staking/spec/02_state_transitions.md +++ b/x/staking/spec/02_state_transitions.md @@ -24,44 +24,44 @@ directly between all the states, except for from `Bonded` to `Unbonded`. The following transition occurs when a validator's ranking in the `ValidatorPowerIndex` surpasses that of the `LastValidator`. -- set `validator.Status` to `Bonded` -- send the `validator.Tokens` from the `NotBondedTokens` to the `BondedPool` `ModuleAccount` -- delete the existing record from `ValidatorByPowerIndex` -- add a new updated record to the `ValidatorByPowerIndex` -- update the `Validator` object for this validator -- if it exists, delete any `ValidatorQueue` record for this validator +* set `validator.Status` to `Bonded` +* send the `validator.Tokens` from the `NotBondedTokens` to the `BondedPool` `ModuleAccount` +* delete the existing record from `ValidatorByPowerIndex` +* add a new updated record to the `ValidatorByPowerIndex` +* update the `Validator` object for this validator +* if it exists, delete any `ValidatorQueue` record for this validator ### Bonded to Unbonding When a validator begins the unbonding process the following operations occur: -- send the `validator.Tokens` from the `BondedPool` to the `NotBondedTokens` `ModuleAccount` -- set `validator.Status` to `Unbonding` -- delete the existing record from `ValidatorByPowerIndex` -- add a new updated record to the `ValidatorByPowerIndex` -- update the `Validator` object for this validator -- insert a new record into the `ValidatorQueue` for this validator +* send the `validator.Tokens` from the `BondedPool` to the `NotBondedTokens` `ModuleAccount` +* set `validator.Status` to `Unbonding` +* delete the existing record from `ValidatorByPowerIndex` +* add a new updated record to the `ValidatorByPowerIndex` +* update the `Validator` object for this validator +* insert a new record into the `ValidatorQueue` for this validator ### Unbonding to Unbonded A validator moves from unbonding to unbonded when the `ValidatorQueue` object moves from bonded to unbonded -- update the `Validator` object for this validator -- set `validator.Status` to `Unbonded` +* update the `Validator` object for this validator +* set `validator.Status` to `Unbonded` ### Jail/Unjail when a validator is jailed it is effectively removed from the Tendermint set. this process may be also be reversed. the following operations occur: -- set `Validator.Jailed` and update object -- if jailed delete record from `ValidatorByPowerIndex` -- if unjailed add record to `ValidatorByPowerIndex` +* set `Validator.Jailed` and update object +* if jailed delete record from `ValidatorByPowerIndex` +* if unjailed add record to `ValidatorByPowerIndex` Jailed validators are not present in any of the following stores: -- the power store (from consensus power to address) +* the power store (from consensus power to address) ## Delegations @@ -69,49 +69,49 @@ Jailed validators are not present in any of the following stores: When a delegation occurs both the validator and the delegation objects are affected -- determine the delegators shares based on tokens delegated and the validator's exchange rate -- remove tokens from the sending account -- add shares the delegation object or add them to a created validator object -- add new delegator shares and update the `Validator` object -- transfer the `delegation.Amount` from the delegator's account to the `BondedPool` or the `NotBondedPool` `ModuleAccount` depending if the `validator.Status` is `Bonded` or not -- delete the existing record from `ValidatorByPowerIndex` -- add an new updated record to the `ValidatorByPowerIndex` +* determine the delegators shares based on tokens delegated and the validator's exchange rate +* remove tokens from the sending account +* add shares the delegation object or add them to a created validator object +* add new delegator shares and update the `Validator` object +* transfer the `delegation.Amount` from the delegator's account to the `BondedPool` or the `NotBondedPool` `ModuleAccount` depending if the `validator.Status` is `Bonded` or not +* delete the existing record from `ValidatorByPowerIndex` +* add an new updated record to the `ValidatorByPowerIndex` ### Begin Unbonding As a part of the Undelegate and Complete Unbonding state transitions Unbond Delegation may be called. -- subtract the unbonded shares from delegator -- if the validator is `Unbonding` or `Bonded` add the tokens to an `UnbondingDelegation` Entry -- if the validator is `Unbonded` send the tokens directly to the withdraw +* subtract the unbonded shares from delegator +* if the validator is `Unbonding` or `Bonded` add the tokens to an `UnbondingDelegation` Entry +* if the validator is `Unbonded` send the tokens directly to the withdraw account -- update the delegation or remove the delegation if there are no more shares -- if the delegation is the operator of the validator and no more shares exist then trigger a jail validator -- update the validator with removed the delegator shares and associated coins -- if the validator state is `Bonded`, transfer the `Coins` worth of the unbonded +* update the delegation or remove the delegation if there are no more shares +* if the delegation is the operator of the validator and no more shares exist then trigger a jail validator +* update the validator with removed the delegator shares and associated coins +* if the validator state is `Bonded`, transfer the `Coins` worth of the unbonded shares from the `BondedPool` to the `NotBondedPool` `ModuleAccount` -- remove the validator if it is unbonded and there are no more delegation shares. +* remove the validator if it is unbonded and there are no more delegation shares. ### Complete Unbonding For undelegations which do not complete immediately, the following operations occur when the unbonding delegation queue element matures: -- remove the entry from the `UnbondingDelegation` object -- transfer the tokens from the `NotBondedPool` `ModuleAccount` to the delegator `Account` +* remove the entry from the `UnbondingDelegation` object +* transfer the tokens from the `NotBondedPool` `ModuleAccount` to the delegator `Account` ### Begin Redelegation Redelegations affect the delegation, source and destination validators. -- perform an `unbond` delegation from the source validator to retrieve the tokens worth of the unbonded shares -- using the unbonded tokens, `Delegate` them to the destination validator -- if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not, +* perform an `unbond` delegation from the source validator to retrieve the tokens worth of the unbonded shares +* using the unbonded tokens, `Delegate` them to the destination validator +* if the `sourceValidator.Status` is `Bonded`, and the `destinationValidator` is not, transfer the newly delegated tokens from the `BondedPool` to the `NotBondedPool` `ModuleAccount` -- otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator` +* otherwise, if the `sourceValidator.Status` is not `Bonded`, and the `destinationValidator` is `Bonded`, transfer the newly delegated tokens from the `NotBondedPool` to the `BondedPool` `ModuleAccount` -- record the token amount in an new entry in the relevant `Redelegation` +* record the token amount in an new entry in the relevant `Redelegation` From when a redelegation begins until it completes, the delegator is in a state of "pseudo-unbonding", and can still be slashed for infractions that occured before the redelegation began. @@ -120,7 +120,7 @@ slashed for infractions that occured before the redelegation began. When a redelegations complete the following occurs: -- remove the entry from the `Redelegation` object +* remove the entry from the `Redelegation` object ## Slashing @@ -128,13 +128,13 @@ When a redelegations complete the following occurs: When a Validator is slashed, the following occurs: -- The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) \* `TokensFromConsensusPower`, +* The total `slashAmount` is calculated as the `slashFactor` (a chain parameter) \* `TokensFromConsensusPower`, the total number of tokens bonded to the validator at the time of the infraction. -- Every unbonding delegation and pseudo-unbonding redelegation such that the infraction occured before the unbonding or +* Every unbonding delegation and pseudo-unbonding redelegation such that the infraction occured before the unbonding or redelegation began from the validator are slashed by the `slashFactor` percentage of the initialBalance. -- Each amount slashed from redelegations and unbonding delegations is subtracted from the +* Each amount slashed from redelegations and unbonding delegations is subtracted from the total slash amount. -- The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or +* The `remaingSlashAmount` is then slashed from the validator's tokens in the `BondedPool` or `NonBondedPool` depending on the validator's status. This reduces the total supply of tokens. In the case of a slash due to any infraction that requires evidence to submitted (for example double-sign), the slash diff --git a/x/staking/spec/03_messages.md b/x/staking/spec/03_messages.md index 9dce41e9a430..7dceb7626511 100644 --- a/x/staking/spec/03_messages.md +++ b/x/staking/spec/03_messages.md @@ -11,20 +11,20 @@ In this section we describe the processing of the staking messages and the corre A validator is created using the `MsgCreateValidator` message. The validator must be created with an initial delegation from the operator. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L16-L17 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L35-L51 ++++ This message is expected to fail if: -- another validator with this operator address is already registered -- another validator with this pubkey is already registered -- the initial self-delegation tokens are of a denom not specified as the bonding denom -- the commission parameters are faulty, namely: - - `MaxRate` is either > 1 or < 0 - - the initial `Rate` is either negative or > `MaxRate` - - the initial `MaxChangeRate` is either negative or > `MaxRate` -- the description fields are too large +* another validator with this operator address is already registered +* another validator with this pubkey is already registered +* the initial self-delegation tokens are of a denom not specified as the bonding denom +* the commission parameters are faulty, namely: + * `MaxRate` is either > 1 or < 0 + * the initial `Rate` is either negative or > `MaxRate` + * the initial `MaxChangeRate` is either negative or > `MaxRate` +* the description fields are too large This message creates and stores the `Validator` object at appropriate indexes. Additionally a self-delegation is made with the initial tokens delegation @@ -36,16 +36,16 @@ in the first end-block. The `Description`, `CommissionRate` of a validator can be updated using the `MsgEditValidator` message. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L19-L20 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L56-L76 ++++ This message is expected to fail if: -- the initial `CommissionRate` is either negative or > `MaxRate` -- the `CommissionRate` has already been updated within the previous 24 hours -- the `CommissionRate` is > `MaxChangeRate` -- the description fields are too large +* the initial `CommissionRate` is either negative or > `MaxRate` +* the `CommissionRate` has already been updated within the previous 24 hours +* the `CommissionRate` is > `MaxChangeRate` +* the description fields are too large This message stores the updated `Validator` object. @@ -55,16 +55,16 @@ Within this message the delegator provides coins, and in return receives some amount of their validator's (newly created) delegator-shares that are assigned to `Delegation.Shares`. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L22-L24 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L81-L90 ++++ This message is expected to fail if: -- the validator does not exist -- the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` -- the exchange rate is invalid, meaning the validator has no tokens (due to slashing) but there are outstanding shares -- the amount delegated is less than the minimum allowed delegation +* the validator does not exist +* the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` +* the exchange rate is invalid, meaning the validator has no tokens (due to slashing) but there are outstanding shares +* the amount delegated is less than the minimum allowed delegation If an existing `Delegation` object for provided addresses does not already exist then it is created as part of this message otherwise the existing @@ -87,32 +87,32 @@ will not be added to the power index until it is unjailed. The `MsgUndelegate` message allows delegators to undelegate their tokens from validator. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L30-L32 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L112-L121 ++++ This message returns a response containing the completion time of the undelegation: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L123-L126 ++++ This message is expected to fail if: -- the delegation doesn't exist -- the validator doesn't exist -- the delegation has less shares than the ones worth of `Amount` -- existing `UnbondingDelegation` has maximum entries as defined by `params.MaxEntries` -- the `Amount` has a denomination different than one defined by `params.BondDenom` +* the delegation doesn't exist +* the validator doesn't exist +* the delegation has less shares than the ones worth of `Amount` +* existing `UnbondingDelegation` has maximum entries as defined by `params.MaxEntries` +* the `Amount` has a denomination different than one defined by `params.BondDenom` When this message is processed the following actions occur: -- validator's `DelegatorShares` and the delegation's `Shares` are both reduced by the message `SharesAmount` -- calculate the token worth of the shares remove that amount tokens held within the validator -- with those removed tokens, if the validator is: - - `Bonded` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares. - - `Unbonding` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). - - `Unbonded` - then send the coins the message `DelegatorAddr` -- if there are no more `Shares` in the delegation, then the delegation object is removed from the store - - under this situation if the delegation is the validator's self-delegation then also jail the validator. +* validator's `DelegatorShares` and the delegation's `Shares` are both reduced by the message `SharesAmount` +* calculate the token worth of the shares remove that amount tokens held within the validator +* with those removed tokens, if the validator is: + * `Bonded` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares. + * `Unbonding` - add them to an entry in `UnbondingDelegation` (create `UnbondingDelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). + * `Unbonded` - then send the coins the message `DelegatorAddr` +* if there are no more `Shares` in the delegation, then the delegation object is removed from the store + * under this situation if the delegation is the validator's self-delegation then also jail the validator. ![Unbond sequence](../../../docs/uml/svg/unbond_sequence.svg) @@ -122,33 +122,33 @@ The redelegation command allows delegators to instantly switch validators. Once the unbonding period has passed, the redelegation is automatically completed in the EndBlocker. -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L26-L28 ++++ -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L95-L105 ++++ This message returns a response containing the completion time of the redelegation: -+++ https://github.com/cosmos/cosmos-sdk/blob/v0.40.0/proto/cosmos/staking/v1beta1/tx.proto#L107-L110 ++++ This message is expected to fail if: -- the delegation doesn't exist -- the source or destination validators don't exist -- the delegation has less shares than the ones worth of `Amount` -- the source validator has a receiving redelegation which is not matured (aka. the redelegation may be transitive) -- existing `Redelegation` has maximum entries as defined by `params.MaxEntries` -- the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` +* the delegation doesn't exist +* the source or destination validators don't exist +* the delegation has less shares than the ones worth of `Amount` +* the source validator has a receiving redelegation which is not matured (aka. the redelegation may be transitive) +* existing `Redelegation` has maximum entries as defined by `params.MaxEntries` +* the `Amount` `Coin` has a denomination different than one defined by `params.BondDenom` When this message is processed the following actions occur: -- the source validator's `DelegatorShares` and the delegations `Shares` are both reduced by the message `SharesAmount` -- calculate the token worth of the shares remove that amount tokens held within the source validator. -- if the source validator is: - - `Bonded` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares (this may be effectively reversed in the next step however). - - `Unbonding` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). - - `Unbonded` - no action required in this step -- Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state. -- if there are no more `Shares` in the source delegation, then the source delegation object is removed from the store - - under this situation if the delegation is the validator's self-delegation then also jail the validator. +* the source validator's `DelegatorShares` and the delegations `Shares` are both reduced by the message `SharesAmount` +* calculate the token worth of the shares remove that amount tokens held within the source validator. +* if the source validator is: + * `Bonded` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with a completion time a full unbonding period from the current time. Update pool shares to reduce BondedTokens and increase NotBondedTokens by token worth of the shares (this may be effectively reversed in the next step however). + * `Unbonding` - add an entry to the `Redelegation` (create `Redelegation` if it doesn't exist) with the same completion time as the validator (`UnbondingMinTime`). + * `Unbonded` - no action required in this step +* Delegate the token worth to the destination validator, possibly moving tokens back to the bonded state. +* if there are no more `Shares` in the source delegation, then the source delegation object is removed from the store + * under this situation if the delegation is the validator's self-delegation then also jail the validator. ![Begin redelegation sequence](../../../docs/uml/svg/begin_redelegation_sequence.svg) diff --git a/x/staking/spec/05_end_block.md b/x/staking/spec/05_end_block.md index ef899c7bbad7..7eb01421182f 100644 --- a/x/staking/spec/05_end_block.md +++ b/x/staking/spec/05_end_block.md @@ -15,12 +15,12 @@ validators are also returned back to Tendermint for inclusion in the Tendermint validator set which is responsible for validating Tendermint messages at the consensus layer. Operations are as following: -- the new validator set is taken as the top `params.MaxValidators` number of +* the new validator set is taken as the top `params.MaxValidators` number of validators retrieved from the `ValidatorsByPower` index -- the previous validator set is compared with the new validator set: - - missing validators begin unbonding and their `Tokens` are transferred from the +* the previous validator set is compared with the new validator set: + * missing validators begin unbonding and their `Tokens` are transferred from the `BondedPool` to the `NotBondedPool` `ModuleAccount` - - new validators are instantly bonded and their `Tokens` are transferred from the + * new validators are instantly bonded and their `Tokens` are transferred from the `NotBondedPool` to the `BondedPool` `ModuleAccount` In all cases, any validators leaving or entering the bonded validator set or @@ -62,9 +62,9 @@ switched from `types.Unbonding` to Complete the unbonding of all mature `UnbondingDelegations.Entries` within the `UnbondingDelegations` queue with the following procedure: -- transfer the balance coins to the delegator's wallet address -- remove the mature entry from `UnbondingDelegation.Entries` -- remove the `UnbondingDelegation` object from the store if there are no +* transfer the balance coins to the delegator's wallet address +* remove the mature entry from `UnbondingDelegation.Entries` +* remove the `UnbondingDelegation` object from the store if there are no remaining entries. ### Redelegations @@ -72,6 +72,6 @@ Complete the unbonding of all mature `UnbondingDelegations.Entries` within the Complete the unbonding of all mature `Redelegation.Entries` within the `Redelegations` queue with the following procedure: -- remove the mature entry from `Redelegation.Entries` -- remove the `Redelegation` object from the store if there are no +* remove the mature entry from `Redelegation.Entries` +* remove the `Redelegation` object from the store if there are no remaining entries. diff --git a/x/staking/spec/06_hooks.md b/x/staking/spec/06_hooks.md index 000b0050fcb9..18af7723874f 100644 --- a/x/staking/spec/06_hooks.md +++ b/x/staking/spec/06_hooks.md @@ -9,19 +9,19 @@ occurred within staking. These events can be registered to execute either right `Before` or `After` the staking event (as per the hook name). The following hooks can registered with staking: -- `AfterValidatorCreated(Context, ValAddress) error` - - called when a validator is created -- `BeforeValidatorModified(Context, ValAddress) error` - - called when a validator's state is changed -- `AfterValidatorRemoved(Context, ConsAddress, ValAddress) error` - - called when a validator is deleted -- `AfterValidatorBonded(Context, ConsAddress, ValAddress) error` - - called when a validator is bonded -- `AfterValidatorBeginUnbonding(Context, ConsAddress, ValAddress) error` - - called when a validator begins unbonding -- `BeforeDelegationCreated(Context, AccAddress, ValAddress) error` - - called when a delegation is created -- `BeforeDelegationSharesModified(Context, AccAddress, ValAddress) error` - - called when a delegation's shares are modified -- `BeforeDelegationRemoved(Context, AccAddress, ValAddress) error` - - called when a delegation is removed +* `AfterValidatorCreated(Context, ValAddress) error` + * called when a validator is created +* `BeforeValidatorModified(Context, ValAddress) error` + * called when a validator's state is changed +* `AfterValidatorRemoved(Context, ConsAddress, ValAddress) error` + * called when a validator is deleted +* `AfterValidatorBonded(Context, ConsAddress, ValAddress) error` + * called when a validator is bonded +* `AfterValidatorBeginUnbonding(Context, ConsAddress, ValAddress) error` + * called when a validator begins unbonding +* `BeforeDelegationCreated(Context, AccAddress, ValAddress) error` + * called when a delegation is created +* `BeforeDelegationSharesModified(Context, AccAddress, ValAddress) error` + * called when a delegation's shares are modified +* `BeforeDelegationRemoved(Context, AccAddress, ValAddress) error` + * called when a delegation is removed diff --git a/x/staking/spec/07_events.md b/x/staking/spec/07_events.md index f2dc9934a2d6..3f9203033cd2 100644 --- a/x/staking/spec/07_events.md +++ b/x/staking/spec/07_events.md @@ -61,7 +61,7 @@ The staking module emits the following events: | message | action | begin_unbonding | | message | sender | {senderAddress} | -- [0] Time is formatted in the RFC3339 standard +* [0] Time is formatted in the RFC3339 standard ### MsgBeginRedelegate @@ -75,4 +75,4 @@ The staking module emits the following events: | message | action | begin_redelegate | | message | sender | {senderAddress} | -- [0] Time is formatted in the RFC3339 standard +* [0] Time is formatted in the RFC3339 standard diff --git a/x/staking/spec/README.md b/x/staking/spec/README.md index b0ada5a21919..688fd810afbb 100644 --- a/x/staking/spec/README.md +++ b/x/staking/spec/README.md @@ -24,32 +24,32 @@ network. ## Contents 1. **[State](01_state.md)** - - [Pool](01_state.md#pool) - - [LastTotalPower](01_state.md#lasttotalpower) - - [Params](01_state.md#params) - - [Validator](01_state.md#validator) - - [Delegation](01_state.md#delegation) - - [UnbondingDelegation](01_state.md#unbondingdelegation) - - [Redelegation](01_state.md#redelegation) - - [Queues](01_state.md#queues) - - [HistoricalInfo](01_state.md#historicalinfo) + * [Pool](01_state.md#pool) + * [LastTotalPower](01_state.md#lasttotalpower) + * [Params](01_state.md#params) + * [Validator](01_state.md#validator) + * [Delegation](01_state.md#delegation) + * [UnbondingDelegation](01_state.md#unbondingdelegation) + * [Redelegation](01_state.md#redelegation) + * [Queues](01_state.md#queues) + * [HistoricalInfo](01_state.md#historicalinfo) 2. **[State Transitions](02_state_transitions.md)** - - [Validators](02_state_transitions.md#validators) - - [Delegations](02_state_transitions.md#delegations) - - [Slashing](02_state_transitions.md#slashing) + * [Validators](02_state_transitions.md#validators) + * [Delegations](02_state_transitions.md#delegations) + * [Slashing](02_state_transitions.md#slashing) 3. **[Messages](03_messages.md)** - - [MsgCreateValidator](03_messages.md#msgcreatevalidator) - - [MsgEditValidator](03_messages.md#msgeditvalidator) - - [MsgDelegate](03_messages.md#msgdelegate) - - [MsgUndelegate](03_messages.md#msgundelegate) - - [MsgBeginRedelegate](03_messages.md#msgbeginredelegate) + * [MsgCreateValidator](03_messages.md#msgcreatevalidator) + * [MsgEditValidator](03_messages.md#msgeditvalidator) + * [MsgDelegate](03_messages.md#msgdelegate) + * [MsgUndelegate](03_messages.md#msgundelegate) + * [MsgBeginRedelegate](03_messages.md#msgbeginredelegate) 4. **[Begin-Block](04_begin_block.md)** - - [Historical Info Tracking](04_begin_block.md#historical-info-tracking) + * [Historical Info Tracking](04_begin_block.md#historical-info-tracking) 5. **[End-Block](05_end_block.md)** - - [Validator Set Changes](05_end_block.md#validator-set-changes) - - [Queues](05_end_block.md#queues-) + * [Validator Set Changes](05_end_block.md#validator-set-changes) + * [Queues](05_end_block.md#queues-) 6. **[Hooks](06_hooks.md)** 7. **[Events](07_events.md)** - - [EndBlocker](07_events.md#endblocker) - - [Msg's](07_events.md#msg's) + * [EndBlocker](07_events.md#endblocker) + * [Msg's](07_events.md#msg's) 8. **[Parameters](08_params.md)** diff --git a/x/upgrade/README.md b/x/upgrade/README.md index 198df734043c..9363acd5c96d 100644 --- a/x/upgrade/README.md +++ b/x/upgrade/README.md @@ -4,4 +4,4 @@ order: 0 # Upgrade -- [Upgrade](spec/README.md) - Software upgrades handling and coordination. +* [Upgrade](spec/README.md) - Software upgrades handling and coordination. diff --git a/x/upgrade/spec/02_state.md b/x/upgrade/spec/02_state.md index 73c64ad2ddf5..7508b292924b 100644 --- a/x/upgrade/spec/02_state.md +++ b/x/upgrade/spec/02_state.md @@ -12,9 +12,9 @@ are stored as big endian `uint64`, and can be accessed with prefix `0x2` appende by the corresponding module name of type `string`. The state maintains a `Protocol Version` which can be accessed by key `0x3`. -- Plan: `0x0 -> Plan` -- Done: `0x1 | byte(plan name) -> BigEndian(Block Height)` -- ConsensusVersion: `0x2 | byte(module name) -> BigEndian(Module Consensus Version)` -- ProtocolVersion: `0x3 -> BigEndian(Protocol Version)` +* Plan: `0x0 -> Plan` +* Done: `0x1 | byte(plan name) -> BigEndian(Block Height)` +* ConsensusVersion: `0x2 | byte(module name) -> BigEndian(Module Consensus Version)` +* ProtocolVersion: `0x3 -> BigEndian(Protocol Version)` The `x/upgrade` module contains no genesis state. diff --git a/x/upgrade/spec/README.md b/x/upgrade/spec/README.md index 7e0d982628f2..73ea2268ac78 100644 --- a/x/upgrade/spec/README.md +++ b/x/upgrade/spec/README.md @@ -26,6 +26,6 @@ recover from. 2. **[State](02_state.md)** 3. **[Events](03_events.md)** 4. **[Client](04_client.md)** - - [CLI](04_client.md#cli) - - [REST](04_client.md#rest) - - [gRPC](04_client.md#grpc) + * [CLI](04_client.md#cli) + * [REST](04_client.md#rest) + * [gRPC](04_client.md#grpc)