From 0d1d62ce32c5b883f025d7bfff6332a8f47fa4f0 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Mon, 22 Aug 2022 20:51:12 +0200 Subject: [PATCH 1/7] docs: add buf documentation for `third_party` folder change --- .gitignore | 5 ++-- Makefile | 6 ++--- UPGRADING.md | 72 +++++++++++++++++++++++++++------------------------- 3 files changed, 43 insertions(+), 40 deletions(-) diff --git a/.gitignore b/.gitignore index 7b61533f6e14..1ce4f5cfa123 100644 --- a/.gitignore +++ b/.gitignore @@ -50,12 +50,11 @@ vagrant # Graphviz dependency-graph.png +debug_container.dot # Latex *.aux *.out *.synctex.gz /x/genutil/config/priv_validator_key.json -/x/genutil/data/priv_validator_state.json - -debug_container.dot +/x/genutil/data/priv_validator_state.json \ No newline at end of file diff --git a/Makefile b/Makefile index c8782770832d..1168bdf9bd60 100644 --- a/Makefile +++ b/Makefile @@ -430,9 +430,9 @@ proto-check-breaking: TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0.34.21/proto/tendermint -GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos -COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master -CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.7.0 +GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/v1.3.3-alpha.regen.1 +COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/v0.3.1 +CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/go/v0.7.0 TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto TM_ABCI_TYPES = third_party/proto/tendermint/abci diff --git a/UPGRADING.md b/UPGRADING.md index ed2463e62b60..63cdee6ca39f 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -42,34 +42,6 @@ modified to set the new parameter to the desired value. ## [v0.46.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.0) -### Client Changes - -### `x/gov` - -#### `types/v1` - -The `gov` module has been greatly improved. The previous API has been moved to `v1beta1` while the new implementation is called `v1`. - -In order to submit a proposal with `submit-proposal` you now need to pass a `proposal.json` file. -You can still use the old way by using `submit-legacy-proposal`. This is not recommended. -More information can be found in the gov module [client documentation](https://docs.cosmos.network/v0.46/modules/gov/07_client.html). - -### Keyring - -The keyring has been refactored in v0.46. - -* The `Unsafe*` interfaces have been removed from the keyring package. Please use interface casting if you wish to access those unsafe functions. -* The keys' implementation has been refactored to be serialized as proto. -* `keyring.NewInMemory` and `keyring.New` takes now a `codec.Codec`. -* Take `keyring.Record` instead of `Info` as first argument in: - * `MkConsKeyOutput` - * `MkValKeyOutput` - * `MkAccKeyOutput` -* Rename: - * `SavePubKey` to `SaveOfflineKey` and remove the `algo` argument. - * `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively. - * `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`. - ### Go API Changes The `replace google.golang.org/grpc` directive can be removed from the `go.mod`, it is no more required to block the version. @@ -93,23 +65,37 @@ To improve clarity of the API, some renaming and improvements has been done: For the exhaustive list of API renaming, please refer to the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md). -### new packages +#### new packages Additionally, new packages have been introduced in order to further split the codebase. Aliases are available for a new API breaking migration, but it is encouraged to migrate to this new packages: * `errors` should replace `types/errors` when registering errors or wrapping SDK errors. * `math` contains the `Int` or `Uint` types that are used in the SDK. -### `x/authz` +#### `x/authz` * `authz.NewMsgGrant` `expiration` is now a pointer. When `nil` is used, then no expiration will be set (grant won't expire). * `authz.NewGrant` takes a new argument: block time, to correctly validate expire time. -### State Machine Changes +### Keyring -#### PostHandler +The keyring has been refactored in v0.46. + +* The `Unsafe*` interfaces have been removed from the keyring package. Please use interface casting if you wish to access those unsafe functions. +* The keys' implementation has been refactored to be serialized as proto. +* `keyring.NewInMemory` and `keyring.New` takes now a `codec.Codec`. +* Take `keyring.Record` instead of `Info` as first argument in: + * `MkConsKeyOutput` + * `MkValKeyOutput` + * `MkAccKeyOutput` +* Rename: + * `SavePubKey` to `SaveOfflineKey` and remove the `algo` argument. + * `NewMultiInfo`, `NewLedgerInfo` to `NewLegacyMultiInfo`, `newLegacyLedgerInfo` respectively. + * `NewOfflineInfo` to `newLegacyOfflineInfo` and move it to `migration_test.go`. -`postHandler` is like an `antehandler`, but is run _after_ the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`. This allows to run a custom logic after the execution of the messages. +### PostHandler + +A `postHandler` is like an `antehandler`, but is run _after_ the `runMsgs` execution. It is in the same store branch that `runMsgs`, meaning that both `runMsgs` and `postHandler`. This allows to run a custom logic after the execution of the messages. ### IAVL @@ -130,5 +116,23 @@ mistakes. ### Modules +#### `x/params` + * 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. +* The Param module will be maintained until April 18, 2023. At this point the module will reach end of life and be removed from the Cosmos SDK. + +#### `x/gov` + +The `gov` module has been greatly improved. The previous API has been moved to `v1beta1` while the new implementation is called `v1`. + +In order to submit a proposal with `submit-proposal` you now need to pass a `proposal.json` file. +You can still use the old way by using `submit-legacy-proposal`. This is not recommended. +More information can be found in the gov module [client documentation](https://docs.cosmos.network/v0.46/modules/gov/07_client.html). + +### Protobuf + +The `third_party/proto` folder that existed in [previous version](https://github.com/cosmos/cosmos-sdk/tree/v0.45.3/third_party/proto) now does not contains directly the [proto files](https://github.com/cosmos/cosmos-sdk/tree/release/v0.46.x/third_party/proto). + +Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own `buf.yaml` with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. + +The protos as well be be downloaded using `buf export buf.build/cosmos/cosmos-sdk --output `. From 8e8ad457ff1a321abc6707fff80c7057334d3c10 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 23 Aug 2022 10:46:52 +0200 Subject: [PATCH 2/7] Implement GH feedback Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> --- UPGRADING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING.md b/UPGRADING.md index 63cdee6ca39f..f38e51f85003 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -135,4 +135,4 @@ The `third_party/proto` folder that existed in [previous version](https://github Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own `buf.yaml` with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. -The protos as well be be downloaded using `buf export buf.build/cosmos/cosmos-sdk --output `. +The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk --output `. From 8243e7a3a3ff2cff759bc99c632c23d7b315cade Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 23 Aug 2022 12:12:57 +0200 Subject: [PATCH 3/7] update changelog --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b21b574190..7cd1c260d3a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,7 +45,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements -* [#12995](https://github.com/cosmos/cosmos-sdk/pull/12995) Add `FormatTime` and `ParseTimeString` methods +* [#12981](https://github.com/cosmos/cosmos-sdk/pull/12981) Return proper error when parsing telemetry configuration. +* [#12995](https://github.com/cosmos/cosmos-sdk/pull/12995) Add `FormatTime` and `ParseTimeString` methods. * [#12952](https://github.com/cosmos/cosmos-sdk/pull/12952) Replace keyring module to Cosmos fork. * [#12352](https://github.com/cosmos/cosmos-sdk/pull/12352) Move the `RegisterSwaggerAPI` logic into a separate helper function in the server package. * [#12876](https://github.com/cosmos/cosmos-sdk/pull/12876) Remove proposer-based rewards. From e1479b32f9ef22df26806fa68ce374706480e2a4 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 23 Aug 2022 12:24:10 +0200 Subject: [PATCH 4/7] add version pinning --- UPGRADING.md | 2 +- third_party/proto/README.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 third_party/proto/README.md diff --git a/UPGRADING.md b/UPGRADING.md index f38e51f85003..6413b2928c51 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -135,4 +135,4 @@ The `third_party/proto` folder that existed in [previous version](https://github Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own `buf.yaml` with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. -The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk --output `. +The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" v0.46.0) --output `. diff --git a/third_party/proto/README.md b/third_party/proto/README.md new file mode 100644 index 000000000000..f32970eb901d --- /dev/null +++ b/third_party/proto/README.md @@ -0,0 +1,7 @@ +# Buf + +To generate the protos that were present in this folder run: + +```bash +buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" ) --output .` +``` \ No newline at end of file From 116eb0292c95bacf65308af205915d93fdb2b4e2 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 23 Aug 2022 12:24:52 +0200 Subject: [PATCH 5/7] add buf yaml ressource --- UPGRADING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UPGRADING.md b/UPGRADING.md index 6413b2928c51..352de58bb4dd 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -133,6 +133,6 @@ More information can be found in the gov module [client documentation](https://d The `third_party/proto` folder that existed in [previous version](https://github.com/cosmos/cosmos-sdk/tree/v0.45.3/third_party/proto) now does not contains directly the [proto files](https://github.com/cosmos/cosmos-sdk/tree/release/v0.46.x/third_party/proto). -Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own `buf.yaml` with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. +Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own [`buf.yaml`](https://docs.buf.build/configuration/v1/buf-yaml) with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" v0.46.0) --output `. From 0a7f0fb59804bd6e7f43f0619706d6bd0a313ea5 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 23 Aug 2022 14:18:27 +0200 Subject: [PATCH 6/7] fix typo Co-authored-by: Simon Warta <2603011+webmaster128@users.noreply.github.com> --- third_party/proto/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/proto/README.md b/third_party/proto/README.md index f32970eb901d..5be358cf19d4 100644 --- a/third_party/proto/README.md +++ b/third_party/proto/README.md @@ -3,5 +3,5 @@ To generate the protos that were present in this folder run: ```bash -buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" ) --output .` +buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" ) --output . ``` \ No newline at end of file From deaa7de5085dfeb6ca439137115d6e89d1881a23 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Tue, 23 Aug 2022 14:58:03 +0200 Subject: [PATCH 7/7] use github api --- UPGRADING.md | 2 +- third_party/proto/README.md | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/UPGRADING.md b/UPGRADING.md index 352de58bb4dd..e0c1a0a7bae8 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -135,4 +135,4 @@ The `third_party/proto` folder that existed in [previous version](https://github Instead, the SDK uses [`buf`](https://buf.build). Clients should have their own [`buf.yaml`](https://docs.buf.build/configuration/v1/buf-yaml) with `buf.build/cosmos/cosmos-sdk` as dependency, in order to avoid having to copy paste these files. -The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" v0.46.0) --output `. +The protos can as well be downloaded using `buf export buf.build/cosmos/cosmos-sdk:$(curl -sS https://api.github.com/repos/cosmos/cosmos-sdk/commits/v0.46.0 | jq -r .sha) --output `. diff --git a/third_party/proto/README.md b/third_party/proto/README.md index 5be358cf19d4..d849f1d60fc0 100644 --- a/third_party/proto/README.md +++ b/third_party/proto/README.md @@ -3,5 +3,5 @@ To generate the protos that were present in this folder run: ```bash -buf export buf.build/cosmos/cosmos-sdk:$(git log -1 --pretty=format:"%H" ) --output . -``` \ No newline at end of file +buf export buf.build/cosmos/cosmos-sdk:$(curl -sS https://api.github.com/repos/cosmos/cosmos-sdk/commits/ | jq -r .sha) --output . +```