Skip to content

Commit

Permalink
Merge branch 'main' into feat/backward-compatibility-store-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
randygrok authored Jan 7, 2025
2 parents 4c15358 + c1192da commit cb8a4fb
Show file tree
Hide file tree
Showing 193 changed files with 2,728 additions and 1,601 deletions.
12 changes: 0 additions & 12 deletions .github/scripts/get-rocksdb-version.sh

This file was deleted.

4 changes: 0 additions & 4 deletions .github/scripts/install-rocksdb-deps.sh

This file was deleted.

17 changes: 0 additions & 17 deletions .github/scripts/install-rocksdb.sh

This file was deleted.

29 changes: 5 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,14 @@ jobs:
with:
go-version: "1.23"
check-latest: true
- name: Get rocksdb version
run: ./.github/scripts/get-rocksdb-version.sh
- name: Fix permissions for cache
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
- name: Restore rocksdb libraries cache
id: cache-rocksdb
if: matrix.go-arch == 'amd64'
uses: actions/cache/restore@v4
with:
path: |
/usr/local/lib/librocksdb.*
/usr/local/include/rocksdb
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-${{ matrix.go-arch }}
- name: Install rocksdb deps
if: matrix.go-arch == 'amd64'
run: ./.github/scripts/install-rocksdb-deps.sh
- name: Install rocksdb
if: matrix.go-arch == 'amd64' && steps.cache-rocksdb.outputs.cache-hit != 'true'
run: ./.github/scripts/install-rocksdb.sh
- name: install aarch64-gcc
if: matrix.go-arch == 'arm64'
run: sudo apt-get install gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
###################
#### Build App ####
###################
- 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=v2,rocksdb make build
- name: Build with sqlite backend
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,sqlite make build
- name: Build with BLS12381
if: matrix.go-arch == 'amd64'
run: GOARCH=${{ matrix.go-arch }} COSMOS_BUILD_OPTIONS=v2,bls12381 make build
Expand Down
62 changes: 0 additions & 62 deletions .github/workflows/cache-rocksdb.yml

This file was deleted.

33 changes: 0 additions & 33 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,54 +27,21 @@ jobs:
Makefile
**/Makefile
.golangci.yml
- name: Get rocksdb version
run: ./.github/scripts/get-rocksdb-version.sh
- name: Fix permissions for cache
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
- name: Restore rocksdb libraries cache
id: cache-rocksdb
uses: actions/cache/restore@v4
with:
path: |
/usr/local/lib/librocksdb.*
/usr/local/include/rocksdb
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
- name: Install rocksdb deps
run: ./.github/scripts/install-rocksdb-deps.sh
- name: Install rocksdb
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
run: ./.github/scripts/install-rocksdb.sh
- name: run linting (long)
if: env.GIT_DIFF
id: lint_long
run: |
make lint
env:
ROCKSDB: 1
- uses: technote-space/[email protected]
if: steps.lint_long.outcome == 'skipped'
with:
PATTERNS: |
**/*.go
*.go
!store/**
- name: run linting (short)
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF
run: |
make lint
env:
GIT_DIFF: ${{ env.GIT_DIFF }}
LINT_DIFF: 1
- uses: technote-space/[email protected]
if: steps.lint_long.outcome == 'skipped'
with:
PATTERNS: |
store/**
- name: run linting (short)
if: steps.lint_long.outcome == 'skipped' && env.GIT_DIFF
run: |
make lint
env:
GIT_DIFF: ${{ env.GIT_DIFF }}
LINT_DIFF: 1
ROCKSDB: 1
38 changes: 2 additions & 36 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -701,28 +701,11 @@ jobs:
store/**/*.go
store/go.mod
store/go.sum
- name: Get rocksdb version
run: ./.github/scripts/get-rocksdb-version.sh
- name: Fix permissions for cache
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
- name: Restore rocksdb libraries cache
id: cache-rocksdb
uses: actions/cache/restore@v4
with:
path: |
/usr/local/lib/librocksdb.*
/usr/local/include/rocksdb
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
- name: Install rocksdb deps
run: ./.github/scripts/install-rocksdb-deps.sh
- name: Install rocksdb
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
run: ./.github/scripts/install-rocksdb.sh
- name: tests
if: env.GIT_DIFF
run: |
cd store
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
Expand Down Expand Up @@ -751,28 +734,11 @@ jobs:
store/v2/**/*.go
store/v2/go.mod
store/v2/go.sum
- name: Get rocksdb version
run: ./.github/scripts/get-rocksdb-version.sh
- name: Fix permissions for cache
run: sudo chown $(whoami) /usr/local/lib /usr/local/include
- name: Restore rocksdb libraries cache
id: cache-rocksdb
uses: actions/cache/restore@v4
with:
path: |
/usr/local/lib/librocksdb.*
/usr/local/include/rocksdb
key: ${{ runner.os }}-rocksdb-${{ env.ROCKSDB_VERSION }}-amd64
- name: Install rocksdb deps
run: ./.github/scripts/install-rocksdb-deps.sh
- name: Install rocksdb
if: steps.cache-rocksdb.outputs.cache-hit != 'true'
run: ./.github/scripts/install-rocksdb.sh
- name: test & coverage report creation
if: env.GIT_DIFF
run: |
cd store/v2
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb' ./...
go test -ldflags "-r /usr/local/lib" -mod=readonly -timeout 30m -coverprofile=coverage.out -covermode=atomic -tags='norace ledger test_ledger_mock' ./...
- name: sonarcloud
if: ${{ env.GIT_DIFF && !github.event.pull_request.draft && env.SONAR_TOKEN != null }}
uses: SonarSource/sonarcloud-github-action@master
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i

### Improvements

* (codec) [#22988](https://github.com/cosmos/cosmos-sdk/pull/22988) Improve edge case handling for recursion limits.

### Bug Fixes

* (query) [23002](https://github.com/cosmos/cosmos-sdk/pull/23002) Fix collection filtered pagination.
* (x/auth/tx) [23144](https://github.com/cosmos/cosmos-sdk/pull/23144) Add missing CacheWithValue for ExtensionOptions.
* (x/auth/tx) [#23148](https://github.com/cosmos/cosmos-sdk/pull/23148) Avoid panic from intoAnyV2 when v1.PublicKey is optional.

### API Breaking Changes

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ WORKDIR /root
RUN apk add --no-cache curl make bash jq sed

# Copy over binaries from the build-env
COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/build/simd /usr/bin/simd
COPY --from=build-env /go/src/github.com/cosmos/cosmos-sdk/build/simdv2 /usr/bin/simd
6 changes: 3 additions & 3 deletions api/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ module cosmossdk.io/api
go 1.23

require (
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1
github.com/cosmos/cosmos-proto v1.0.0-beta.5
github.com/cosmos/gogoproto v1.7.0
google.golang.org/genproto/googleapis/api v0.0.0-20240903143218-8af14fe29dc1
google.golang.org/grpc v1.68.1
google.golang.org/protobuf v1.36.0
google.golang.org/protobuf v1.36.1
)

require (
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 // indirect
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1 // indirect
github.com/google/go-cmp v0.6.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sys v0.28.0 // indirect
Expand Down
12 changes: 6 additions & 6 deletions api/go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1 h1:LBP+N3ehp1hseHYlIIHlU0gMM3aGYDcgx/H//Pk12ko=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.0-20241120201313-68e42a58b301.1/go.mod h1:pab5p7+q6IAI+R+Z2MQ+hP7ZV+FP2mcbucv6xs5WFPk=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1 h1:5wJBiYyPUS2xpqLJKm7ZEKx1VhesPOXXx5y+JxgVSX4=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.0-20240130113600-88ef6483f90f.1/go.mod h1:VItWFs9dzQsqOin45pYbA4O/SRdqMPDs4XPZBHL+u2w=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1 h1:ETkPUd9encx5SP6yuo0BR7DOnQHDbmU0RMzHsu2dkuQ=
buf.build/gen/go/cometbft/cometbft/protocolbuffers/go v1.36.1-20241120201313-68e42a58b301.1/go.mod h1:HulBNxlqJNXVcysFv/RxTEWz+khiJg8SOmfgC1ktVTM=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1 h1:X62BxjEhtx1/PWJPxg5BGahf1UXeFgM9dFfNpQ6kUPo=
buf.build/gen/go/cosmos/gogo-proto/protocolbuffers/go v1.36.1-20240130113600-88ef6483f90f.1/go.mod h1:GB5hdNJd6cahKmHcLArJo5wnV9TeZGMSz7ysK4YLvag=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec=
github.com/cosmos/gogoproto v1.7.0 h1:79USr0oyXAbxg3rspGh/m4SWNyoz/GLaAh0QlCe2fro=
Expand All @@ -22,5 +22,5 @@ google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
google.golang.org/protobuf v1.36.0 h1:mjIs9gYtt56AzC4ZaffQuh88TZurBGhIJMBZGSxNerQ=
google.golang.org/protobuf v1.36.0/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
17 changes: 7 additions & 10 deletions baseapp/streaming.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"encoding/json"
"fmt"
"slices"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -37,10 +38,11 @@ const (
// types of streaming listeners.
func (app *BaseApp) EnableIndexer(indexerOpts interface{}, keys map[string]*storetypes.KVStoreKey, appModules map[string]any) error {
listener, err := indexer.StartIndexing(indexer.IndexingOptions{
Config: indexerOpts,
Resolver: decoding.ModuleSetDecoderResolver(appModules),
SyncSource: nil,
Logger: app.logger.With(log.ModuleKey, "indexer"),
Config: indexerOpts,
Resolver: decoding.ModuleSetDecoderResolver(appModules),
Logger: app.logger.With(log.ModuleKey, "indexer"),
SyncSource: nil, // TODO: Support catch-up syncs
AddressCodec: app.interfaceRegistry.SigningContext().AddressCodec(),
})
if err != nil {
return err
Expand Down Expand Up @@ -115,12 +117,7 @@ func (app *BaseApp) registerABCIListenerPlugin(
}

func exposeAll(list []string) bool {
for _, ele := range list {
if ele == "*" {
return true
}
}
return false
return slices.Contains(list, "*")
}

func exposeStoreKeysSorted(keysStr []string, keys map[string]*storetypes.KVStoreKey) []storetypes.StoreKey {
Expand Down
2 changes: 1 addition & 1 deletion client/keys/mnemonic.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const (
mnemonicEntropySize = 256
)

// MnemonicKeyCommand computes the bip39 memonic for input entropy.
// MnemonicKeyCommand computes the bip39 mnemonic for input entropy.
func MnemonicKeyCommand() *cobra.Command {
cmd := &cobra.Command{
Use: "mnemonic",
Expand Down
Loading

0 comments on commit cb8a4fb

Please sign in to comment.