Skip to content

Commit

Permalink
Problem: Cosmos SDK is not upgraded to the latest version (0.46.10) (#…
Browse files Browse the repository at this point in the history
…925)

* Problem: Cosmos SDK is not upgraded to the latest version (0.46.10)

Solution: upgraded the dependency, plus Go to 1.20.1

* bump net and lint

* use cosmos sdk errors package

* use the cosmos sdk errors package

* wrap newsdk errors

* lint fixes

* more lint fixes
  • Loading branch information
tomtau authored Feb 17, 2023
1 parent dfe485e commit 2633606
Show file tree
Hide file tree
Showing 43 changed files with 147 additions and 196 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.4
go-version: 1.20.1
- uses: actions/checkout@v2
with:
submodules: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -135,7 +135,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- name: install runsim
run: |
export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
Expand All @@ -160,7 +160,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -209,7 +209,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/buildwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- name: Normal check out code
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19.4
go-version: 1.20.1
- uses: actions/checkout@v2
with:
submodules: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.19.4
go-version: 1.20.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.19.4
go-version: 1.20.1
- name: release dry run
run: make release-dry-run
- name: setup release environment
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.19.4
go-version: 1.20.1
- uses: actions/checkout@v3
with:
submodules: true
Expand All @@ -27,7 +27,7 @@ jobs:
- uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.50
version: v1.51
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: "env.GIT_DIFF != ''"
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

*February 20, 2023*

## v4.2.3
Cosmos SDK was upgraded to v0.46.10 and binaries are built with go 1.20.1.

### Improvements
- [925](https://github.com/crypto-org-chain/chain-main/issues/925) Cosmos SDK was upgraded to v0.46.10

*January 3, 2023*

## v4.2.2
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PACKAGES=$(shell go list ./... | grep -v '/simulation')
PACKAGE_NAME:=github.com/crypto-org-chain/chain-main
GOLANG_CROSS_VERSION = v1.19.4
GOLANG_CROSS_VERSION = v1.20.1


VERSION := $(shell echo $(shell git describe --tags 2>/dev/null ) | sed 's/^v//')
Expand Down
7 changes: 4 additions & 3 deletions app/ante.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package app

import (
newsdkerrors "cosmossdk.io/errors"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
Expand All @@ -18,13 +19,13 @@ type HandlerOptions struct {

func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
if options.AccountKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
return nil, newsdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler")
}
if options.BankKeeper == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
return nil, newsdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler")
}
if options.SignModeHandler == nil {
return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
return nil, newsdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder")
}

sigGasConsumer := options.SigGasConsumer
Expand Down
3 changes: 2 additions & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

newsdkerrors "cosmossdk.io/errors"
bam "github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -436,7 +437,7 @@ func NewPubKeyFromHex(pk string) (res cryptotypes.PubKey) {
panic(err)
}
if len(pkBytes) != ed25519.PubKeySize {
panic(errors.Wrap(errors.ErrInvalidPubKey, "invalid pubkey size"))
panic(newsdkerrors.Wrap(errors.ErrInvalidPubKey, "invalid pubkey size"))
}
return &ed25519.PubKey{Key: pkBytes}
}
Expand Down
15 changes: 8 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module github.com/crypto-org-chain/chain-main/v4

go 1.19
go 1.20

require (
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.0-beta.3
github.com/armon/go-metrics v0.4.1
github.com/cosmos/cosmos-proto v1.0.0-alpha8
github.com/cosmos/cosmos-sdk v0.46.9
github.com/cosmos/cosmos-sdk v0.46.10
github.com/cosmos/ibc-go/v5 v5.2.0
github.com/gogo/protobuf v1.3.3
github.com/golang/protobuf v1.5.2
Expand All @@ -33,7 +34,6 @@ require (
cloud.google.com/go/compute v1.10.0 // indirect
cloud.google.com/go/iam v0.5.0 // indirect
cloud.google.com/go/storage v1.27.0 // indirect
cosmossdk.io/errors v1.0.0-beta.7 // indirect
filippo.io/edwards25519 v1.0.0-rc.1 // indirect
github.com/99designs/keyring v1.2.1 // indirect
github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect
Expand Down Expand Up @@ -147,9 +147,9 @@ require (
golang.org/x/exp v0.0.0-20220722155223-a9213eeb770e // indirect
golang.org/x/net v0.5.0 // indirect
golang.org/x/oauth2 v0.1.0 // indirect
golang.org/x/sys v0.4.0 // indirect
golang.org/x/term v0.4.0 // indirect
golang.org/x/text v0.6.0 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.100.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
Expand All @@ -161,7 +161,7 @@ require (

replace (
github.com/99designs/keyring => github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76

github.com/cosmos/cosmos-sdk => github.com/cosmos/cosmos-sdk v0.46.10
github.com/cosmos/ledger-cosmos-go => github.com/cosmos/ledger-cosmos-go v0.11.2-0.20220719170349-e736b9afa7d1
// Fix upstream GHSA-h395-qcrw-5vmq vulnerability.
// TODO Remove it: https://github.com/cosmos/cosmos-sdk/issues/10409
Expand All @@ -172,4 +172,5 @@ replace (

// TODO: remove after fixed https://github.com/cosmos/cosmos-sdk/issues/11364
github.com/zondax/hid => github.com/zondax/hid v0.9.0
golang.org/x/net => golang.org/x/net v0.7.0
)
Loading

0 comments on commit 2633606

Please sign in to comment.