Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -1177,8 +1177,8 @@ The `simapp` package **should not be imported in your own app**. Instead, you sh
#### App Wiring

SimApp's `app_di.go` is using [App Wiring](https://docs.cosmos.network/main/build/building-apps/app-go-di), the dependency injection framework of the Cosmos SDK.
This means that modules are injected directly into SimApp thanks to a [configuration file](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go).
The previous behavior, without the dependency injection framework, is still present in [`app.go`](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app.go) and is not going anywhere.
This means that modules are injected directly into SimApp thanks to a [configuration file](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/simapp/app_config.go).
The previous behavior, without the dependency injection framework, is still present in [`app.go`](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/simapp/app.go) and is not going anywhere.

If you are using a `app.go` without dependency injection, add the following lines to your `app.go` in order to provide newer gRPC services:

Expand Down
2 changes: 1 addition & 1 deletion depinject/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Provider functions serve as the basis for the dependency tree. They are analysed

`depinject` supports the use of interface types as inputs to provider functions, which helps decouple dependencies between modules. This approach is particularly useful for managing complex systems with multiple modules, such as the Cosmos SDK, where dependencies need to be flexible and maintainable.

For example, `x/bank` expects an [AccountKeeper](https://pkg.go.dev/cosmossdk.io/x/bank/types#AccountKeeper) interface as [input to ProvideModule](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/bank/module.go#L208-L260). `SimApp` uses the implementation in `x/auth`, but the modular design allows for easy changes to the implementation if needed.
For example, `x/bank` expects an [AccountKeeper](https://pkg.go.dev/cosmossdk.io/x/bank/types#AccountKeeper) interface as [input to ProvideModule](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/bank/module.go#L208-L260). `SimApp` uses the implementation in `x/auth`, but the modular design allows for easy changes to the implementation if needed.

Consider the following example:

Expand Down
2 changes: 1 addition & 1 deletion depinject/appconfig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ satisfy this dependency graph which allows staking and slashing to depend on eac
In order to test and debug the module configuration, we need to build an app config, generally defined in a YAML file.
This configuration should be passed first to `appconfig.LoadYAML` to get an `depinject.Config` instance.Then the
`depinject.Config` can be passed to `depinject.Inject` and we can try to resolve dependencies in the app config.
Alternatively, the `depinject.Config` can be created via [pure Go code](https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/simapp/app_config.go).
Alternatively, the `depinject.Config` can be created via [pure Go code](https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/simapp/app_config.go).

Ex:

Expand Down
6 changes: 3 additions & 3 deletions x/auth/tx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ This package represents the Cosmos SDK implementation of the `client.TxConfig`,
The interface defines a set of methods for creating a `client.TxBuilder`.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L25-L31
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/client/tx_config.go#L25-L31
```

The default implementation of `client.TxConfig` is instantiated by `NewTxConfig` in `x/auth/tx` module.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/auth/tx/config.go#L22-L28
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/auth/tx/config.go#L22-L28
```

### `TxBuilder`

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/client/tx_config.go#L33-L50
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/client/tx_config.go#L33-L50
```

The [`client.TxBuilder`](https://docs.cosmos.network/main/core/transactions#transaction-generation) interface is as well implemented by `x/auth/tx`.
Expand Down
12 changes: 6 additions & 6 deletions x/auth/vesting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,25 +78,25 @@ type VestingAccount interface {
### BaseVestingAccount

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L11-L35
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L11-L35
```

### ContinuousVestingAccount

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L37-L46
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L37-L46
```

### DelayedVestingAccount

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L48-L57
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L48-L57
```

### Period

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L59-L69
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L59-L69
```

```go
Expand All @@ -108,7 +108,7 @@ type Periods []Period
### PeriodicVestingAccount

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L71-L81
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L71-L81
```

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 is updated to contain the following:
Expand All @@ -128,7 +128,7 @@ type ViewKeeper interface {
### PermanentLockedAccount

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/vesting/v1beta1/vesting.proto#L83-L94
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/vesting/v1beta1/vesting.proto#L83-L94
```

## Vesting Account Specification
Expand Down
4 changes: 2 additions & 2 deletions x/evidence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ The Cosmos SDK handles two types of evidence inside the ABCI `BeginBlock`:
The evidence module handles these two evidence types the same way. First, the Cosmos SDK converts the CometBFT concrete evidence type to an SDK `Evidence` interface using `Equivocation` as the concrete type.

```protobuf reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50/proto/cosmos/evidence/v1beta1/evidence.proto#L12-L32
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/evidence/v1beta1/evidence.proto#L12-L32
```

For some `Equivocation` submitted in `block` to be valid, it must satisfy:
Expand All @@ -243,7 +243,7 @@ validator to ever re-enter the validator set.
The `Equivocation` evidence is handled as follows:

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.50/x/evidence/keeper/infraction.go#L26-L140
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/evidence/keeper/infraction.go#L26-L140
```

**Note:** The slashing, jailing, and tombstoning calls are delegated through the `x/slashing` module
Expand Down
30 changes: 15 additions & 15 deletions x/group/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ custom decision policies, as long as they adhere to the `DecisionPolicy`
interface:

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/types.go#L27-L45
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/types.go#L27-L45
```

#### Threshold decision policy
Expand Down Expand Up @@ -337,7 +337,7 @@ The metadata has a maximum length that is chosen by the app developer, and
passed into the group keeper as a config.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L67-L80
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L67-L80
```

It's expected to fail if
Expand All @@ -350,7 +350,7 @@ It's expected to fail if
Group members can be updated with the `UpdateGroupMembers`.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L88-L102
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L88-L102
```

In the list of `MemberUpdates`, an existing member can be removed by setting its weight to 0.
Expand All @@ -365,7 +365,7 @@ It's expected to fail if:
The `UpdateGroupAdmin` can be used to update a group admin.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L107-L120
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L107-L120
```

It's expected to fail if the signer is not the admin of the group.
Expand All @@ -375,7 +375,7 @@ It's expected to fail if the signer is not the admin of the group.
The `UpdateGroupMetadata` can be used to update a group metadata.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L125-L138
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L125-L138
```

It's expected to fail if:
Expand All @@ -388,7 +388,7 @@ It's expected to fail if:
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.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L147-L165
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L147-L165
```

It's expected to fail if:
Expand All @@ -402,7 +402,7 @@ It's expected to fail if:
A new group with policy can be created with the `MsgCreateGroupWithPolicy`, which has an admin address, a list of members, a decision policy, a `group_policy_as_admin` field to optionally set group and group policy admin with group policy address and some optional metadata for group and group policy.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L191-L215
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L191-L215
```

It's expected to fail for the same reasons as `Msg/CreateGroup` and `Msg/CreateGroupPolicy`.
Expand All @@ -412,7 +412,7 @@ It's expected to fail for the same reasons as `Msg/CreateGroup` and `Msg/CreateG
The `UpdateGroupPolicyAdmin` can be used to update a group policy admin.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L173-L186
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L173-L186
```

It's expected to fail if the signer is not the admin of the group policy.
Expand All @@ -422,7 +422,7 @@ It's expected to fail if the signer is not the admin of the group policy.
The `UpdateGroupPolicyDecisionPolicy` can be used to update a decision policy.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L226-L241
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L226-L241
```

It's expected to fail if:
Expand All @@ -435,7 +435,7 @@ It's expected to fail if:
The `UpdateGroupPolicyMetadata` can be used to update a group policy metadata.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L246-L259
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L246-L259
```

It's expected to fail if:
Expand All @@ -449,7 +449,7 @@ A new proposal can be created with the `MsgSubmitProposal`, which has a group po
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.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L281-L315
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L281-L315
```

It's expected to fail if:
Expand All @@ -462,7 +462,7 @@ It's expected to fail if:
A proposal can be withdrawn using `MsgWithdrawProposal` which has an `address` (can be either a proposer or the group policy admin) and a `proposal_id` (which has to be withdrawn).

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L323-L333
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L323-L333
```

It's expected to fail if:
Expand All @@ -476,7 +476,7 @@ A new vote can be created with the `MsgVote`, given a proposal id, a voter addre
An optional `Exec` value can be provided to try to execute the proposal immediately after voting.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L338-L358
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L338-L358
```

It's expected to fail if:
Expand All @@ -489,7 +489,7 @@ It's expected to fail if:
A proposal can be executed with the `MsgExec`.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L363-L373
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L363-L373
```

The messages that are part of this proposal won't be executed if:
Expand All @@ -502,7 +502,7 @@ The messages that are part of this proposal won't be executed if:
The `MsgLeaveGroup` allows group member to leave a group.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/group/v1/tx.proto#L381-L391
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/proto/cosmos/group/v1/tx.proto#L381-L391
```

It's expected to fail if:
Expand Down
22 changes: 11 additions & 11 deletions x/group/internal/orm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The orm package provides a framework for creating relational database tables wit
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.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/table.go#L30-L36
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/table.go#L30-L36
```

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.
Expand All @@ -42,7 +42,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.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/auto_uint64.go#L15-L18
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/auto_uint64.go#L15-L18
```

It's based on the `Sequence` struct which is a persistent unique key generator based on a counter encoded using 8 byte big endian.
Expand All @@ -56,7 +56,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:

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/primary_key.go#L30-L44
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/primary_key.go#L30-L44
```

`PrimaryKeyFields()` method returns the list of key parts for a given object.
Expand All @@ -75,25 +75,25 @@ Key parts, except the last part, follow these rules:
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.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/types.go#L88-L93
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/types.go#L88-L93
```

### MultiKeyIndex

A `MultiKeyIndex` is an index where multiple entries can point to the same underlying object.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/index.go#L26-L32
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/index.go#L26-L32
```

Internally, it uses an `Indexer` that manages the persistence of the index based on searchable keys and create/update/delete operations.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/index.go#L15-L20
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/index.go#L15-L20
```

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/indexer.go#L15-L19
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/indexer.go#L15-L19
```

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.
Expand All @@ -112,19 +112,19 @@ Both [tables](01_table.md) and [secondary indexes](02_secondary_index.md) suppor
An `Iterator` allows iteration through a sequence of key value pairs.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/types.go#L77-L85
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/types.go#L77-L85
```

Tables rely on a `typeSafeIterator` that is used by `PrefixScan` and `ReversePrefixScan` `table` methods to iterate through a range of `RowID`s.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/table.go#L287-L291
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/table.go#L287-L291
```

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.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/index.go#L233-L239
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/index.go#L233-L239
```

Under the hood, both use a prefix store `Iterator` (alias for tm-db `Iterator`).
Expand All @@ -135,7 +135,7 @@ The `Paginate` function does pagination given an [`Iterator`](#iterator) and a `
It unmarshals the results into the provided dest interface that should be a pointer to a slice of models.

```go reference
https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/x/group/internal/orm/iterator.go#L102-L220
https://github.com/cosmos/cosmos-sdk/tree/release/v0.50.x/x/group/internal/orm/iterator.go#L102-L220
```

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`.
Loading