Skip to content

Commit

Permalink
Merge branch 'main' into julien/loosen-codec
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt authored Dec 16, 2024
2 parents 1958c70 + 234cdc4 commit 8b9f767
Show file tree
Hide file tree
Showing 393 changed files with 16,624 additions and 11,276 deletions.
3 changes: 2 additions & 1 deletion .github/.codespellignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ pastTime
hasTables
Nam
EyT
upTo
upTo
pullRequests
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,15 @@ updates:
labels:
- "A:automerge"
- dependencies
- package-ecosystem: gomod
directory: "/tools/benchmark"
schedule:
interval: weekly
day: wednesday
time: "03:25"
labels:
- "A:automerge"
- dependencies

# Dependencies should be up to date on release branch
- package-ecosystem: gomod
Expand Down
1 change: 1 addition & 0 deletions .github/pr_labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
- x/simulation/**/*
- x/*/simulation/**/*
- simsx/**/*
- tools/benchmark/**/*
"C:Store":
- store/**/*
"C:collections":
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ jobs:
###################
- name: Build
run: GOARCH=${{ matrix.go-arch }} make build
- name: Build Legacy
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=legacy make build
- name: Build v2
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2 make build
- name: Build with rocksdb backend
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="rocksdb" make build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/misspell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
continue-on-error: true
run: |
sudo apt-get install codespell -y
codespell -w --skip="*.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,go.sum,go.mod" --ignore-words=.github/.codespellignore
codespell -w --skip="*.pulsar.go,*.pb.go,*.pb.gw.go,*.cosmos_orm.go,*.json,*.git,*.js,crypto/keys,fuzz,*.h,proto/tendermint,*.bin,go.sum,go.mod,.github" --ignore-words=.github/.codespellignore
- uses: peter-evans/create-pull-request@v7
if: github.event_name != 'pull_request'
with:
Expand Down
36 changes: 31 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -526,11 +526,6 @@ jobs:
run: |
cd simapp
go test -mod=readonly -timeout 30m -tags='norace ledger test_ledger_mock' ./...
- name: tests simapp v1
if: env.GIT_DIFF
run: |
cd simapp
go test -mod=readonly -timeout 30m -tags='app_v1 norace ledger test_ledger_mock' ./...
test-simapp-v2:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -1541,3 +1536,34 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: x/consensus/

test-tools-benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23.2"
check-latest: true
cache: true
cache-dependency-path: tools/benchmark/go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
tools/benchmark/**/*.go
tools/benchmark/go.mod
tools/benchmark/go.sum
- name: tests
if: env.GIT_DIFF
run: |
cd tools/benchmark
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
with:
projectBaseDir: tools/benchmark/
24 changes: 24 additions & 0 deletions .github/workflows/v2-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,30 @@ concurrency:
cancel-in-progress: true

jobs:
runtime-v2:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.23"
check-latest: true
cache: true
cache-dependency-path: go.sum
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
PATTERNS: |
runtime/v2/*.go
runtime/v2/go.mod
runtime/v2/go.sum
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd runtime/v2 && go test -mod=readonly -race -timeout 30m -tags='ledger test_ledger_mock'
server-v2:
runs-on: ubuntu-latest
strategy:
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,26 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (baseapp) [#20291](https://github.com/cosmos/cosmos-sdk/pull/20291) Simulate nested messages.
* (crypto/keyring) [#21653](https://github.com/cosmos/cosmos-sdk/pull/21653) New Linux-only backend that adds Linux kernel's `keyctl` support.
* (client/keys) [#21829](https://github.com/cosmos/cosmos-sdk/pull/21829) Add support for importing hex key using standard input.
* (client) [#22807](https://github.com/cosmos/cosmos-sdk/pull/22807) Return v2 server information in the `version` command.

### Improvements

* RocksDB libraries have been upgraded to support RockDB v9 instead of v8.
* (testutil/integration) [#22616](https://github.com/cosmos/cosmos-sdk/pull/22616) Remove double context in integration tests v1.
* Use integrationApp.Context() instead of creating a context prior.
* [#22826](https://github.com/cosmos/cosmos-sdk/pull/22826) Simplify testing frameworks by removing `testutil/cmdtest`.

### Bug Fixes

* (sims) [#21906](https://github.com/cosmos/cosmos-sdk/pull/21906) Skip sims test when running dry on validators
* (cli) [#21919](https://github.com/cosmos/cosmos-sdk/pull/21919) Query address-by-acc-num by account_id instead of id.
* (cli) [#22656](https://github.com/cosmos/cosmos-sdk/pull/22656) Prune cmd should disable async pruning.

### API Breaking Changes

* (testutil) [#22392](https://github.com/cosmos/cosmos-sdk/pull/22392) Remove `testutil/network` package. Use the integration framework or systemtests framework instead.
* (client) [#22775](https://github.com/cosmos/cosmos-sdk/pull/22775) Removed client prompt validations.

### Deprecated

## [v0.52.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.52.0) - 2024-XX-XX
Expand Down Expand Up @@ -141,7 +147,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
* (genutil) [#21701](https://github.com/cosmos/cosmos-sdk/pull/21701) Improved error messages for genesis validation.
* (runtime) [#21704](https://github.com/cosmos/cosmos-sdk/pull/21704) Move `upgradetypes.StoreLoader` to runtime and alias it in upgrade for backward compatibility.
* (sims)[#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules
* (modules) [#21963](https://github.com/cosmos/cosmos-sdk/pull/21963) Duplicatable metrics are no more collected in modules. They were unecessary overhead.
* (modules) [#21963](https://github.com/cosmos/cosmos-sdk/pull/21963) Duplicatable metrics are no more collected in modules. They were unnecessary overhead.
* (crypto/ledger) [#22116](https://github.com/cosmos/cosmos-sdk/pull/22116) Improve error message when deriving paths using index >100

### Bug Fixes
Expand Down
55 changes: 30 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@

The Cosmos SDK is a framework for building blockchain applications. [CometBFT (BFT Consensus)](https://github.com/cometbft/cometbft) and the Cosmos SDK are written in the Go programming language. Cosmos SDK is used to build [Gaia](https://github.com/cosmos/gaia), the implementation of the Cosmos Hub.

**WARNING**: The Cosmos SDK has mostly stabilized, but we are still making some breaking changes.

**Note**: Always use the latest maintained [Go](https://go.dev/dl) version for building Cosmos SDK applications.

## Quick Start
Expand Down Expand Up @@ -64,16 +62,23 @@ The IBC module for the Cosmos SDK has its own [cosmos/ibc-go repository](https:/

The version matrix below shows which versions of the Cosmos SDK, modules and libraries are compatible with each other.

> [!IMPORTANT]
> Cosmos SDK `v2` corresponds to a chain using the `runtime/v2`, `server/v2/**`, and `store/v2` packages. The `github.com/cosmos/cosmos-sdk` module has a less important role in a `v2` chain.
#### Core Dependencies

Core dependencies are the core libraries that an application may depend on.
Core dependencies not mentioned here as compatible across all maintained SDK versions.
See an exhaustive list of core dependencies at [cosmossdk.io](https://cosmossdk.io).

| Cosmos SDK | cosmossdk.io/core | cosmossdk.io/api | cosmossdk.io/x/tx |
| ---------- | ----------------- | ---------------- | ----------------- |
| 0.52.z | 1.y.z | 0.8.z | 1.y.z |
| 0.50.z | 0.11.z | 0.7.z | 0.13.z |
| 0.47.z | 0.5.z | 0.3.z | N/A |
| Version | v2 | 0.52.z | 0.50.z | 0.47.z |
| ------------------------ | ----- | --------- | -------------- | ------- |
| cosmossdk.io/core | 1.y.z | 1.y.z | 0.11.z | 0.5.z |
| cosmossdk.io/api | 0.8.z | 0.8.z | 0.7.z | 0.3.z |
| cosmossdk.io/x/tx | 1.y.z | 1.y.z | < 1.y.z | N/A |
| cosmossdk.io/store | N/A | >= 1.10.z | 1.0.0 >= 1.9.z | N/A |
| cosmossdk.io/store/v2 | 2.y.z | N/A | N/A | N/A |
| cosmossdk.io/collections | 1.y.z | 1.y.z | < 1.y.z | < 1.y.z |

#### Module Dependencies

Expand All @@ -83,24 +88,24 @@ Module Dependencies are the modules that an application may depend on and which
> X signals that the module was not spun out into its own go.mod file.
> N/A signals that the module was not available in the Cosmos SDK at that time.
| Cosmos SDK | 0.50.z | 0.52.z |
| --------------------------- | ------ | ------ |
| cosmossdk.io/x/accounts | N/A | 0.2.z |
| cosmossdk.io/x/bank | X | 0.2.z |
| cosmossdk.io/x/circuit | 0.1.z | 0.2.z |
| cosmossdk.io/x/consensus | X | 0.2.z |
| cosmossdk.io/x/distribution | X | 0.2.z |
| cosmossdk.io/x/epochs | N/A | 0.2.z |
| cosmossdk.io/x/evidence | 0.1.z | 0.2.z |
| cosmossdk.io/x/feegrant | 0.1.z | 0.2.z |
| cosmossdk.io/x/gov | X | 0.2.z |
| cosmossdk.io/x/group | X | 0.2.z |
| cosmossdk.io/x/mint | X | 0.2.z |
| cosmossdk.io/x/nft | 0.1.z | 0.2.z |
| cosmossdk.io/x/protocolpool | N/A | 0.2.z |
| cosmossdk.io/x/slashing | X | 0.2.z |
| cosmossdk.io/x/staking | X | 0.2.z |
| cosmossdk.io/x/upgrade | 0.1.z | 0.2.z |
| Cosmos SDK | v2 | 0.52.z | 0.50.z |
| --------------------------- | ----- | ------ | ------ |
| cosmossdk.io/x/accounts | 0.2.z | 0.2.z | N/A |
| cosmossdk.io/x/bank | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/circuit | 0.2.z | 0.2.z | 0.1.z |
| cosmossdk.io/x/consensus | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/distribution | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/epochs | 0.2.z | 0.2.z | N/A |
| cosmossdk.io/x/evidence | 0.2.z | 0.2.z | 0.1.z |
| cosmossdk.io/x/feegrant | 0.2.z | 0.2.z | 0.1.z |
| cosmossdk.io/x/gov | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/group | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/mint | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/nft | 0.2.z | 0.2.z | 0.1.z |
| cosmossdk.io/x/protocolpool | 0.2.z | 0.2.z | N/A |
| cosmossdk.io/x/slashing | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/staking | 0.2.z | 0.2.z | X |
| cosmossdk.io/x/upgrade | 0.2.z | 0.2.z | 0.1.z |

## Disambiguation

Expand Down
8 changes: 7 additions & 1 deletion RELEASE_PROCESS.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ Those modules can be considered as part of the Cosmos SDK, but features and impr
* When a module is supposed to be used in an app (e.g `x/` modules), due to the dependency on the SDK, tagging a new version of a module must be done from a Cosmos SDK release branch. A compatibility matrix must be provided in the `README.md` of that module with the corresponding versions.
* Modules that import the SDK but do not need to be imported in an app (`e.g. cosmovisor`) must be released from the `main` branch and follow the process defined below.

> [!IMPORTANT]
> A module depending on a non stabilized version of `github.com/cosmos/cosmos-sdk` (any version prior to the removal of baseapp, runtime, server) SHOULD NOT be tagged following semver.
> For instance, modules are still using 0ver until the main `github.com/cosmos/cosmos-sdk` has stabilized.
### Modules that do not depend on the Cosmos SDK

Modules that do not depend on the Cosmos SDK can be released at any time from the `main` branch of the Cosmos SDK repository.
Expand All @@ -246,7 +250,9 @@ The Cosmos SDK uses a monorepo structure with multiple Go modules. Some componen

Here's the strategy for managing this structure:

All modules that do not depend on the Cosmos SDK and tagged from main in a release branch must be removed from the release branch.
All modules that do not depend on the Cosmos SDK and tagged from main in a release branch **must be removed from the release branch**.

There are two exceptions to this rule, due to the stabilization of core v1: `cosmossdk.io/x/tx` and `cosmossdk.io/store` are still tagged from the `release/v0.50.x` branch for `v0.50.x` releases.

### Rationale

Expand Down
14 changes: 14 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,16 @@ This change was made to allow legacy proposals to be compatible with server/v2.
If you wish to migrate to server/v2, you should update your proposal handler to take in a `context.Context` and use services.
On the other hand, if you wish to keep using baseapp, simply unwrap the sdk context in your proposal handler.

#### `x/mint`

The `x/mint` module has been updated to work with a mint function [`MintFn`](https://docs.cosmos.network/v0.52/build/modules/mint#mintfn).

When using the default inflation calculation function and runtime, no change is required. The depinject configuration of mint automatically sets it if none is provided. However, when not using runtime, the mint function must be set in on the mint keeper:

```diff
+ mintKeeper.SetMintFn(keeper.DefaultMintFn(types.DefaultInflationCalculationFn, stakingKeeper, mintKeeper))
```

#### `x/protocolpool`

Introducing a new `x/protocolpool` module to handle community pool funds. Its store must be added while upgrading to v0.52.x.
Expand Down Expand Up @@ -532,6 +542,10 @@ storetypes.StoreUpgrades{
Introducing `x/validate` a module that is solely used for registering default ante/post handlers and global tx validators when using runtime and runtime/v2. If you wish to set your custom ante/post handlers, no need to use this module.
You can however always extend them by adding extra tx validators (see `x/validate` documentation).

#### `tools/benchmark`

Introducing [`tools/benchmark`](https://github.com/cosmos/cosmos-sdk/tree/main/tools/benchmark) a Cosmos SDK module for benchmarking your chain. It is a standalone module that can be added to your chain to stress test it. This module should NOT be added in a production environment.

## [v0.50.x](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-alpha.0)

### Migration to CometBFT (Part 2)
Expand Down
Loading

0 comments on commit 8b9f767

Please sign in to comment.