From 048c70968103de3cfa93c9c596818ba1361e6abb Mon Sep 17 00:00:00 2001 From: Marko Date: Mon, 8 Aug 2022 21:21:23 +0200 Subject: [PATCH] docs: add docs on param module deprecation (#12611) * add docs on param module deprecation * remove todos * fix doc * Update x/params/spec/README.md Co-authored-by: Aleksandr Bezobchuk * Update UPGRADING.md Co-authored-by: Aleksandr Bezobchuk Co-authored-by: Aleksandr Bezobchuk --- UPGRADING.md | 5 +++++ docs/building-modules/keeper.md | 4 +++- docs/core/baseapp.md | 5 ++--- docs/core/store.md | 2 +- x/params/spec/README.md | 4 +++- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 355d625d0c..35d548ce00 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -123,3 +123,8 @@ As a result, it gives a good indication of the progress of the upgrade. There is also downgrade and re-upgrade protection. If a node operator chooses to downgrade to IAVL pre-fast index, and then upgrade again, the index is rebuilt from scratch. This implementation detail should not be relevant in most cases. It was added as a safeguard against operator mistakes. + +### Modules + +- The `x/param` module has been depreacted in favour of each module housing and providing way to modify their parameters. Each module that has parameters that are changable during runtime have an authority, the authority can be a module or user account. The Cosmos-SDK team recommends migrating modules away from using the param module. An example of how this could look like can be found [here](https://github.com/cosmos/cosmos-sdk/pull/12363). + - The Param module will be maintained until April 18, 2022. At this point the module will reach end of life and be removed from the Cosmos SDK. diff --git a/docs/building-modules/keeper.md b/docs/building-modules/keeper.md index 78712a91b3..294ad48a5a 100644 --- a/docs/building-modules/keeper.md +++ b/docs/building-modules/keeper.md @@ -29,6 +29,8 @@ type Keeper struct { // Store key(s) // codec + + // authority } ``` @@ -40,7 +42,7 @@ Let us go through the different parameters: * An expected `keeper` is a `keeper` external to a module that is required by the internal `keeper` of said module. External `keeper`s are listed in the internal `keeper`'s type definition as interfaces. These interfaces are themselves defined in an `expected_keepers.go` file in the root of the module's folder. In this context, interfaces are used to reduce the number of dependencies, as well as to facilitate the maintenance of the module itself. * `storeKey`s grant access to the store(s) of the [multistore](../core/store.md) managed by the module. They should always remain unexposed to external modules. -* `cdc` is the [codec](../core/encoding.md) used to marshall and unmarshall structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. +* `cdc` is the [codec](../core/encoding.md) used to marshall and unmarshall structs to/from `[]byte`. The `cdc` can be any of `codec.BinaryCodec`, `codec.JSONCodec` or `codec.Codec` based on your requirements. It can be either a proto or amino codec as long as they implement these interfaces. The authority listed is a module account or user account that has the right to change module level parameters. Previously this was handled by the param module, which has been deprecated. Of course, it is possible to define different types of internal `keeper`s for the same module (e.g. a read-only `keeper`). Each type of `keeper` comes with its own constructor function, which is called from the [application's constructor function](../basics/app-anatomy.md). This is where `keeper`s are instantiated, and where developers make sure to pass correct instances of modules' `keeper`s to other modules that require them. diff --git a/docs/core/baseapp.md b/docs/core/baseapp.md index 0144cbeeb3..4172536bf5 100644 --- a/docs/core/baseapp.md +++ b/docs/core/baseapp.md @@ -69,7 +69,6 @@ First, the important parameters that are initialized during the bootstrapping of are relayed to the relevant module's gRPC `Query` service. * [`TxDecoder`](https://pkg.go.dev/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, and other pre-message execution checks when a transaction is received. It's executed during [`CheckTx/RecheckTx`](#checktx) and [`DeliverTx`](#delivertx). @@ -182,8 +181,8 @@ newly committed state and `deliverState` is set to `nil` to be reset on `BeginBl During `InitChain`, the `RequestInitChain` provides `ConsensusParams` which contains parameters related to block execution such as maximum gas and size in addition to evidence parameters. If these parameters are non-nil, they are set in the BaseApp's `ParamStore`. Behind the scenes, the `ParamStore` -is actually managed by an `x/params` module `Subspace`. This allows the parameters to be tweaked via -on-chain governance. +is managed by an `x/consensus_params` module. This allows the parameters to be tweaked via + on-chain governance. ## Service Routers diff --git a/docs/core/store.md b/docs/core/store.md index 5852f3a89c..b0f6390eea 100644 --- a/docs/core/store.md +++ b/docs/core/store.md @@ -148,7 +148,7 @@ The documentation on the IAVL Tree is located [here](https://github.com/cosmos/i `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) -### `Transient` Store +### `Transient` Store `Transient.Store` is a base-layer `KVStore` which is automatically discarded at the end of the block. diff --git a/x/params/spec/README.md b/x/params/spec/README.md index 6f0387a01c..cdeeb1a660 100644 --- a/x/params/spec/README.md +++ b/x/params/spec/README.md @@ -5,7 +5,9 @@ parent: title: "params" --> -# `params` +# `params` (Deprecated) + +> Note: The Params module has been depreacted in favour of each module housing its own parameters. ## Abstract