Skip to content

Commit

Permalink
Problem: Cosmos SDK not upgraded to include patch for dragonberry (#884)
Browse files Browse the repository at this point in the history
Solution: Upgrade cosmos-sdk to 0.46.3 + update submodules
plus fixes in protobuf generation and integration tests

Co-authored-by: Devashish Dixit <[email protected]>
Co-authored-by: HuangYi <[email protected]>
  • Loading branch information
3 people committed Oct 31, 2022
1 parent d5a1d97 commit d5351eb
Show file tree
Hide file tree
Showing 36 changed files with 312 additions and 256 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/audit.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@v3
with:
go-version: 1.19.1
go-version: 1.19.2
- 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 @@ -70,7 +70,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18.3
go-version: 1.19.2
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
steps:
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
go-version: 1.19.2
- name: install runsim
run: |
export GO111MODULE="on" && go install github.com/cosmos/tools/cmd/[email protected]
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
go-version: 1.19.2
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -228,7 +228,7 @@ jobs:
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
go-version: 1.19.2
- name: Checkout Comment PR Branch
uses: actions/checkout@v2
if: github.event_name == 'issue_comment'
Expand Down Expand Up @@ -290,7 +290,7 @@ jobs:
echo "::set-output name=repo_name::${{ fromJson(steps.request.outputs.data).head.repo.full_name }}"
- uses: actions/setup-go@v2
with:
go-version: 1.18.3
go-version: 1.19.2
- 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 @@ -14,7 +14,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18.3
go-version: 1.19.2
- 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.18.3
go-version: 1.19.2
- 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 @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: 1.18.3
go-version: 1.19.2
# 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.18.5
go-version: 1.19.2
- 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 @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.18.3
go-version: 1.19.2
- uses: actions/checkout@v3
with:
submodules: true
Expand All @@ -26,7 +26,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.46
version: v1.50
args: --timeout 10m
github-token: ${{ secrets.github_token }}
if: "env.GIT_DIFF != ''"
40 changes: 17 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,32 @@
# Changelog

## Unreleased
*October 31, 2022*

### Added
## v4.0.0

- Support for smart contracts using `CosmWasm`. #780 #805
This is the release of Crypto.org Chain's `v4.0.0`. It contains following changes (when compared with `v3`):

### Changed
## Added

- Upgrade `cosmos-sdk` to `v0.45.6` and `ibc-go` to `v4.0.0-rc0`. #803
- Changed go version to `1.18`. #803
- Change the default priority mechanism to be based on gas price
- Upgrade `cosmos-sdk` to `v0.46.1` and `ibc-go` to `v0.5.0-rc0` and remove the custom priority mechanism.

### Security

- Upgraded CodeQL scanning pipeline. #773
- Support for interchain accounts. #730 #732 #733
- IBC Fee middleware for incentivizing relayers. #763 #834
- Add support for NFT transfer via IBC. #860
- Set default `min_commission_rate` to `5%`. #845

## v4.0.0-alpha3-croeseid
## Changed

### Added

- IBC Fee middleware for incentivizing relayers (only for IBC transfers). #763.
- Upgrade `cosmos-sdk` to `v0.46.3+` and `ibc-go` to `v5.0.1`. #850 #869 #884
- Changed go version to `1.19`. #884
- Change the default priority mechanism to be based on gas price
- Add `url` in `x/nft`'s `Denom`. #860

### Testing
## Deprecated

- Integration tests for solo machine. #757.
- Integration tests for offline signing. #761.
- Marked `x/supply` module, including its CLI and gRPC, as deprecated. #724

## v4.0.0-alpha1
## Security

- Upgrade `cosmos-sdk` to `v0.45.3` and `ibc-go` to `v3.0.0`. #717 #725 #728 #745 #750
- Mark gRPC and CLI of `x/supply` as deprecated. #724
- Enable interchain accounts. #730 #732 #733
- Security fixes for Swagger UI. #704

*March 1, 2022*

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.18
GOLANG_CROSS_VERSION = v1.19.2


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

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
"github.com/cosmos/cosmos-sdk/client/grpc/tmservice"
"github.com/cosmos/cosmos-sdk/codec"
"github.com/cosmos/cosmos-sdk/codec/types"
Expand Down Expand Up @@ -917,6 +918,9 @@ func (app *ChainApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIC
// Register new tendermint queries routes from grpc-gateway.
tmservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register node gRPC service for grpc-gateway.
nodeservice.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

// Register grpc-gateway routes for all modules.
ModuleBasics.RegisterGRPCGatewayRoutes(clientCtx, apiSvr.GRPCGatewayRouter)

Expand All @@ -936,6 +940,10 @@ func (app *ChainApp) RegisterTendermintService(clientCtx client.Context) {
tmservice.RegisterTendermintService(clientCtx, app.BaseApp.GRPCQueryRouter(), app.interfaceRegistry, app.Query)
}

func (app *ChainApp) RegisterNodeService(clientCtx client.Context) {
nodeservice.RegisterNodeService(clientCtx, app.GRPCQueryRouter())
}

// RegisterSwaggerAPI registers swagger route with API Server
func RegisterSwaggerAPI(ctx client.Context, rtr *mux.Router) {
statikFS, err := fs.NewWithNamespace("chainmain")
Expand Down
3 changes: 2 additions & 1 deletion app/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ func (app *ChainApp) ExportAppStateAndValidators(

// prepare for fresh start at zero height
// NOTE zero height genesis is a temporary feature which will be deprecated
// in favour of export at a block height
//
// in favour of export at a block height
func (app *ChainApp) prepForZeroHeightGenesis(ctx sdk.Context, jailAllowedAddrs []string) {
applyAllowedAddrs := false

Expand Down
6 changes: 3 additions & 3 deletions app/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math/rand"
"os"
"time"

sdkmath "cosmossdk.io/math"
Expand Down Expand Up @@ -60,7 +60,7 @@ func AppStateFn(cdc codec.JSONCodec, simManager *module.SimulationManager) simty

case config.ParamsFile != "":
appParams := make(simtypes.AppParams)
bz, err := ioutil.ReadFile(config.ParamsFile)
bz, err := os.ReadFile(config.ParamsFile)
if err != nil {
panic(err)
}
Expand Down Expand Up @@ -204,7 +204,7 @@ func AppStateRandomizedFn(
// from a genesis.json file.
// nolint:revive
func AppStateFromGenesisFileFn(r io.Reader, cdc codec.JSONCodec, genesisFile string) (tmtypes.GenesisDoc, []simtypes.Account) {
bytes, err := ioutil.ReadFile(genesisFile)
bytes, err := os.ReadFile(genesisFile)
if err != nil {
panic(err)
}
Expand Down
4 changes: 2 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, stdenv
, buildGoApplication
, nix-gitignore
, go_1_18
, go_1_19
, writeShellScript
, gomod2nix
, rocksdb ? null
Expand Down Expand Up @@ -36,7 +36,7 @@ in
buildGoApplication rec {
pname = "chain-maind";
version = "4.0.0";
go = go_1_18;
go = go_1_19;
src = lib.cleanSourceWith {
name = "src";
src = lib.sourceByRegex ./. src_regexes;
Expand Down
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,8 @@
devShells = {
chain-maind = pkgs.mkShell {
buildInputs = with pkgs; [
go_1_18
go_1_19
rocksdb
libwasmvm
];
};
};
Expand Down
Loading

0 comments on commit d5351eb

Please sign in to comment.