Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

feat: Cosmos SDK v47 integration #1782

Closed
wants to merge 58 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
a1d60e4
integrate with sdk V47 & ibc-go V7
JayT106 Feb 24, 2023
95f3be6
update proto-gen and proto files
JayT106 Feb 24, 2023
f783e5f
fix e2e tests
JayT106 Feb 24, 2023
b99bf1e
tmp
JayT106 Feb 24, 2023
27aa7cb
working tmp
JayT106 Feb 24, 2023
3d99e64
fix rebase conflict
JayT106 Feb 25, 2023
5b6a3db
fix merge conflict
JayT106 Feb 25, 2023
e3f2974
fix test
JayT106 Feb 25, 2023
70e6557
recover makefile changes
JayT106 Feb 27, 2023
e5d1a63
fix lint
JayT106 Feb 27, 2023
285353d
fix protoc-gen-tool script
JayT106 Feb 27, 2023
1cc8df7
update tendermint dependency
JayT106 Feb 28, 2023
1290d89
update btcsuite/btcutil path
JayT106 Mar 1, 2023
b2d5b8b
update gomod2nix
JayT106 Mar 1, 2023
7947fa4
fix Makefile,regen proto files and remove third_party proto
JayT106 Mar 3, 2023
bce7c75
update gomod2nix
JayT106 Mar 3, 2023
1a5af18
fix lint
JayT106 Mar 3, 2023
a35f950
update nix
mmsqe Jun 5, 2023
543ed5e
Merge branch 'sdk-v47-ibc-v7'
mmsqe Jun 5, 2023
39fa7eb
replace cometbft tm-db
mmsqe Jun 5, 2023
270cf86
algo -> key-type
mmsqe Jun 5, 2023
ba22e6d
set mempool
mmsqe Jun 5, 2023
d579f73
set chainId
mmsqe Jun 5, 2023
2a5fefb
update protobuf
mmsqe Jun 5, 2023
fddafc0
fix import
mmsqe Jun 5, 2023
5d170e4
fix test
mmsqe Jun 5, 2023
419d1c0
debug test
mmsqe Jun 5, 2023
94c6694
update nix
mmsqe Jun 5, 2023
a223267
fix btcsuite
mmsqe Jun 5, 2023
a9dbbfe
make proto-gen follow by UPGRADING.md
mmsqe Jun 6, 2023
4dd3e1d
fix sync issue with latest blk
mmsqe Jun 6, 2023
937a3e1
disable depguard
mmsqe Jun 6, 2023
77aaa58
gogo/protobuf -> cosmos/gogoproto
mmsqe Jun 6, 2023
a6ba5d4
no pass chain_id after setup
mmsqe Jun 6, 2023
067c390
fix lint
mmsqe Jun 6, 2023
24d8c2e
fix err msg due to empty version check fix
mmsqe Jun 6, 2023
4722e01
add the crisis store in store upgrades
mmsqe Jun 6, 2023
54aac17
fix lint
mmsqe Jun 6, 2023
9be2499
add consensus upgrade
mmsqe Jun 6, 2023
b90016f
migrate consensus parameters
mmsqe Jun 6, 2023
bc3fbfd
fix lint
mmsqe Jun 7, 2023
e41e077
allow flag overwrite chainId
mmsqe Jun 7, 2023
b739244
fix ConsensusParams
mmsqe Jun 7, 2023
c0371da
fix lint
mmsqe Jun 7, 2023
4c612a3
add paramKeyTable
mmsqe Jun 8, 2023
7227022
add change log
mmsqe Jun 8, 2023
99c004b
err code change due to nested msg check
mmsqe Jun 8, 2023
a0487ff
fix lint
mmsqe Jun 9, 2023
856c815
cleanup mod
mmsqe Jun 8, 2023
30980bb
add nil check for consParams.Block
mmsqe Jun 9, 2023
ad23f7a
Revert "fix ConsensusParams"
mmsqe Jun 9, 2023
aed8238
sdk to v0.47.3 and ibc-go to v7.1.0
mmsqe Jun 9, 2023
d09961e
point to logger fix
mmsqe Jun 9, 2023
2c58a53
get consParams from keeper if not in ctx
mmsqe Jun 15, 2023
331a437
point back cometbft
mmsqe Jun 15, 2023
bcde07c
fix broadcast mode
mmsqe Jun 14, 2023
90b6b76
Revert "get consParams from keeper if not in ctx"
mmsqe Jun 15, 2023
373b493
point to sdk cp fix
mmsqe Jun 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 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 @@ -67,9 +66,9 @@ linters-settings:
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)
1 change: 1 addition & 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) [#1782](https://github.com/evmos/ethermint/pull/1782) Bump Cosmos-SDK to v0.47.3 and ibc-go to v7.1.0.

### Bug Fixes

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
56 changes: 16 additions & 40 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 @@ -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 @@ -392,30 +392,10 @@ 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.11.6
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 +406,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
2 changes: 1 addition & 1 deletion app/ante/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import (
"fmt"
"runtime/debug"

tmlog "github.com/tendermint/tendermint/libs/log"
tmlog "github.com/cometbft/cometbft/libs/log"

errorsmod "cosmossdk.io/errors"
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
Expand Down
4 changes: 2 additions & 2 deletions app/ante/ante_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256r1"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/types/tx/signing"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"

Expand All @@ -32,6 +31,7 @@ import (
"github.com/evmos/ethermint/tests"
evmtypes "github.com/evmos/ethermint/x/evm/types"

amino "github.com/cosmos/cosmos-sdk/codec"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
)
Expand Down Expand Up @@ -1349,7 +1349,7 @@ func (suite AnteTestSuite) TestAnteHandlerWithParams() {
func (suite *AnteTestSuite) TestConsumeSignatureVerificationGas() {
params := authtypes.DefaultParams()
msg := []byte{1, 2, 3, 4}
cdc := simapp.MakeTestEncodingConfig().Amino
cdc := amino.NewLegacyAmino()

p := authtypes.DefaultParams()
skR1, _ := secp256r1.GenPrivKey()
Expand Down
6 changes: 3 additions & 3 deletions app/ante/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"time"

abci "github.com/tendermint/tendermint/abci/types"
abci "github.com/cometbft/cometbft/abci/types"

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
Expand Down Expand Up @@ -274,7 +274,7 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
},
),
},
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
expectedCode: sdkerrors.ErrUnpackAny.ABCICode(),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

err code change, for more info

},
{
name: "a MsgExec with nested MsgExec messages that has invalid messages is blocked",
Expand All @@ -287,7 +287,7 @@ func (suite *AnteTestSuite) TestRejectDeliverMsgsInAuthz() {
},
),
},
expectedCode: sdkerrors.ErrUnauthorized.ABCICode(),
expectedCode: sdkerrors.ErrUnpackAny.ABCICode(),
},
{
name: "a MsgExec with more nested MsgExec messages than allowed and with valid messages is blocked",
Expand Down
2 changes: 1 addition & 1 deletion app/ante/eip712.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
authante "github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx"
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"

ethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/secp256k1"
Expand Down
4 changes: 2 additions & 2 deletions app/ante/fee_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (

"github.com/stretchr/testify/require"

"github.com/cometbft/cometbft/libs/log"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
Expand All @@ -15,8 +17,6 @@ import (
ethermint "github.com/evmos/ethermint/types"
"github.com/evmos/ethermint/x/evm/types"
evmtypes "github.com/evmos/ethermint/x/evm/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
)

var _ DynamicFeeEVMKeeper = MockEVMKeeper{}
Expand Down
4 changes: 2 additions & 2 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import (
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"

ibcante "github.com/cosmos/ibc-go/v6/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v6/modules/core/keeper"
ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante"
ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper"

evmtypes "github.com/evmos/ethermint/x/evm/types"
)
Expand Down
6 changes: 3 additions & 3 deletions app/ante/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import (
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"

"cosmossdk.io/simapp"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/tx"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
kmultisig "github.com/cosmos/cosmos-sdk/crypto/keys/multisig"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/crypto/types/multisig"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
txtypes "github.com/cosmos/cosmos-sdk/types/tx"
Expand All @@ -53,7 +53,7 @@ import (
evmtypes "github.com/evmos/ethermint/x/evm/types"
feemarkettypes "github.com/evmos/ethermint/x/feemarket/types"

tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
)

type AnteTestSuite struct {
Expand Down Expand Up @@ -421,7 +421,7 @@ func (suite *AnteTestSuite) CreateTestEIP712SubmitProposalV1(from sdk.AccAddress
proposalMsgs,
sdk.NewCoins(sdk.NewCoin(evmtypes.DefaultEVMDenom, sdkmath.NewInt(100))),
sdk.MustBech32ifyAddressBytes(sdk.GetConfig().GetBech32AccountAddrPrefix(), from.Bytes()),
"Metadata",
"Metadata", "title", "summary",
)

suite.Require().NoError(err)
Expand Down
Loading