-
Notifications
You must be signed in to change notification settings - Fork 383
fix(app): RootMultiStore interface and version mismatch(backport:#1179) #1180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8b2c8a1
fix(app): RootMultiStore interface and version mismatch(backport:#1179)
songgaoye 7692d73
use golangci-lint fix
songgaoye 68609c5
fmt
songgaoye 7c17f80
revert, use old version
songgaoye 95204d3
revert https://github.com/crypto-org-chain/chain-main/pull/1174
songgaoye d74a1c9
add DumpVersionDBChangeSet
songgaoye 30260dc
update golangci-lint
songgaoye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Tests | ||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
| - release/** | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| test-versiondb: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/setup-go@v3 | ||
| with: | ||
| go-version: 1.22 | ||
| check-latest: true | ||
| - uses: actions/checkout@v4 | ||
| - name: Install RocksDB Dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get -y install -y build-essential libsnappy-dev zlib1g-dev libbz2-dev libgflags-dev liblz4-dev libzstd-dev cmake | ||
| - name: Build and Install RocksDB | ||
| run: | | ||
| git clone https://github.com/facebook/rocksdb.git | ||
| cd rocksdb | ||
| git checkout v9.2.1 | ||
| mkdir build && cd build | ||
| cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_SNAPPY=ON -DWITH_LZ4=ON -DWITH_ZLIB=ON -DWITH_ZSTD=ON | ||
| sudo make -j4 | ||
| sudo make install | ||
| - uses: technote-space/get-diff-action@v6.1.2 | ||
| with: | ||
| PATTERNS: | | ||
| **/**.sol | ||
| **/**.go | ||
| go.mod | ||
| go.sum | ||
| - name: Test and Create Coverage Report | ||
| run: | | ||
| export COSMOS_BUILD_OPTIONS=rocksdb | ||
| make test-versiondb | ||
| if: env.GIT_DIFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| //go:build rocksdb | ||
| // +build rocksdb | ||
|
|
||
| package app_test | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| dbm "github.com/cosmos/cosmos-db" | ||
| "github.com/crypto-org-chain/chain-main/v4/app" | ||
|
|
||
| "cosmossdk.io/log" | ||
|
|
||
| "github.com/cosmos/cosmos-sdk/client/flags" | ||
| "github.com/cosmos/cosmos-sdk/server" | ||
| simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" | ||
| simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" | ||
| ) | ||
|
|
||
| func TestVersionDB(t *testing.T) { | ||
| db := dbm.NewMemDB() | ||
|
|
||
| appOptions := make(simtestutil.AppOptionsMap, 0) | ||
| appOptions[flags.FlagHome] = app.DefaultNodeHome | ||
| appOptions[server.FlagInvCheckPeriod] = simcli.FlagPeriodValue | ||
| appOptions["versiondb.enable"] = true | ||
| logger := log.NewNopLogger() | ||
| _ = app.New(logger, db, nil, false, appOptions, nil...) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High severity vulnerability introduced by a package you're using:
Line 24 lists a dependency (github.com/cosmos/cosmos-sdk) with a known High severity vulnerability. Fixing requires upgrading or replacing the dependency.
ℹ️ Why this matters
Affected versions of github.com/cosmos/cosmos-sdk are vulnerable to Integer Overflow or Wraparound. A malicious validator can exploit improperly handled arithmetic in the distribution module by making a crafted deposit to the validator rewards pool. This integer overflow can trigger a chain halt, resulting in a denial-of-service.
References: GHSA
To resolve this comment:
Upgrade this dependency to at least version 0.50.14 at go.mod.
💬 Ignore this finding
To ignore this, reply with:
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasonsYou can view more details on this finding in the Semgrep AppSec Platform here.