Skip to content

Commit

Permalink
chore: improve UGPRADING.md (#15236)
Browse files Browse the repository at this point in the history
Co-authored-by: Marko <marbar3778@yahoo.com>
  • Loading branch information
julienrbrt and tac0turtle committed Mar 2, 2023
1 parent 364b5eb commit de16912
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 41 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### API Breaking Changes

* [#15211](https://github.com/cosmos/cosmos-sdk/pull/15211) Remove usage of `github.com/cometbft/cometbft/libs/bytes.HexBytes` in favor of `[]byte` thorough the SDK.
* [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) All functions that were taking a CometBFT logger, now take `cosmossdk.io/log.Logger` instead.
* (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Refactor transaction searching:
* Refactor `QueryTxsByEvents` to accept a `query` of type `string` instead of `events` of type `[]string`
Expand Down
63 changes: 23 additions & 40 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,26 @@ This guide provides instructions for upgrading to specific versions of Cosmos SD

### Migration to CometBFT (Part 2)

The Cosmos SDK has migrated in, its previous versions, to CometBFT.
Some functions have been renamed to reflect the naming change. And the Cosmos SDK has removed the import of cmtbytes "github.com/cometbft/cometbft/libs/bytes".
There is something changed.Due to the import changes, this is a breaking change. Chains need to remove **entirely** their imports in their codebase, from direct and indirects imports.
The Cosmos SDK has migrated in its previous versions, to CometBFT.
Some functions have been renamed to reflect the naming change.

Following an exhaustive list:

* `client.TendermintRPC` -> `client.CometRPC`
* `clitestutil.MockTendermintRPC` -> `clitestutil.MockCometRPC`
* `clitestutilgenutil.CreateDefaultTendermintConfig` -> `clitestutilgenutil.CreateDefaultCometConfig`
* Package `client/grpc/tmservice` -> `client/grpc/cmtservice`
* Remove `github.com/cometbft/cometbft/libs/bytes` & Replace All `cmtbytes.HexBytes` by `[]byte` except `*pb.go`files
* Verify `github.com/cometbft/cometbft/libs/bytes` is not an indirect or direct dependency
* Run `make proto-gen`

Additionally, the commands and flags mentionning `tendermint` have been renamed to `comet`.
Additionally, the commands and flags mentioning `tendermint` have been renamed to `comet`.
However, these commands and flags is still supported for backward compatibility.

For backward compatibility, the `**/tendermint/**` gRPC services are still supported.

Additionally, the SDK is starting its abstraction from CometBFT Go types thorought the codebase:

* The usage of CometBFT have been replaced to use the Cosmos SDK logger interface (`cosmossdk.io/log.Logger`).
* The usage of `github.com/cometbft/cometbft/libs/bytes.HexByte` have been replaced by `[]byte`.

### Configuration

A new tool have been created for migrating configuration of the SDK. Use the following command to migrate your configuration:
Expand All @@ -41,29 +42,33 @@ gRPC-Web is now listening to the same address as the gRPC Gateway API server (de
The possibility to listen to a different address has been removed, as well as its settings.
Use `confix` to clean-up your `app.toml`. A nginx (or alike) reverse-proxy can be set to keep the previous behavior.

#### Database
#### Database Support

ClevelDB, BoltDB and BadgerDB are not supported anymore. To migrate from a unsupported database to a supported database please use the database migration tool.

#### GoLevelDB

GoLevelDB version has been pinned to `v1.0.1-0.20210819022825-2ae1ddf74ef7`, following versions might cause unexpected behavior.
See related issues:

* [issue #14949 on cosmos-sdk](https://github.com/cosmos/cosmos-sdk/issues/14949)
* [issue #25413 on go-ethereum](https://github.com/ethereum/go-ethereum/pull/25413)

### Protobuf

The SDK is in the process of removing all `gogoproto` annotations.
The SDK is in the process of removing all `(gogoproto.casttype) = "github.com/cometbft/cometbft/libs/bytes.HexBytes"`.

#### Stringer

The `gogoproto.goproto_stringer = false` annotation has been removed from most proto files. This means that the `String()` method is being generated for types that previously had this annotation. The generated `String()` method uses `proto.CompactTextString` for _stringifying_ structs.
[Verify](https://github.com/cosmos/cosmos-sdk/pull/13850#issuecomment-1328889651) the usage of the modified `String()` methods and double-check that they are not used in state-machine code.

### Types
### SimApp

#### Module Assertions

Previously, all modules were required to be set in `OrderBeginBlockers`, `OrderEndBlockers` and `OrderInitGenesis / OrderExportGenesis` in `app.go` / `app_config.go`.
This is no longer the case, the assertion has been loosened to only require modules implementing, respectively, the `module.BeginBlockAppModule`, `module.EndBlockAppModule` and `module.HasGenesis` interfaces.

#### Replaces

* `GoLevelDB` version has been pinned to `v1.0.1-0.20210819022825-2ae1ddf74ef7`, following versions might cause unexpected behavior.
* [issue #14949 on cosmos-sdk](https://github.com/cosmos/cosmos-sdk/issues/14949)
* [issue #25413 on go-ethereum](https://github.com/ethereum/go-ethereum/pull/25413)

### Packages

#### Store

Expand All @@ -74,13 +79,6 @@ References to `types/store.go` which contained aliases for store types have been
The `store` module is extracted to have a separate go.mod file which allows it be a standalone module.
All the store imports are now renamed to use `cosmossdk.io/store` instead of `github.com/cosmos/cosmos-sdk/store` across the SDK.

### SimApp

#### Module Assertions

Previously, all modules were required to be set in `OrderBeginBlockers`, `OrderEndBlockers` and `OrderInitGenesis / OrderExportGenesis` in `app.go` / `app_config.go`.
This is no longer the case, the assertion has been loosened to only require modules implementing, respectively, the `module.BeginBlockAppModule`, `module.EndBlockAppModule` and `module.HasGenesis` interfaces.

### Modules

#### `x/gov`
Expand All @@ -106,18 +104,6 @@ By default, the new `ProposalCancelRatio` parameter is set to 0.5 during migrati

The `x/evidence` module is extracted to have a separate go.mod file which allows it be a standalone module.
All the evidence imports are now renamed to use `cosmossdk.io/x/evidence` instead of `github.com/cosmos/cosmos-sdk/x/evidence` across the SDK.
All the evidence removed `github.com/cometbft/cometbft/libs/bytes`.
All the evidence functions or params are now renamed to use `cmtbytes.HexBytes` or `bytes.HexBytes` instead of `[]byte` across the SDK.

#### `x/bank`

All the bank removed `github.com/cometbft/cometbft/libs/bytes`.
All the bank functions or params are now renamed to use `[]byte` instead of `cmtbytes.HexBytes` or `bytes.HexBytes` across the SDK.

#### `x/simulation`

All the simulation removed `github.com/cometbft/cometbft/libs/bytes`
All the simulation functions or params are now renamed to use `cmtbytes.HexBytes` or `bytes.HexBytes` instead of `[]byte` across the SDK.

#### `x/nft`

Expand Down Expand Up @@ -515,7 +501,4 @@ message MsgSetWithdrawAddress {
}
```

<!-- todo: cosmos.scalar types -->

When clients interract with a node they are required to set a codec in in the grpc.Dial. More information can be found in this [doc](https://docs.cosmos.network/v0.46/run-node/interact-node.html#programmatically-via-go).

1 change: 0 additions & 1 deletion proto/cosmos/evidence/v1beta1/query.proto
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ syntax = "proto3";
package cosmos.evidence.v1beta1;

import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "google/api/annotations.proto";

Expand Down

0 comments on commit de16912

Please sign in to comment.