Skip to content

Commit 972661e

Browse files
committed
Merge branch 'main' into alex/sims2_main
* main: docs(client/debug): correct `debug raw-bytes` command example (#21671) build: don't reinstall golangci-lint if already installed (#21662) refactor(server/v2): kill viper from server components (#21663) chore: sync changelog with latest releases (#21658) refactor: remove viper as a direct dependency (#21635) ci: centralized job for rocksdb libaries cache (#21657) fix: remove stray fmt.Println (#21661)
2 parents 4c367e4 + 0fc06f1 commit 972661e

Some content is hidden

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

52 files changed

+294
-282
lines changed
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: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ if [ -z "$ROCKSDB_VERSION" ]; then
66
exit 1
77
fi
88

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-
129
# Clone RocksDB repository
1310
git clone https://github.com/facebook/rocksdb.git /home/runner/rocksdb
1411
cd /home/runner/rocksdb || exit 1

.github/workflows/build.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,12 @@ jobs:
3838
/usr/local/lib/librocksdb.*
3939
/usr/local/include/rocksdb
4040
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
4144
- name: Install rocksdb
4245
if: matrix.go-arch == 'amd64' && steps.cache-rocksdb.outputs.cache-hit != 'true'
43-
id: install_rocksdb
4446
run: ./.github/scripts/install-rocksdb.sh
45-
- name: Saves rocksdb libraries cache
46-
if: matrix.go-arch == 'amd64' && steps.install_rocksdb.outcome == 'success'
47-
uses: actions/cache/save@v4
48-
with:
49-
path: |
50-
/usr/local/lib/librocksdb.*
51-
/usr/local/include/rocksdb
52-
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-${{ matrix.go-arch }}
5347
###################
5448
#### Build App ####
5549
###################
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: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,11 @@ jobs:
3939
/usr/local/lib/librocksdb.*
4040
/usr/local/include/rocksdb
4141
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
42+
- name: Install rocksdb deps
43+
run: ./.github/scripts/install-rocksdb-deps.sh
4244
- name: Install rocksdb
43-
if: env.GIT_DIFF && steps.cache-rocksdb.outputs.cache-hit != 'true'
44-
id: install_rocksdb
45+
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
4546
run: ./.github/scripts/install-rocksdb.sh
46-
- name: Saves rocksdb libraries cache
47-
if: steps.install_rocksdb.outcome == 'success'
48-
uses: actions/cache/save@v4
49-
with:
50-
path: |
51-
/usr/local/lib/librocksdb.*
52-
/usr/local/include/rocksdb
53-
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
5447
- name: run linting (long)
5548
if: env.GIT_DIFF
5649
id: lint_long

.github/workflows/test.yml

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -801,20 +801,10 @@ jobs:
801801
/usr/local/include/rocksdb
802802
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
803803
- name: Install rocksdb deps
804-
run: |
805-
sudo apt-get update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
804+
run: ./.github/scripts/install-rocksdb-deps.sh
806805
- name: Install rocksdb
807806
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
808-
id: install_rocksdb
809807
run: ./.github/scripts/install-rocksdb.sh
810-
- name: Saves rocksdb libraries cache
811-
if: steps.install_rocksdb.outcome == 'success'
812-
uses: actions/cache/save@v4
813-
with:
814-
path: |
815-
/usr/local/lib/librocksdb.*
816-
/usr/local/include/rocksdb
817-
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
818808
- name: tests
819809
if: env.GIT_DIFF
820810
run: |
@@ -861,20 +851,10 @@ jobs:
861851
/usr/local/include/rocksdb
862852
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
863853
- name: Install rocksdb deps
864-
run: |
865-
sudo apt-get update && sudo apt-get install -y libsnappy-dev zlib1g-dev libbz2-dev liblz4-dev libzstd-dev
854+
run: ./.github/scripts/install-rocksdb-deps.sh
866855
- name: Install rocksdb
867-
if: env.GIT_DIFF && steps.cache-rocksdb.outputs.cache-hit != 'true'
868-
id: install_rocksdb
856+
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
869857
run: ./.github/scripts/install-rocksdb.sh
870-
- name: Saves rocksdb libraries cache
871-
if: steps.install_rocksdb.outcome == 'success'
872-
uses: actions/cache/save@v4
873-
with:
874-
path: |
875-
/usr/local/lib/librocksdb.*
876-
/usr/local/include/rocksdb
877-
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
878858
- name: test & coverage report creation
879859
if: env.GIT_DIFF
880860
run: |

CHANGELOG.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,18 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
4343
### Features
4444

4545
* (baseapp) [#20291](https://github.com/cosmos/cosmos-sdk/pull/20291) Simulate nested messages.
46-
* (cli) [#21372](https://github.com/cosmos/cosmos-sdk/pull/21372) Add a `bulk-add-genesis-account` genesis command to add many genesis accounts at once.
4746

4847
### Improvements
4948

50-
* (client) [#21436](https://github.com/cosmos/cosmos-sdk/pull/21436) Use `address.Codec` from client.Context in `tx.Sign`.
51-
* (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.
53-
5449
### Bug Fixes
5550

5651
* (baseapp) [#21256](https://github.com/cosmos/cosmos-sdk/pull/21256) Halt height will not commit the block indicated, meaning that if halt-height is set to 10, only blocks until 9 (included) will be committed. This is to go back to the original behavior before a change was introduced in v0.50.0.
57-
* (baseapp) [#21413](https://github.com/cosmos/cosmos-sdk/pull/21413) Fix data race in sdk mempool.
5852

5953
### API Breaking Changes
60-
61-
* (baseapp) [#21413](https://github.com/cosmos/cosmos-sdk/pull/21413) Add `SelectBy` method to `Mempool` interface, which is thread-safe to use.
6254
* (sims)[#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules
6355

6456
### Deprecated
6557

66-
* (types) [#21435](https://github.com/cosmos/cosmos-sdk/pull/21435) The `String()` method on `AccAddress`, `ValAddress` and `ConsAddress` have been deprecated. This is done because those are still using the deprecated global `sdk.Config`. Use an `address.Codec` instead.
67-
6858
## [v0.52.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.52.0) - 2024-XX-XX
6959

7060
Every module contains its own CHANGELOG.md. Please refer to the module you are interested in.
@@ -135,6 +125,9 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
135125
* (baseapp) [#20380](https://github.com/cosmos/cosmos-sdk/pull/20380) Enhanced OfferSnapshot documentation.
136126
* (client) [#20771](https://github.com/cosmos/cosmos-sdk/pull/20771) Remove `ReadDefaultValuesFromDefaultClientConfig` from `client` package. (It was introduced in `v0.50.6` as a quick fix).
137127
* (grpcserver) [#20945](https://github.com/cosmos/cosmos-sdk/pull/20945) Adds error handling for out-of-gas panics in grpc query handlers.
128+
* (internal) [#21412](https://github.com/cosmos/cosmos-sdk/pull/21412) Using unsafe.String and unsafe.SliceData.
129+
* (client) [#21436](https://github.com/cosmos/cosmos-sdk/pull/21436) Use `address.Codec` from client.Context in `tx.Sign`.
130+
* (x/genutil) [#21249](https://github.com/cosmos/cosmos-sdk/pull/21249) Incremental JSON parsing for AppGenesis where possible.
138131

139132
### Bug Fixes
140133

@@ -155,7 +148,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
155148
* (client) [#17215](https://github.com/cosmos/cosmos-sdk/pull/17215) `server.StartCmd`,`server.ExportCmd`,`server.NewRollbackCmd`,`pruning.Cmd`,`genutilcli.InitCmd`,`genutilcli.GenTxCmd`,`genutilcli.CollectGenTxsCmd`,`genutilcli.AddGenesisAccountCmd`, do not take a home directory anymore. It is inferred from the root command.
156149
* (client) [#17259](https://github.com/cosmos/cosmos-sdk/pull/17259) Remove deprecated `clientCtx.PrintObjectLegacy`. Use `clientCtx.PrintProto` or `clientCtx.PrintRaw` instead.
157150
* (types) [#17348](https://github.com/cosmos/cosmos-sdk/pull/17348) Remove the `WrapServiceResult` function.
158-
* The `*sdk.Result` returned by the msg server router will not contain the `.Data` field.
151+
* The `*sdk.Result` returned by the msg server router will not contain the `.Data` field.
159152
* (types) [#17426](https://github.com/cosmos/cosmos-sdk/pull/17426) `NewContext` does not take a `cmtproto.Header{}` any longer.
160153
* `WithChainID` / `WithBlockHeight` / `WithBlockHeader` must be used to set values on the context
161154
* (client/keys) [#17503](https://github.com/cosmos/cosmos-sdk/pull/17503) `clientkeys.NewKeyOutput`, `MkConsKeyOutput`, `MkValKeyOutput`, `MkAccKeyOutput`, `MkAccKeysOutput` now take their corresponding address codec instead of using the global SDK config.
@@ -209,7 +202,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
209202
* (x/crisis) [#20043](https://github.com/cosmos/cosmos-sdk/pull/20043) Changed `NewMsgVerifyInvariant` to accept a string as argument instead of an `AccAddress`.
210203
* (x/simulation)[#20056](https://github.com/cosmos/cosmos-sdk/pull/20056) `SimulateFromSeed` now takes an address codec as argument.
211204
* (server) [#20140](https://github.com/cosmos/cosmos-sdk/pull/20140) Remove embedded grpc-web proxy in favor of standalone grpc-web proxy. [Envoy Proxy](https://www.envoyproxy.io/docs/envoy/latest/start/start)
212-
* (client) [#20255](https://github.com/cosmos/cosmos-sdk/pull/20255) Use comet proofOp proto type instead of sdk version to avoid needing to translate to later be proven in the merkle proof runtime.
205+
* (client) [#20255](https://github.com/cosmos/cosmos-sdk/pull/20255) Use comet proofOp proto type instead of sdk version to avoid needing to translate to later be proven in the merkle proof runtime.
213206
* (types)[#20369](https://github.com/cosmos/cosmos-sdk/pull/20369) The signature of `HasAminoCodec` has changed to accept a `core/legacy.Amino` interface instead of `codec.LegacyAmino`.
214207
* (server) [#20422](https://github.com/cosmos/cosmos-sdk/pull/20422) Deprecated `ServerContext`. To get `cmtcfg.Config` from cmd, use `client.GetCometConfigFromCmd(cmd)` instead of `server.GetServerContextFromCmd(cmd).Config`
215208
* (x/genutil) [#20740](https://github.com/cosmos/cosmos-sdk/pull/20740) Update `genutilcli.Commands` and `genutilcli.CommandsWithCustomMigrationMap` to take the genesis module and abstract the module manager.
@@ -218,10 +211,12 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
218211
* Remove parameter `txConfig` from `genutilcli.Commands`,`genutilcli.CommandsWithCustomMigrationMap`,`genutilcli.GenTxCmd`.
219212
* Remove parameter `addressCodec` from `genutilcli.GenTxCmd`,`genutilcli.AddGenesisAccountCmd`,`stakingcli.BuildCreateValidatorMsg`.
220213
* (sims) [#21039](https://github.com/cosmos/cosmos-sdk/pull/21039): Remove Baseapp from sims by a new interface `simtypes.AppEntrypoint`.
214+
* (x/genutil) [#21372](https://github.com/cosmos/cosmos-sdk/pull/21372) Remove `AddGenesisAccount` for `AddGenesisAccounts`.
215+
* (baseapp) [#21413](https://github.com/cosmos/cosmos-sdk/pull/21413) Add `SelectBy` method to `Mempool` interface, which is thread-safe to use.
221216

222217
### Client Breaking Changes
223218

224-
* (runtime) [#19040](https://github.com/cosmos/cosmos-sdk/pull/19040) Simplify app config implementation and deprecate `/cosmos/app/v1alpha1/config` query.
219+
* (runtime) [#19040](https://github.com/cosmos/cosmos-sdk/pull/19040) Simplify app config implementation and deprecate `/cosmos/app/v1alpha1/config` query.
225220

226221
### CLI Breaking Changes
227222

@@ -233,6 +228,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i
233228

234229
* (simapp) [#19146](https://github.com/cosmos/cosmos-sdk/pull/19146) Replace `--v` CLI option with `--validator-count`/`-n`.
235230
* (module) [#19370](https://github.com/cosmos/cosmos-sdk/pull/19370) Deprecate `module.Configurator`, use `appmodule.HasMigrations` and `appmodule.HasServices` instead from Core API.
231+
* (types) [#21435](https://github.com/cosmos/cosmos-sdk/pull/21435) The `String()` method on `AccAddress`, `ValAddress` and `ConsAddress` have been deprecated. This is done because those are still using the deprecated global `sdk.Config`. Use an `address.Codec` instead.
236232

237233
## [v0.50.9](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.9) - 2024-08-07
238234

client/debug/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ func RawBytesCmd() *cobra.Command {
307307
Use: "raw-bytes <raw-bytes>",
308308
Short: "Convert raw bytes output (eg. [10 21 13 255]) to hex",
309309
Long: "Convert raw-bytes to hex.",
310-
Example: fmt.Sprintf("%s debug raw-bytes [72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]", version.AppName),
310+
Example: fmt.Sprintf("%s debug raw-bytes '[72 101 108 108 111 44 32 112 108 97 121 103 114 111 117 110 100]'", version.AppName),
311311
Args: cobra.ExactArgs(1),
312312
RunE: func(_ *cobra.Command, args []string) error {
313313
stringBytes := args[0]

core/server/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package server
2+
3+
// DynamicConfig defines an interface for configuration that can be dynamically
4+
// fetched at runtime by an arbitrary key.
5+
type DynamicConfig interface {
6+
Get(string) any
7+
GetString(string) string
8+
}

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ require (
185185
replace (
186186
cosmossdk.io/api => ./api
187187
cosmossdk.io/collections => ./collections
188+
cosmossdk.io/core => ./core
188189
cosmossdk.io/core/testing => ./core/testing
189190
cosmossdk.io/store => ./store
190191
cosmossdk.io/x/bank => ./x/bank

0 commit comments

Comments
 (0)