Skip to content

Commit

Permalink
Merge branch 'main' into julien/autocli
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Apr 19, 2024
2 parents 953fcc2 + b491335 commit a4214c0
Show file tree
Hide file tree
Showing 321 changed files with 6,067 additions and 2,089 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,15 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* [#19833](https://github.com/cosmos/cosmos-sdk/pull/19833) Fix some places in which we call Remove inside a Walk.
* [#19851](https://github.com/cosmos/cosmos-sdk/pull/19851) Fix some places in which we call Remove inside a Walk (x/staking and x/gov).
* (baseapp) [#19970](https://github.com/cosmos/cosmos-sdk/pull/19970) Fix default config values to use no-op mempool as default.
* (crypto) [#20027](https://github.com/cosmos/cosmos-sdk/pull/20027) secp256r1 keys now implement gogoproto's customtype interface.
* (x/bank) [#20028](https://github.com/cosmos/cosmos-sdk/pull/20028) Align query with multi denoms for send-enabled.
* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format.
* (baseapp) [#19616](https://github.com/cosmos/cosmos-sdk/pull/19616) Don't share gas meter in tx execution.

### API Breaking Changes

* (x/simulation)[#20056](https://github.com/cosmos/cosmos-sdk/pull/20056) `SimulateFromSeed` now takes an address codec as argument.
* (x/crisis) [#20043](https://github.com/cosmos/cosmos-sdk/pull/20043) Changed `NewMsgVerifyInvariant` to accept a string as argument instead of an `AccAddress`.
* (x/genutil) [#19926](https://github.com/cosmos/cosmos-sdk/pull/19926) Removal of the Address.String() method and related changes:
* Added an address codec as an argument to `CollectTxs`, `GenAppStateFromConfig`, and `AddGenesisAccount`.
* Removed the `ValidatorAddressCodec` argument from `CollectGenTxsCmd`, now utilizing the context for this purpose.
Expand Down
38 changes: 17 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The Cosmos SDK is a framework for building blockchain applications. [CometBFT (B

## Quick Start

To learn how the Cosmos SDK works from a high-level perspective, see the Cosmos SDK [High-Level Intro](https://docs.cosmos.network/main/learn/intro/overview).
To learn how the Cosmos SDK works from a high-level perspective, see the Cosmos SDK [High-Level Intro](https://docs.cosmos.network/v0.50/learn/intro/overview).

If you want to get started quickly and learn how to build on top of Cosmos SDK, visit [Cosmos SDK Tutorials](https://tutorials.cosmos.network). You can also fork the tutorial's repository to get started building your own Cosmos SDK application.

Expand All @@ -66,46 +66,42 @@ The version matrix below shows which versions of the Cosmos SDK, modules and lib

#### Core Dependencies

Core Dependencies are the core libraries that a application may depend on.
Core Dependencies are the core libraries that a application may depend on.

> Note: the ❌ signals that the version of the Cosmos SDK does not need to import the dependency.
| Cosmos SDK | cosmossdk.io/core | cosmossdk.io/api | cosmossdk.io/math | cosmossdk.io/errors | cosmossdk.io/depinject | cosmossdk.io/log | cosmossdk.io/store |
|------------|-------------------|------------------|-------------------|---------------------|------------------------|------------------|--------------------|
| ---------- | ----------------- | ---------------- | ----------------- | ------------------- | ---------------------- | ---------------- | ------------------ |
| 0.50.z | 0.11.z | 0.7.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z |
| 0.47.z | 0.5.z | 0.3.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | |
| 0.46.z | | | 1.y.z | 1.y.z | | | |
| 0.47.z | 0.5.z | 0.3.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z ||
| 0.46.z ||| 1.y.z | 1.y.z ||||

#### Module Dependencies

Module Dependencies are the modules that a application may depend on and which version of the Cosmos SDK they are compatible with.

> Note: The version table only goes back to 0.50.x, this is due to the reason that modules were not spun out into their own go.mods until 0.50.z. ❌ signals that the module was not spun out into its own go.mod file.

| Cosmos SDK | 0.50.z | 0.y.z |
|-----------------------------|-----------|-------|
| cosmossdk.io/x/auth | | |
| cosmossdk.io/x/accounts | | |
| cosmossdk.io/x/bank | | |
| --------------------------- | --------- | ----- |
| cosmossdk.io/x/auth || |
| cosmossdk.io/x/accounts || |
| cosmossdk.io/x/bank || |
| cosmossdk.io/x/circuit | 0.1.z | |
| cosmossdk.io/x/consensus | | |
| cosmossdk.io/x/distribution | | |
| cosmossdk.io/x/consensus || |
| cosmossdk.io/x/distribution || |
| cosmossdk.io/x/evidence | 0.1.z | |
| cosmossdk.io/x/feegrant | 0.1.z | |
| cosmossdk.io/x/gov | | |
| cosmossdk.io/x/group | | |
| cosmossdk.io/x/mint | | |
| cosmossdk.io/x/gov || |
| cosmossdk.io/x/group || |
| cosmossdk.io/x/mint || |
| cosmossdk.io/x/nft | 0.1.z | |
| cosmossdk.io/x/protcolpool | | |
| cosmossdk.io/x/slashing | | |
| cosmossdk.io/x/staking | | |
| cosmossdk.io/x/protcolpool || |
| cosmossdk.io/x/slashing || |
| cosmossdk.io/x/staking || |
| cosmossdk.io/x/tx | =< 0.13.z | |
| cosmossdk.io/x/upgrade | 0.1.z | |




## Disambiguation

This Cosmos SDK project is not related to the [React-Cosmos](https://github.com/react-cosmos/react-cosmos) project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here.
28 changes: 14 additions & 14 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,35 +154,25 @@ The `codectypes.Any` has moved to `github.com/cosmos/gogoproto/types/any`. Modul

#### `**all**`

##### Simulation

`MsgSimulatorFn` has been updated to return an error. Its context argument has been removed, and an address.Codec has
been added to avoid the use of the Accounts.String() method.

```diff
-type MsgSimulatorFn func(r *rand.Rand, ctx sdk.Context, accs []Account) sdk.Msg
+type MsgSimulatorFn func(r *rand.Rand, accs []Account, cdc address.Codec) (sdk.Msg, error)
```

##### Core API

Core API has been introduced for modules since v0.47. With the deprecation of `sdk.Context`, we strongly recommend to use the `cosmossdk.io/core/appmodule` interfaces for the modules. This will allow the modules to work out of the box with server/v2 and baseapp, as well as limit their dependencies on the SDK.

Additionally, the `appmodule.Environment` interface is introduced to fetch different services from the application.
Additionally, the `appmodule.Environment` struct is introduced to fetch different services from the application.
This should be used as an alternative to using `sdk.UnwrapContext(ctx)` to fetch the services.
It needs to be passed into a module at instantiation.
It needs to be passed into a module at instantiation (or depinject will inject the correct environment).

`x/circuit` is used as an example:

```go
app.CircuitKeeper = circuitkeeper.NewKeeper(runtime.NewEnvironment((keys[circuittypes.StoreKey])), appCodec, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AuthKeeper.AddressCodec())
app.CircuitKeeper = circuitkeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[circuittypes.StoreKey]), logger.With(log.ModuleKey, "x/circuit")), appCodec, authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AuthKeeper.AddressCodec())
```

If your module requires a message server or query server, it should be passed in the environment as well.

```diff
-govKeeper := govkeeper.NewKeeper(appCodec, runtime.NewKVStoreService(keys[govtypes.StoreKey]), app.AuthKeeper, app.BankKeeper,app.StakingKeeper, app.PoolKeeper, app.MsgServiceRouter(), govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String())
+govKeeper := govkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[govtypes.StoreKey]), logger, runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), app.AuthKeeper, app.BankKeeper, app.StakingKeeper, app.PoolKeeper, govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String())
+govKeeper := govkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[govtypes.StoreKey]), logger.With(log.ModuleKey, "x/circuit"), runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), app.AuthKeeper, app.BankKeeper, app.StakingKeeper, app.PoolKeeper, govConfig, authtypes.NewModuleAddress(govtypes.ModuleName).String())
```

The signature of the extension interface `HasRegisterInterfaces` has been changed to accept a `cosmossdk.io/core/registry.InterfaceRegistrar` instead of a `codec.InterfaceRegistry`. `HasRegisterInterfaces` is now a part of `cosmossdk.io/core/appmodule`. Modules should update their `HasRegisterInterfaces` implementation to accept a `cosmossdk.io/core/registry.InterfaceRegistrar` interface.
Expand All @@ -192,6 +182,16 @@ The signature of the extension interface `HasRegisterInterfaces` has been change
+func (AppModule) RegisterInterfaces(registry registry.InterfaceRegistrar) {
```

##### Simulation

`MsgSimulatorFn` has been updated to return an error. Its context argument has been removed, and an address.Codec has
been added to avoid the use of the Accounts.String() method.

```diff
-type MsgSimulatorFn func(r *rand.Rand, ctx sdk.Context, accs []Account) sdk.Msg
+type MsgSimulatorFn func(r *rand.Rand, accs []Account, cdc address.Codec) (sdk.Msg, error)
```

##### Dependency Injection

Previously `cosmossdk.io/core` held functions `Invoke`, `Provide` and `Register` were moved to `cosmossdk.io/depinject/appconfig`.
Expand Down
2 changes: 1 addition & 1 deletion api/cosmos/accounts/v1/query.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a4214c0

Please sign in to comment.