Skip to content
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

[WIP] v1.7.0 - Upgrade CometBFT, Comos SDK, IBC #236

Closed
wants to merge 13 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
31 changes: 16 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ DIFF_TAG=$(shell git rev-list --tags="v*" --max-count=1 --not $(shell git rev-li
DEFAULT_TAG=$(shell git rev-list --tags="v*" --max-count=1)
# VERSION ?= $(shell echo $(shell git describe --tags $(or $(DIFF_TAG), $(DEFAULT_TAG))) | sed 's/^v//')

VERSION := "1.6.1"
TMVERSION := $(shell go list -m github.com/tendermint/tendermint | sed 's:.* ::')
VERSION := "1.7.0"
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 @@ -75,7 +75,7 @@ ldflags = -X github.com/cosmos/cosmos-sdk/version.Name=haqq \
-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)

# DB backend selection
ifeq (cleveldb,$(findstring cleveldb,$(COSMOS_BUILD_OPTIONS)))
Expand Down Expand Up @@ -221,7 +221,8 @@ 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 install github.com/fjl/gencodec@latest
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
else
@echo "protoc-gen-go already installed; skipping..."
endif
Expand Down Expand Up @@ -450,25 +451,25 @@ format:
# 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)
protoVer=0.11.6
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace --user 0 $(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)
# 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)
# protolintVer=0.42.2
# protolintName=yoheimuta/protolint:$(protolintVer)
# protolintImage=$(DOCKER) run --network host --rm -v $(CURDIR):/workspace --workdir /workspace $(protolintName)

proto-all: proto-format proto-lint proto-gen

Expand All @@ -495,7 +496,7 @@ TM_URL = https://raw.githubusercontent.com/tendermint/tendermint/v0
GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos
COSMOS_SDK_URL = https://raw.githubusercontent.com/cosmos/cosmos-sdk/v0.45.1
ETHERMINT_URL = https://raw.githubusercontent.com/evmos/ethermint/v0.18.0
IBC_GO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v3.0.0-rc0
IBC_GO_URL = https://raw.githubusercontent.com/cosmos/ibc-go/v3.0.0-rc0
COSMOS_PROTO_URL = https://raw.githubusercontent.com/cosmos/cosmos-proto/main

TM_CRYPTO_TYPES = third_party/proto/tendermint/crypto
Expand Down Expand Up @@ -590,7 +591,7 @@ localnet-show-logstream:
###############################################################################

PACKAGE_NAME:=github.com/haqq-network/haqq
GOLANG_CROSS_VERSION = v1.19
GOLANG_CROSS_VERSION = v1.20
GOPATH ?= '$(HOME)/go'
release-dry-run:
docker run \
Expand Down
20 changes: 17 additions & 3 deletions app/ante/cosmos/authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ package cosmos_test

import (
"fmt"
"math/big"
"testing"
"time"

"github.com/stretchr/testify/require"

abci "github.com/cometbft/cometbft/abci/types"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
sdkvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/types"
"github.com/cosmos/cosmos-sdk/x/authz"
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
abci "github.com/tendermint/tendermint/abci/types"
ethtypes "github.com/ethereum/go-ethereum/core/types"

cosmosante "github.com/haqq-network/haqq/app/ante/cosmos"
"github.com/haqq-network/haqq/testutil"
Expand Down Expand Up @@ -280,6 +282,18 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() {

distantFuture := time.Date(9000, 1, 1, 0, 0, 0, 0, time.UTC)

// create a dummy MsgEthereumTx for the test
// otherwise throws error that cannot unpack tx data
msgEthereumTx := evmtypes.NewTx(&evmtypes.EvmTxArgs{
ChainID: big.NewInt(9000),
Nonce: 0,
GasLimit: 1000000,
GasFeeCap: suite.app.FeeMarketKeeper.GetBaseFee(suite.ctx),
GasTipCap: big.NewInt(1),
Input: nil,
Accesses: &ethtypes.AccessList{},
})

newMsgGrant := func(msgTypeUrl string) *authz.MsgGrant {
msg, err := authz.NewMsgGrant(
testAddresses[0],
Expand Down Expand Up @@ -326,7 +340,7 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() {
testAddresses[3],
sdk.NewCoins(sdk.NewInt64Coin(evmtypes.DefaultEVMDenom, 100e6)),
),
&evmtypes.MsgEthereumTx{},
msgEthereumTx,
},
),
},
Expand All @@ -339,7 +353,7 @@ func (suite *AnteTestSuite) TestRejectMsgsInAuthz() {
testAddresses[1],
2,
[]sdk.Msg{
&evmtypes.MsgEthereumTx{},
msgEthereumTx,
},
),
},
Expand Down
1 change: 1 addition & 0 deletions app/ante/cosmos/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ type BankKeeper interface {
GetBalance(ctx sdk.Context, addr sdk.AccAddress, denom string) sdk.Coin
SendCoins(ctx sdk.Context, from, to sdk.AccAddress, amt sdk.Coins) error
SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error
IsSendEnabledCoins(ctx sdk.Context, coins ...sdk.Coin) error
}
4 changes: 2 additions & 2 deletions app/ante/cosmos/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import (
"github.com/stretchr/testify/suite"

sdkmath "cosmossdk.io/math"
"cosmossdk.io/simapp"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/haqq-network/haqq/app"
"github.com/haqq-network/haqq/app/ante"
Expand Down
4 changes: 2 additions & 2 deletions app/ante/evm/fee_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ 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"
authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
"github.com/ethereum/go-ethereum/params"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/haqq-network/haqq/encoding"
"github.com/haqq-network/haqq/types"
Expand Down
4 changes: 2 additions & 2 deletions app/ante/evm/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/stretchr/testify/suite"

sdkmath "cosmossdk.io/math"
"cosmossdk.io/simapp"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/core/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/haqq-network/haqq/app"
"github.com/haqq-network/haqq/app/ante"
Expand Down
6 changes: 3 additions & 3 deletions app/ante/evm/utils_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import (
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
ibctypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
ibcclienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
ibctypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
"github.com/ethereum/go-ethereum/common"
ethtypes "github.com/ethereum/go-ethereum/core/types"

Expand Down Expand Up @@ -317,7 +317,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
4 changes: 2 additions & 2 deletions app/ante/handler_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
sdkvesting "github.com/cosmos/cosmos-sdk/x/auth/vesting/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"

cosmosante "github.com/haqq-network/haqq/app/ante/cosmos"
evmante "github.com/haqq-network/haqq/app/ante/evm"
Expand Down
4 changes: 2 additions & 2 deletions app/ante/utils/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
"github.com/stretchr/testify/suite"

sdkmath "cosmossdk.io/math"
"cosmossdk.io/simapp"
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/simapp"
"github.com/cosmos/cosmos-sdk/testutil/testdata"
sdk "github.com/cosmos/cosmos-sdk/types"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/ethereum/go-ethereum/core/types"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"

"github.com/haqq-network/haqq/app"
"github.com/haqq-network/haqq/app/ante"
Expand Down
Loading