Skip to content

Commit

Permalink
feat: bump up cosmos sdk v0.50.x and cometbft v0.38.0 (#2)
Browse files Browse the repository at this point in the history
* feat: update go.mod
cosmos-sdk v0.47.0
cometbft v0.37.0
cometbft-db v0.7.0
ibc-go/v7 v7.0.0
cosmos-proto v1.0.0-beta.2 (downgrade)
cosmossdk.io/simapp v0.0.0-20230323161446-0af178d721fffeat: bump up ibc-go/v7 v7.0.0

* build: go mod tidy

* build: fix build errors

* test: fix tests

* test: fix lint

* feat: cherry-pick crypto-org-chain/ethermint v47 integration pr

* feat: apply cosmos-sdk v0.47.x upgrade docs

* docs: update gomod2nix.toml

* Problem: localhost client param is not migrated (evmos#306)

* Problem: localhost client param is not migrated

for more info, https://github.com/cosmos/ibc-go/blob/v7.2.0/docs/migrations/v7-to-v7_1.md

* add test

* fix test

* WithConsensusParamsGetter to MigrationModuleManager

* Problem: recent version of SetPreBlocker is not used (evmos#326)

* feat: support blocking list of addresses in mempool and disable vesting messages in check tx mode (evmos#327)

* small fixes (evmos#310)

* disable vesting account messages in check tx

* Problem: don't support blocking addresses

Solution:
- support block addresses in mempool

* fix error

* put block address logic after validate basic

* fix build

* Apply suggestions from code review

Signed-off-by: yihuang <huang@crypto.com>

---------

Signed-off-by: yihuang <huang@crypto.com>

* rm IsCheckTx check

---------

Signed-off-by: yihuang <huang@crypto.com>
Co-authored-by: yihuang <huang@crypto.com>

* Revert blocking list feature from "feat: support blocking list of addresses in mempool and disable vesting messages in check tx mode (evmos#327)"

This reverts commit 1533fc1.

* Problem: performance regression because of un-cached sender recovery (evmos#350)

Solution:
- re-order ante handlers, use cached from address

* Revert antehandler ordering from "Problem: performance regression because of un-cached sender recovery (evmos#350)"

This reverts commit f0c4147.

* fix negative dynamic fee (evmos#351)

* fix negative dynamic fee

* Update app/ante/fee_checker.go

Signed-off-by: yihuang <huang@crypto.com>

* fix build

---------

Signed-off-by: yihuang <huang@crypto.com>

* test: fix lint

* feat: update go.mod

* build: fix build

* test: fix tests

* test: fix lint

* build: bump up golang ver to 1.21

* test: update nix go ver to 1.21

* Revert "test: update nix go ver to 1.21"

This reverts commit a9803b2.

* Revert "build: bump up golang ver to 1.21"

This reverts commit 71c8a78.

* test: fix test-import

* test: bump up golang ver to 1.21

* test: fix deploy-contract, lint checker

* test: debug go ver for deploy-contract, fix lint checker

* test: debug go ver for deploy-contract

* test: go version order change

* test: change go version from makefile-release, fix lint

* chore: remove todo comments

* feat: fix add prefix, replace test-contract to test-solidity

* feat: fix genesis doc type error

* test: fix test-rpc

* test: fix test-solidity

* test: fix test-solidity re-add export gopath, path

* test: fix test-solidity replace goroot too

* test: fix test-solidity add debug go env

* test: fix test-solidity remove debug test, add go version command

* test: fix test-solidity, split tools and test

* test: fix test-solidity, add go version debug

* test: fix test-solidity, add go env, remove sudo

* test: fix test-solidity, add -E option to sudo

* test: fix test-solidity, add env path

* test: fix test-solidity, remove debug lines, add path

* bug: fix tx, query commands

* feat: match app.go with original code(cosmos-sdk v0.50.1)

* test: fix lint

* test: fix lint

* test: fix lint

* test: fix lint

* test: fix lint

* chore: re-enable resetta

* test: update nix

* test: update nix

* test: update nix go ver to 1.21

* test: revert nix changes

* test: update nix go ver to 1.21

* test: update gomod2nix.toml, add poetry2nix

* test: fix poetry

* test: fix integration test(env, cosmovisor, ...)

* test: fix tests(finalize block, commit)

* test: fix consensus-params-block-max_gas path in json

* test: fix integration test(broken test - patch file, SyncInfo -> sync_info

* test: fix integration test - test_account

* test: fix test_account.py lint

* test: fix warning

* test: fix integration test - remove tx priority test

* test: fix integration test - comment test_priority.py

* test: fix integration test lint

* test: fix base fee test

* chore: uncomment or fix necessary parts

* chore: change migrate funcs

* chore: fix migration tests

* feat: remove handler.go

* test: fix lint

* chore: fix get proof and signmode

* chore: remove double-quote from go ver

* chore: rename log and import

* refactor: get signers from msg v2

* test: revert changed num

* chore: update upgrades.go

* chore: refactor testutil/network codes

* refactor: split cmd/root.go to cmd/commands.go and cmd/root.go

* test: fix lint

* chore: remove nil check of consensusparam.abci, fix eip1559 base fee test

* refactor: testutil/network codes

* refactor: server/start file

* chore: remove gitleaksignore

* test: fix lint

* test: fix integration test purned node error message

* chore: modify comments

* chore: fix python lint

* chore: add config, purning, snapshot commands

* test: fix python lint, gomod2nix

* chore: apply simple reviews

* feat: apply autocli.go

* feat: set ibc fee keeper in app.go

* fix: evm query store, code use custom query args

* chore: fix ethereum rpc PUblicFilterAPI.NewHeads

* chore: change EnhanceCusomCommand from false to true to restore Params query command

* test: revert test_account.py

* chore: remove x/nft, x/group, x/circuit

* feat: fix subscribeNewHeads to use baseFee of block event

* fix: testnet keyring option

* test: restore multi send test

* test: debug trace

* chore: apply zsystem comments

* feat: bump up cosmos-sdk v0.50.5

* feat: Move ValidateBasic logic from method func of msg to msg handler

* feat: remove ibcfee module

* feat: add new vesting account msg to disabled authz msgs

* feat: enable gov module to receive external tokens

* chore: bump cosmos-sdk v0.50.6

* chore: update gomod2nix.toml

* chore: update gomod2nix.toml for cosmos-sdk v0.50.6

* test: fix lint

* chore: Remove RegisterRESTRoutes from module.go

* feat: bump ibc-go up from v8.0.0 to v8.2.1

* fix: Upgrade handler bug fix

* docs: changelog

---------

Signed-off-by: yihuang <huang@crypto.com>
Co-authored-by: mmsqe <tqd0800210105@gmail.com>
Co-authored-by: yihuang <huang@crypto.com>
  • Loading branch information
3 people authored Jul 2, 2024
1 parent 83e81c7 commit 2d35118
Show file tree
Hide file tree
Showing 262 changed files with 51,950 additions and 6,484 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- name: "Checkout Repository"
uses: actions/checkout@v3
Expand Down
11 changes: 8 additions & 3 deletions .github/workflows/deploy-contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.21
check-latest: true
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '12.x'
- name: Install dependencies
run: npm install
run: |
npm install
- uses: technote-space/get-diff-action@v6.1.2
id: git_diff
with:
Expand All @@ -33,6 +38,6 @@ jobs:
go.sum
- name: Test contract
run: |
sudo make contract-tools
sudo make test-contract
sudo env "PATH=$PATH" make contract-tools
sudo env "PATH=$PATH" make test-solidity
if: env.GIT_DIFF
4 changes: 2 additions & 2 deletions .github/workflows/goreleaser.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@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- name: release dry run
run: make release-dry-run
Expand All @@ -25,4 +25,4 @@ jobs:
run: |-
echo 'GITHUB_TOKEN=${{secrets.GITHUB_TOKEN}}' > .release-env
- name: release publish
run: make release
run: make release
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
# Required: setup-go, for all versions v3.0.0+ of golangci-lint
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
Expand All @@ -47,7 +47,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
Expand All @@ -68,7 +68,7 @@ jobs:
steps:
- uses: actions/setup-go@v4
with:
go-version: 1.19
go-version: 1.21
check-latest: true
- uses: actions/checkout@v3
- uses: technote-space/get-diff-action@v6.1.2
Expand Down
15 changes: 7 additions & 8 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ run:
linters:
enable:
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
Expand Down Expand Up @@ -63,13 +62,13 @@ linters-settings:
require-explanation: false
require-specific: false
gofumpt:
lang-version: "1.19"
lang-version: "1.21"
gomodguard:
blocked:
versions: # List of blocked module version constraints
- https://github.com/etcd-io/etcd: # Blocked module with version constraint
version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
- https://github.com/etcd-io/etcd: # Blocked module with version constraint
version: ">= 3.4.10 || ~3.3.23" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-15114; CVE-2020-15136; CVE-2020-15115" # Reason why the version constraint exists. (Optional)
- https://github.com/dgrijalva/jwt-go: # Blocked module with version constraint
version: ">= 4.0.0-preview1" # Version constraint, see https://github.com/Masterminds/semver#basic-comparisons
reason: "CVE-2020-26160" # Reason why the version constraint exists. (Optional)
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (app) [#1739](https://github.com/evmos/ethermint/pull/1739) Remove distribution module perms
- (ante) [#1741](https://github.com/evmos/ethermint/pull/1741) Add authz ante handler
- (eip712) [#1746](https://github.com/evmos/ethermint/pull/1746) Add EIP712 support for multiple messages and schemas
- (deps) [canto#2](https://github.com/Canto-Network/ethermint/pull/2) Bump Comsos-SDK to v0.50.6, CometBFT to v0.38.6, ibc-go to v8.2.1

### Bug Fixes

Expand All @@ -51,6 +52,14 @@ Ref: https://keepachangelog.com/en/1.0.0/
### Improvements

- (ante) [#1717](https://github.com/evmos/ethermint/pull/1717) Reuse sender recovery result.
- (evm,feemarket) [canto#2](https://github.com/Canto-Network/ethermint/pull/2) Apply Cosmos-SDK improvements.
- Remove `Type()` and `Route()` methods from all msgs
- Remove `GetSigner()` methods from all msgs, move their logic to protobuf and define a custom GetSigner func if needed.
- `authority` has been added to the required module to execute proposal msgs.

### Client Breaking

- (evm,feemarket) [canto#2](https://github.com/Canto-Network/ethermint/pull/2) update params is moved to msg level to support msgs-based gov proposals.

## [v0.21.0] - 2023-01-26

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ build, in which case we can fall back on `go mod tidy -v`.

## Protobuf

We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use in Ethermint.
We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/cosmos/gogoproto) to generate code for use in Ethermint.

For determinstic behavior around Protobuf tooling, everything is containerized using Docker. Make sure to have Docker installed on your machine, or head to [Docker's website](https://docs.docker.com/get-docker/) to install it.

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:alpine AS build-env
FROM golang:1.21-alpine AS build-env

# Set up dependencies
ENV PACKAGES git build-base
Expand Down
65 changes: 20 additions & 45 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
PACKAGES_NOSIMULATION=$(shell go list ./... | grep -v '/simulation')
PACKAGES_SIMTEST=$(shell go list ./... | grep '/simulation')
VERSION ?= $(shell echo $(shell git describe --tags `git rev-list --tags="v*" --max-count=1`) | sed 's/^v//')
TMVERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
TMVERSION := $(shell go list -m github.com/cometbft/cometbft | sed 's:.* ::')
COMMIT := $(shell git log -1 --format='%H')
LEDGER_ENABLED ?= true
BINDIR ?= $(GOPATH)/bin
Expand Down Expand Up @@ -72,7 +72,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=ethermint \
-X github.com/cosmos/cosmos-sdk/version.Version=$(VERSION) \
-X github.com/cosmos/cosmos-sdk/version.Commit=$(COMMIT) \
-X "github.com/cosmos/cosmos-sdk/version.BuildTags=$(build_tags_comma_sep)" \
-X github.com/tendermint/tendermint/version.TMCoreSemVer=$(TMVERSION)
-X github.com/cometbft/cometbft/version.TMCoreSemVer=$(TMVERSION)

ifeq ($(ENABLE_ROCKSDB),true)
BUILD_TAGS += rocksdb_build
Expand Down Expand Up @@ -176,7 +176,7 @@ build-all: tools build lint test vulncheck
###############################################################################

PACKAGE_NAME:=github.com/evmos/ethermint
GOLANG_CROSS_VERSION = v1.19
GOLANG_CROSS_VERSION = v1.21
GOPATH ?= '$(HOME)/go'
release-dry-run:
docker run \
Expand Down Expand Up @@ -241,7 +241,7 @@ endif

ifeq (, $(shell which go-bindata))
@echo "Installing go-bindata..."
@go get github.com/kevinburke/go-bindata/go-bindata
@go get github.com/kevinburke/go-bindata
else
@echo "go-bindata already installed; skipping..."
endif
Expand All @@ -255,7 +255,7 @@ endif

ifeq (, $(shell which protoc-gen-go))
@echo "Installing protoc-gen-go..."
@go get github.com/fjl/gencodec github.com/golang/protobuf/protoc-gen-go
@go get github.com/fjl/gencodec google.golang.org/protobuf/cmd/protoc-gen-go
else
@echo "protoc-gen-go already installed; skipping..."
endif
Expand Down Expand Up @@ -357,7 +357,7 @@ test-solidity:
./scripts/run-solidity-tests.sh


.PHONY: run-tests test test-all test-import test-rpc test-contract test-solidity $(TEST_TARGETS)
.PHONY: run-tests test test-all test-import test-rpc test-solidity $(TEST_TARGETS)


benchmark:
Expand Down Expand Up @@ -392,30 +392,9 @@ format-fix:
### Protobuf ###
###############################################################################

# ------
# NOTE: Link to the tendermintdev/sdk-proto-gen docker images:
# https://hub.docker.com/r/tendermintdev/sdk-proto-gen/tags
#
protoVer=v0.7
protoImageName=tendermintdev/sdk-proto-gen:$(protoVer)
protoImage=$(DOCKER) run --network host --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)
# ------
# NOTE: cosmos/proto-builder image is needed because clang-format is not installed
# on the tendermintdev/sdk-proto-gen docker image.
# Link to the cosmos/proto-builder docker images:
# https://github.com/cosmos/cosmos-sdk/pkgs/container/proto-builder
#
protoCosmosVer=0.11.2
protoCosmosName=ghcr.io/cosmos/proto-builder:$(protoCosmosVer)
protoCosmosImage=$(DOCKER) run --network host --rm -v $(CURDIR):/workspace --workdir /workspace $(protoCosmosName)
# ------
# NOTE: Link to the yoheimuta/protolint docker images:
# https://hub.docker.com/r/yoheimuta/protolint/tags
#
protolintVer=0.42.2
protolintName=yoheimuta/protolint:$(protolintVer)
protolintImage=$(DOCKER) run --network host --rm -v $(CURDIR):/workspace --workdir /workspace $(protolintName)

protoVer=0.14.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

# ------
# NOTE: If you are experiencing problems running these commands, try deleting
Expand All @@ -426,28 +405,24 @@ proto-all: proto-format proto-lint proto-gen
proto-gen:
@echo "Generating Protobuf files"
$(protoImage) sh ./scripts/protocgen.sh


# TODO: Rethink API docs generation
# proto-swagger-gen:
# @echo "Generating Protobuf Swagger"
# $(protoImage) sh ./scripts/protoc-swagger-gen.sh

proto-format:
@echo "Formatting Protobuf files"
$(protoCosmosImage) find ./ -name *.proto -exec clang-format -i {} \;

# NOTE: The linter configuration lives in .protolint.yaml
proto-lint:
@echo "Linting Protobuf files"
$(protolintImage) lint ./proto
@$(protoImage) buf lint --error-format=json

proto-check-breaking:
@echo "Checking Protobuf files for breaking changes"
$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main

# TODO: Rethink API docs generation
proto-swagger-gen:
@echo "Generating Protobuf Swagger"
$(protoImage) sh ./scripts/protoc-swagger-gen.sh

proto-format:
@echo "Formatting Protobuf files"
@$(protoImage) find ./ -name "*.proto" -exec clang-format -i {} \;

.PHONY: proto-all proto-gen proto-gen-any proto-format proto-lint proto-check-breaking
.PHONY: proto-all proto-gen proto-format proto-lint proto-check-breaking

###############################################################################
### Localnet ###
Expand Down
Loading

0 comments on commit 2d35118

Please sign in to comment.