Skip to content

Commit 9ec34ff

Browse files
authored
Merge branch 'cosmos:main' into fix/client-debug-helpmsg
2 parents 7b17292 + 4fe934e commit 9ec34ff

230 files changed

Lines changed: 10007 additions & 13369 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
# Search for rocksdb_version in makefile
5+
rocksdb_version=$(grep "rocksdb_version" ./scripts/build/build.mk | cut -d'=' -f2)
6+
7+
if [[ -z "${rocksdb_version}" ]]; then
8+
echo "Error: rocksdb_version not found in ./scripts/build/build.mk" >&2
9+
exit 1
10+
else
11+
echo "ROCKSDB_VERSION=${rocksdb_version}" >> "${GITHUB_ENV}"
12+
fi
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
sudo apt update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev build-essential

.github/scripts/install-rocksdb.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
if [ -z "$ROCKSDB_VERSION" ]; then
5+
echo "ROCKSDB_VERSION is not set."
6+
exit 1
7+
fi
8+
9+
# Clone RocksDB repository
10+
git clone https://github.com/facebook/rocksdb.git /home/runner/rocksdb
11+
cd /home/runner/rocksdb || exit 1
12+
git checkout "${ROCKSDB_VERSION}"
13+
14+
# Build shared library
15+
sudo make -j "$(nproc --all)" shared_lib
16+
sudo cp --preserve=links ./librocksdb.* /usr/local/lib/
17+
sudo cp -r ./include/rocksdb/ /usr/local/include/

.github/workflows/build.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,29 @@ jobs:
2121
go-arch: ["amd64", "arm", "arm64"]
2222
steps:
2323
- uses: actions/checkout@v4
24-
- uses: DeterminateSystems/nix-installer-action@main
25-
- uses: DeterminateSystems/magic-nix-cache-action@main
2624
- uses: actions/setup-go@v5
2725
with:
2826
go-version: "1.23"
2927
check-latest: true
28+
- name: Get rocksdb version
29+
run: ./.github/scripts/get-rocksdb-version.sh
30+
- name: Fix permissions for cache
31+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
32+
- name: Restore rocksdb libraries cache
33+
id: cache-rocksdb
34+
if: matrix.go-arch == 'amd64'
35+
uses: actions/cache/restore@v4
36+
with:
37+
path: |
38+
/usr/local/lib/librocksdb.*
39+
/usr/local/include/rocksdb
40+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-${{ matrix.go-arch }}
41+
- name: Install rocksdb deps
42+
if: matrix.go-arch == 'amd64'
43+
run: ./.github/scripts/install-rocksdb-deps.sh
44+
- name: Install rocksdb
45+
if: matrix.go-arch == 'amd64' && steps.cache-rocksdb.outputs.cache-hit != 'true'
46+
run: ./.github/scripts/install-rocksdb.sh
3047
###################
3148
#### Build App ####
3249
###################
@@ -35,10 +52,8 @@ jobs:
3552
- name: Build Legacy
3653
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=legacy make build
3754
- name: Build with rocksdb backend
38-
if: |
39-
env.GIT_DIFF &&
40-
matrix.go-arch == 'amd64'
41-
run: nix run . -- version --long
55+
if: matrix.go-arch == 'amd64'
56+
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="rocksdb" make build
4257
###################
4358
## Build Tooling ##
4459
###################
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Cache rocksdb libraries
2+
on:
3+
push:
4+
paths:
5+
- build.mk
6+
schedule:
7+
- cron: "*/15 * * * *" # Every 15 minutes
8+
workflow_dispatch:
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
15+
check-cache-rocksdb:
16+
name: Check existing cache
17+
runs-on: ubuntu-latest
18+
outputs:
19+
cache-hit: ${{ steps.cache-rocksdb.outputs.cache-hit }}
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Get rocksdb version
25+
run: ./.github/scripts/get-rocksdb-version.sh
26+
27+
- name: Fix permissions for cache
28+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
29+
30+
- name: Restore rocksdb libraries cache
31+
id: cache-rocksdb
32+
uses: actions/cache/restore@v4
33+
with:
34+
path: |
35+
/usr/local/lib/librocksdb.*
36+
/usr/local/include/rocksdb
37+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
38+
39+
40+
save-cache-rocksdb:
41+
name: Build rocksdb libraries and save cache
42+
runs-on: ubuntu-latest
43+
needs: check-cache-rocksdb
44+
if: needs.check-cache-rocksdb.outputs.cache-hit != 'true'
45+
steps:
46+
- uses: actions/checkout@v4
47+
48+
- name: Get rocksdb version
49+
run: ./.github/scripts/get-rocksdb-version.sh
50+
51+
- name: Install rocksdb deps
52+
run: ./.github/scripts/install-rocksdb-deps.sh
53+
- name: Install rocksdb
54+
run: ./.github/scripts/install-rocksdb.sh
55+
56+
- name: Saves rocksdb libraries cache
57+
uses: actions/cache/save@v4
58+
with:
59+
path: |
60+
/usr/local/lib/librocksdb.*
61+
/usr/local/include/rocksdb
62+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64

.github/workflows/lint.yml

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@ on:
88
merge_group:
99
permissions:
1010
contents: read
11+
1112
jobs:
1213
golangci:
1314
name: golangci-lint
1415
runs-on: ubuntu-latest
1516
steps:
1617
- uses: actions/checkout@v4
17-
- uses: DeterminateSystems/nix-installer-action@main
18-
- uses: DeterminateSystems/magic-nix-cache-action@main
1918
- uses: actions/setup-go@v5
2019
with:
2120
go-version: "1.23"
@@ -28,13 +27,30 @@ jobs:
2827
Makefile
2928
**/Makefile
3029
.golangci.yml
30+
- name: Get rocksdb version
31+
run: ./.github/scripts/get-rocksdb-version.sh
32+
- name: Fix permissions for cache
33+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
34+
- name: Restore rocksdb libraries cache
35+
id: cache-rocksdb
36+
uses: actions/cache/restore@v4
37+
with:
38+
path: |
39+
/usr/local/lib/librocksdb.*
40+
/usr/local/include/rocksdb
41+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
42+
- name: Install rocksdb deps
43+
run: ./.github/scripts/install-rocksdb-deps.sh
44+
- name: Install rocksdb
45+
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
46+
run: ./.github/scripts/install-rocksdb.sh
3147
- name: run linting (long)
3248
if: env.GIT_DIFF
3349
id: lint_long
3450
run: |
35-
nix develop -c make lint
51+
make lint
3652
env:
37-
NIX: 1
53+
ROCKSDB: 1
3854
- uses: technote-space/get-diff-action@v6.1.2
3955
if: steps.lint_long.outcome == 'skipped'
4056
with:
@@ -57,8 +73,8 @@ jobs:
5773
- name: run linting (short)
5874
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF
5975
run: |
60-
nix develop -c make lint
76+
make lint
6177
env:
6278
GIT_DIFF: ${{ env.GIT_DIFF }}
6379
LINT_DIFF: 1
64-
NIX: 1
80+
ROCKSDB: 1

.github/workflows/test.yml

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ concurrency:
1313
group: ci-${{ github.ref }}-tests
1414
cancel-in-progress: true
1515

16+
1617
jobs:
1718
split-test-files:
1819
runs-on: ubuntu-latest
@@ -774,11 +775,9 @@ jobs:
774775
runs-on: ubuntu-latest
775776
steps:
776777
- uses: actions/checkout@v4
777-
- uses: DeterminateSystems/nix-installer-action@main
778-
- uses: DeterminateSystems/magic-nix-cache-action@main
779778
- uses: actions/setup-go@v5
780779
with:
781-
go-version: "1.20"
780+
go-version: "1.23"
782781
check-latest: true
783782
cache: true
784783
cache-dependency-path: store/go.sum
@@ -789,11 +788,28 @@ jobs:
789788
store/**/*.go
790789
store/go.mod
791790
store/go.sum
791+
- name: Get rocksdb version
792+
run: ./.github/scripts/get-rocksdb-version.sh
793+
- name: Fix permissions for cache
794+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
795+
- name: Restore rocksdb libraries cache
796+
id: cache-rocksdb
797+
uses: actions/cache/restore@v4
798+
with:
799+
path: |
800+
/usr/local/lib/librocksdb.*
801+
/usr/local/include/rocksdb
802+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
803+
- name: Install rocksdb deps
804+
run: ./.github/scripts/install-rocksdb-deps.sh
805+
- name: Install rocksdb
806+
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
807+
run: ./.github/scripts/install-rocksdb.sh
792808
- name: tests
793809
if: env.GIT_DIFF
794810
run: |
795811
cd store
796-
nix develop .. -c go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
812+
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
797813
- name: sonarcloud
798814
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
799815
uses: SonarSource/sonarcloud-github-action@master
@@ -809,8 +825,6 @@ jobs:
809825
fail-fast: false
810826
steps:
811827
- uses: actions/checkout@v4
812-
- uses: DeterminateSystems/nix-installer-action@main
813-
- uses: DeterminateSystems/magic-nix-cache-action@main
814828
- uses: actions/setup-go@v5
815829
with:
816830
go-version: "1.23"
@@ -824,11 +838,28 @@ jobs:
824838
store/v2/**/*.go
825839
store/v2/go.mod
826840
store/v2/go.sum
841+
- name: Get rocksdb version
842+
run: ./.github/scripts/get-rocksdb-version.sh
843+
- name: Fix permissions for cache
844+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
845+
- name: Restore rocksdb libraries cache
846+
id: cache-rocksdb
847+
uses: actions/cache/restore@v4
848+
with:
849+
path: |
850+
/usr/local/lib/librocksdb.*
851+
/usr/local/include/rocksdb
852+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
853+
- name: Install rocksdb deps
854+
run: ./.github/scripts/install-rocksdb-deps.sh
855+
- name: Install rocksdb
856+
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
857+
run: ./.github/scripts/install-rocksdb.sh
827858
- name: test & coverage report creation
828859
if: env.GIT_DIFF
829860
run: |
830861
cd store/v2
831-
nix develop ../.. -c go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
862+
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
832863
- name: sonarcloud
833864
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
834865
uses: SonarSource/sonarcloud-github-action@master

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
4949

5050
* (client) [#21436](https://github.com/cosmos/cosmos-sdk/pull/21436) Use `address.Codec` from client.Context in `tx.Sign`.
5151
* (internal) [#21412](https://github.com/cosmos/cosmos-sdk/pull/21412) Using unsafe.String and unsafe.SliceData.
52+
* (x/genutil) [#21249](https://github.com/cosmos/cosmos-sdk/pull/21249) Incremental JSON parsing for AppGenesis where possible.
5253

5354
### Bug Fixes
5455

UPGRADING.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,20 @@ If you are still using the legacy wiring, you must enable unordered transactions
277277
}
278278
```
279279

280+
* Create or update the App's `Preblocker()` method to call the unordered tx
281+
manager's `OnNewBlock()` method.
282+
283+
```go
284+
...
285+
app.SetPreblocker(app.PreBlocker)
286+
...
287+
288+
func (app *SimApp) PreBlocker(ctx sdk.Context, req *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) {
289+
app.UnorderedTxManager.OnNewBlock(ctx.BlockTime())
290+
return app.ModuleManager.PreBlock(ctx, req)
291+
}
292+
```
293+
280294
* Create or update the App's `Close()` method to close the unordered tx manager.
281295
Note, this is critical as it ensures the manager's state is written to file
282296
such that when the node restarts, it can recover the state to provide replay
@@ -1040,7 +1054,7 @@ The `simapp` package **should not be imported in your own app**. Instead, you sh
10401054

10411055
#### App Wiring
10421056

1043-
SimApp's `app_v2.go` is using [App Wiring](https://docs.cosmos.network/main/build/building-apps/app-go-v2), the dependency injection framework of the Cosmos SDK.
1057+
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.
10441058
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).
10451059
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.
10461060

0 commit comments

Comments
 (0)