Skip to content

Commit cbe12da

Browse files
authored
Merge branch 'main' into son/gov_audit
2 parents ae68ee1 + 04cec5b commit cbe12da

File tree

158 files changed

+1358
-2575
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+1358
-2575
lines changed

.github/scripts/install-rocksdb.sh

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
# Update and install dependencies
10+
sudo apt update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev build-essential
11+
12+
# Clone RocksDB repository
13+
git clone https://github.com/facebook/rocksdb.git /home/runner/rocksdb
14+
cd /home/runner/rocksdb || exit 1
15+
git checkout "v${ROCKSDB_VERSION}"
16+
17+
# Build shared library
18+
sudo make -j "$(nproc --all)" shared_lib
19+
sudo cp --preserve=links ./librocksdb.* /usr/local/lib/
20+
sudo cp -r ./include/rocksdb/ /usr/local/include/

.github/workflows/build.yml

+28-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ci-${{ github.ref }}-build
1414
cancel-in-progress: true
1515

16+
env:
17+
ROCKSDB_VERSION: 8.11.3
18+
1619
jobs:
1720
build:
1821
runs-on: ubuntu-latest
@@ -21,12 +24,33 @@ jobs:
2124
go-arch: ["amd64", "arm", "arm64"]
2225
steps:
2326
- uses: actions/checkout@v4
24-
- uses: DeterminateSystems/nix-installer-action@main
25-
- uses: DeterminateSystems/magic-nix-cache-action@main
2627
- uses: actions/setup-go@v5
2728
with:
2829
go-version: "1.23"
2930
check-latest: true
31+
- name: Fix permissions for cache
32+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
33+
- name: Restore rocksdb libraries cache
34+
id: cache-rocksdb
35+
if: matrix.go-arch == 'amd64'
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 }}-${{ matrix.go-arch }}
42+
- name: Install rocksdb
43+
if: matrix.go-arch == 'amd64' && steps.cache-rocksdb.outputs.cache-hit != 'true'
44+
id: install_rocksdb
45+
run: ./.github/scripts/install-rocksdb.sh
46+
- name: Saves rocksdb libraries cache
47+
if: matrix.go-arch == 'amd64' && steps.install_rocksdb.outcome == 'success'
48+
uses: actions/cache/restore@v4
49+
with:
50+
path: |
51+
/usr/local/lib/librocksdb.*
52+
/usr/local/include/rocksdb
53+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-${{ matrix.go-arch }}
3054
###################
3155
#### Build App ####
3256
###################
@@ -35,10 +59,8 @@ jobs:
3559
- name: Build Legacy
3660
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=legacy make build
3761
- name: Build with rocksdb backend
38-
if: |
39-
env.GIT_DIFF &&
40-
matrix.go-arch == 'amd64'
41-
run: nix run . -- version --long
62+
if: matrix.go-arch == 'amd64'
63+
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS="rocksdb" make build
4264
###################
4365
## Build Tooling ##
4466
###################

.github/workflows/lint.yml

+30-6
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ on:
88
merge_group:
99
permissions:
1010
contents: read
11+
12+
env:
13+
ROCKSDB_VERSION: 8.11.3
14+
1115
jobs:
1216
golangci:
1317
name: golangci-lint
1418
runs-on: ubuntu-latest
1519
steps:
1620
- uses: actions/checkout@v4
17-
- uses: DeterminateSystems/nix-installer-action@main
18-
- uses: DeterminateSystems/magic-nix-cache-action@main
1921
- uses: actions/setup-go@v5
2022
with:
2123
go-version: "1.23"
@@ -28,13 +30,35 @@ jobs:
2830
Makefile
2931
**/Makefile
3032
.golangci.yml
33+
- name: Fix permissions for cache
34+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
35+
- name: Restore rocksdb libraries cache
36+
id: cache-rocksdb
37+
uses: actions/cache/restore@v4
38+
with:
39+
path: |
40+
/usr/local/lib/librocksdb.*
41+
/usr/local/include/rocksdb
42+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
43+
- name: Install rocksdb
44+
if: env.GIT_DIFF && steps.cache-rocksdb.outputs.cache-hit != 'true'
45+
id: install_rocksdb
46+
run: ./.github/scripts/install-rocksdb.sh
47+
- name: Saves rocksdb libraries cache
48+
if: steps.install_rocksdb.outcome == 'success'
49+
uses: actions/cache/restore@v4
50+
with:
51+
path: |
52+
/usr/local/lib/librocksdb.*
53+
/usr/local/include/rocksdb
54+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
3155
- name: run linting (long)
3256
if: env.GIT_DIFF
3357
id: lint_long
3458
run: |
35-
nix develop -c make lint
59+
make lint
3660
env:
37-
NIX: 1
61+
ROCKSDB: 1
3862
- uses: technote-space/[email protected]
3963
if: steps.lint_long.outcome == 'skipped'
4064
with:
@@ -57,8 +81,8 @@ jobs:
5781
- name: run linting (short)
5882
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF
5983
run: |
60-
nix develop -c make lint
84+
make lint
6185
env:
6286
GIT_DIFF: ${{ env.GIT_DIFF }}
6387
LINT_DIFF: 1
64-
NIX: 1
88+
ROCKSDB: 1

.github/workflows/test.yml

+50-7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ concurrency:
1313
group: ci-${{ github.ref }}-tests
1414
cancel-in-progress: true
1515

16+
env:
17+
ROCKSDB_VERSION: 8.11.3
18+
1619
jobs:
1720
split-test-files:
1821
runs-on: ubuntu-latest
@@ -774,11 +777,9 @@ jobs:
774777
runs-on: ubuntu-latest
775778
steps:
776779
- uses: actions/checkout@v4
777-
- uses: DeterminateSystems/nix-installer-action@main
778-
- uses: DeterminateSystems/magic-nix-cache-action@main
779780
- uses: actions/setup-go@v5
780781
with:
781-
go-version: "1.20"
782+
go-version: "1.23"
782783
check-latest: true
783784
cache: true
784785
cache-dependency-path: store/go.sum
@@ -789,11 +790,33 @@ jobs:
789790
store/**/*.go
790791
store/go.mod
791792
store/go.sum
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
804+
if: env.GIT_DIFF && steps.cache-rocksdb.outputs.cache-hit != 'true'
805+
id: install_rocksdb
806+
run: ./.github/scripts/install-rocksdb.sh
807+
- name: Saves rocksdb libraries cache
808+
if: steps.install_rocksdb.outcome == 'success'
809+
uses: actions/cache/restore@v4
810+
with:
811+
path: |
812+
/usr/local/lib/librocksdb.*
813+
/usr/local/include/rocksdb
814+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
792815
- name: tests
793816
if: env.GIT_DIFF
794817
run: |
795818
cd store
796-
nix develop .. -c go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
819+
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
797820
- name: sonarcloud
798821
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
799822
uses: SonarSource/sonarcloud-github-action@master
@@ -809,8 +832,6 @@ jobs:
809832
fail-fast: false
810833
steps:
811834
- uses: actions/checkout@v4
812-
- uses: DeterminateSystems/nix-installer-action@main
813-
- uses: DeterminateSystems/magic-nix-cache-action@main
814835
- uses: actions/setup-go@v5
815836
with:
816837
go-version: "1.23"
@@ -824,11 +845,33 @@ jobs:
824845
store/v2/**/*.go
825846
store/v2/go.mod
826847
store/v2/go.sum
848+
- name: Fix permissions for cache
849+
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
850+
- name: Restore rocksdb libraries cache
851+
id: cache-rocksdb
852+
uses: actions/cache/restore@v4
853+
with:
854+
path: |
855+
/usr/local/lib/librocksdb.*
856+
/usr/local/include/rocksdb
857+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
858+
- name: Install rocksdb
859+
if: env.GIT_DIFF && steps.cache-rocksdb.outputs.cache-hit != 'true'
860+
id: install_rocksdb
861+
run: ./.github/scripts/install-rocksdb.sh
862+
- name: Saves rocksdb libraries cache
863+
if: steps.install_rocksdb.outcome == 'success'
864+
uses: actions/cache/restore@v4
865+
with:
866+
path: |
867+
/usr/local/lib/librocksdb.*
868+
/usr/local/include/rocksdb
869+
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
827870
- name: test & coverage report creation
828871
if: env.GIT_DIFF
829872
run: |
830873
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' ./...
874+
go test -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
832875
- name: sonarcloud
833876
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
834877
uses: SonarSource/sonarcloud-github-action@master

CHANGELOG.md

+1
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -1040,7 +1040,7 @@ The `simapp` package **should not be imported in your own app**. Instead, you sh
10401040

10411041
#### App Wiring
10421042

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.
1043+
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.
10441044
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).
10451045
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.
10461046

0 commit comments

Comments
 (0)