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

deps!: bring cosmos-sdk v47 deps to gaia (ibc-go, ics, pfm) #2852

Merged
merged 33 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
e085b40
chore: merge main into feat/sdk-47-ibc-7 branch (#2625)
sainoe Jun 23, 2023
a8f0e87
resolve merge conflicts
mpoke Jun 29, 2023
ec7c870
feat!: SDK v0.47 & IBC v7 Base (#2541)
glnro Jul 4, 2023
f5fc4ba
feat: refactor base E2E tests (#2587)
sainoe Jul 12, 2023
0510ee7
feat: refactor global fee module for SDK v47 (#2660)
sainoe Jul 24, 2023
861ba39
deps: bump ics to v3.1; chore: update e2e (#2663)
MSalopek Jul 24, 2023
2e4d98d
chore: refactor remaining E2E tests for SDK v47 (#2744)
sainoe Sep 26, 2023
ff8acab
deps: bump go version to 1.21
MSalopek Dec 8, 2023
d0a672a
tests: update hermes images and setup (#2841)
MSalopek Dec 8, 2023
21a192a
deps: use lsm cosmos-sdk fork and ics 3.3.0-rc0-lsm (#2842)
MSalopek Dec 8, 2023
b4730f5
chore!: merge main into feat/sdk-47-ibc7 (#2851)
MSalopek Dec 12, 2023
925bfee
chore: merge main into feat/sdk-47-ibc-7; update broken tests (#2853)
MSalopek Dec 12, 2023
df6cb1a
Merge branch 'main' into feat/sdk-47-ibc-7
MSalopek Dec 12, 2023
a91f8cf
chore: post-merge cleanup
MSalopek Dec 12, 2023
fd63f6e
chore: post-merge cleanup
MSalopek Dec 12, 2023
ce86f31
chore: post-merge cleanup
MSalopek Dec 12, 2023
1b54845
deps: update migration to use latest cosmos-sdk/lsm
MSalopek Dec 13, 2023
c9b7817
chore: appease linter
MSalopek Dec 13, 2023
ed08c80
chore: rm 3rd party
MSalopek Dec 15, 2023
89c5afe
nit: add back removed lines from historic v7 migration
MSalopek Dec 18, 2023
f4d7a07
add changelog entries for IBC and PFM
mpoke Jan 9, 2024
57829a9
deps!: bump ICS to v3.3.0 (#2885)
mpoke Jan 12, 2024
4c1d11c
dep:update sdk version to comsos:feature/v0.47.x-ics-lsm
sainoe Jan 12, 2024
1c4c653
Address comments
sainoe Jan 12, 2024
6146536
Merge branch 'main' into feat/sdk-47-ibc-7
sainoe Jan 12, 2024
60c95de
fix go.mod
sainoe Jan 12, 2024
0f065e0
add changelog for bumping CometBFT
sainoe Jan 15, 2024
51be26f
address comments
sainoe Jan 15, 2024
bfccb95
re-enabled an unique Go version requirement
sainoe Jan 15, 2024
040c5d5
Merge branch 'main' into feat/sdk-47-ibc-7
sainoe Jan 16, 2024
17ab417
dep: update SDK version to last commit hash of feat/v0.47.x-ics-lsm"
sainoe Jan 16, 2024
3fa245d
dep: update SDK version to last commit hash of feat/v0.47.x-ics-lsm
sainoe Jan 17, 2024
85c652b
Merge branch 'main' into feat/sdk-47-ibc-7
sainoe Jan 17, 2024
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
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true

# Initializes the CodeQL tools for scanning.
Expand Down
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:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
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/nightly-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true
- name: run-vulncheck
id: vulncheck
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3.3.2
Expand Down Expand Up @@ -65,7 +65,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:

- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"

- name: Set Env
run: echo "TM_VERSION=$(go list -m github.com/tendermint/tendermint | sed 's:.* ::')" >> $GITHUB_ENV
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/sim-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3.3.2
Expand All @@ -33,7 +33,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: actions/cache@v3.3.2
with:
path: ~/go/bin
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/sims.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3.3.2
Expand All @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
Expand All @@ -60,7 +60,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: technote-space/get-diff-action@v6
with:
PATTERNS: |
Expand All @@ -82,7 +82,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- name: Install runsim
run: go install github.com/cosmos/tools/cmd/runsim@v1.0.0
- uses: actions/cache@v3.3.2
Expand All @@ -107,7 +107,7 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: actions/checkout@v4
- uses: actions/cache@v3.3.2
with:
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.20"
go-version: "1.21"
check-latest: true
cache: true
cache-dependency-path: go.sum
Expand Down Expand Up @@ -65,16 +65,18 @@ jobs:
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: actions/checkout@v4
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Build Docker Image
- name: Build Gaia Docker Image
run: make docker-build-debug
- name: Build Hermes Docker Image
run: make docker-build-hermes
- name: Test E2E
run: make test-e2e

Expand Down Expand Up @@ -110,7 +112,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.x
go-version: 1.21.x
- uses: technote-space/get-diff-action@v6.0.1
with:
PATTERNS: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ARG IMG_TAG=latest

# Compile the gaiad binary
FROM golang:1.20-alpine AS gaiad-builder
FROM golang:1.21-alpine AS gaiad-builder
WORKDIR /src/app/
COPY go.mod go.sum* ./
RUN go mod download
Expand All @@ -17,4 +17,4 @@ COPY --from=gaiad-builder /go/bin/gaiad /usr/local/bin/
EXPOSE 26656 26657 1317 9090
USER 0

ENTRYPOINT ["gaiad", "start"]
ENTRYPOINT ["gaiad", "start"]
40 changes: 30 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ BUILDDIR ?= $(CURDIR)/build
TEST_DOCKER_REPO=cosmos/contrib-gaiatest

GO_SYSTEM_VERSION = $(shell go version | cut -c 14- | cut -d' ' -f1 | cut -d'.' -f1-2)
REQUIRE_GO_VERSION = 1.20
REQUIRE_MINIMUM_GO_VERSION = 1.20
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have this change? Shouldn't all the nodes use the same go versions -- 1.21?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't have the context of this change.
I reverted it until it's confirmed that using multiple Go versions is safe.
cc @MSalopek


export GO111MODULE = on

Expand Down Expand Up @@ -95,9 +95,10 @@ include contrib/devtools/Makefile
### Build ###
###############################################################################

IS_VERSION_SUPPORTED = $(shell echo "$(GO_SYSTEM_VERSION) >= $(REQUIRE_MINIMUM_GO_VERSION)" | bc -l)
check_version:
ifneq ($(GO_SYSTEM_VERSION), $(REQUIRE_GO_VERSION))
@echo "ERROR: Go version 1.20 is required for $(VERSION) of Gaia."
ifneq ($(IS_VERSION_SUPPORTED), 1)
@echo "ERROR: Minimal go version required for Gaia: $(VERSION) is $(REQUIRE_MINIMUM_GO_VERSION). You are using $(GO_SYSTEM_VERSION)."
exit 1
endif

Expand Down Expand Up @@ -234,7 +235,7 @@ docker-build-debug:
# TODO: Push this to the Cosmos Dockerhub so we don't have to keep building it
# in CI.
docker-build-hermes:
@cd tests/e2e/docker; docker build -t cosmos/hermes-e2e:latest -f hermes.Dockerfile .
@cd tests/e2e/docker; docker build -t ghcr.io/cosmos/hermes-e2e:1.0.0 -f hermes.Dockerfile .

docker-build-all: docker-build-debug docker-build-hermes

Expand Down Expand Up @@ -271,9 +272,9 @@ start-localnet-ci: build
./build/gaiad config chain-id liveness --home ~/.gaiad-liveness
./build/gaiad config keyring-backend test --home ~/.gaiad-liveness
./build/gaiad keys add val --home ~/.gaiad-liveness
./build/gaiad add-genesis-account val 10000000000000000000000000stake --home ~/.gaiad-liveness --keyring-backend test
./build/gaiad gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness
./build/gaiad collect-gentxs --home ~/.gaiad-liveness
./build/gaiad genesis add-genesis-account val 10000000000000000000000000stake --home ~/.gaiad-liveness --keyring-backend test
./build/gaiad genesis gentx val 1000000000stake --home ~/.gaiad-liveness --chain-id liveness
./build/gaiad genesis collect-gentxs --home ~/.gaiad-liveness
sed -i.bak'' 's/minimum-gas-prices = ""/minimum-gas-prices = "0uatom"/' ~/.gaiad-liveness/config/app.toml
./build/gaiad start --home ~/.gaiad-liveness --x-crisis-skip-assert-invariants

Expand All @@ -300,12 +301,31 @@ test-docker-push: test-docker
###############################################################################
### Protobuf ###
###############################################################################
protoVer=0.13.0
protoImageName=ghcr.io/cosmos/proto-builder:$(protoVer)
protoImage=$(DOCKER) run --rm -v $(CURDIR):/workspace --workdir /workspace $(protoImageName)

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

proto-gen:
@echo "Generating Protobuf files"
@sh ./proto/scripts/protocgen.sh
@$(protoImage) sh ./proto/scripts/protocgen.sh

proto-swagger-gen:
@echo "Generating Protobuf Swagger"
@sh ./proto/scripts/protoc-swagger-gen.sh
@$(protoImage) sh ./proto/scripts/protoc-swagger-gen.sh

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

proto-lint:
@$(protoImage) buf lint --error-format=json

proto-check-breaking:
@$(protoImage) buf breaking --against $(HTTPS_GIT)#branch=main

proto-update-deps:
@echo "Updating Protobuf dependencies"
$(DOCKER) run --rm -v $(CURDIR)/proto:/workspace --workdir /workspace $(protoImageName) buf mod update

.PHONY: proto-gen proto-doc proto-swagger-gen
.PHONY: proto-all proto-gen proto-gen-any proto-swagger-gen proto-format proto-lint proto-check-breaking proto-update-deps
sainoe marked this conversation as resolved.
Show resolved Hide resolved
20 changes: 12 additions & 8 deletions ante/ante.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package ante

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

errorsmod "cosmossdk.io/errors"

Expand All @@ -11,6 +11,7 @@ import (
"github.com/cosmos/cosmos-sdk/x/auth/ante"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"

gaiaerrors "github.com/cosmos/gaia/v15/types/errors"
gaiafeeante "github.com/cosmos/gaia/v15/x/globalfee/ante"
Expand All @@ -24,7 +25,8 @@ type HandlerOptions struct {
GovKeeper *govkeeper.Keeper
IBCkeeper *ibckeeper.Keeper
GlobalFeeSubspace paramtypes.Subspace
StakingSubspace paramtypes.Subspace
StakingKeeper *stakingkeeper.Keeper
TxFeeChecker ante.TxFeeChecker
}

func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
Expand All @@ -40,10 +42,12 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {
if opts.IBCkeeper == nil {
return nil, errorsmod.Wrap(gaiaerrors.ErrLogic, "IBC keeper is required for AnteHandler")
}
// TODO: Enable with Globalfee
sainoe marked this conversation as resolved.
Show resolved Hide resolved
if opts.GlobalFeeSubspace.Name() == "" {
return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "globalfee param store is required for AnteHandler")
}
if opts.StakingSubspace.Name() == "" {

if opts.StakingKeeper == nil {
return nil, errorsmod.Wrap(gaiaerrors.ErrNotFound, "staking param store is required for AnteHandler")
}
if opts.GovKeeper == nil {
Expand All @@ -57,20 +61,20 @@ func NewAnteHandler(opts HandlerOptions) (sdk.AnteHandler, error) {

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
ante.NewRejectExtensionOptionsDecorator(),
ante.NewExtensionOptionsDecorator(opts.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(),
ante.NewTxTimeoutHeightDecorator(),
ante.NewValidateMemoDecorator(opts.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(opts.AccountKeeper),
NewGovPreventSpamDecorator(opts.Codec, opts.GovKeeper),
gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingSubspace),
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper),
gaiafeeante.NewFeeDecorator(opts.GlobalFeeSubspace, opts.StakingKeeper),
ante.NewDeductFeeDecorator(opts.AccountKeeper, opts.BankKeeper, opts.FeegrantKeeper, opts.TxFeeChecker),
ante.NewSetPubKeyDecorator(opts.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators
ante.NewValidateSigCountDecorator(opts.AccountKeeper),
ante.NewSigGasConsumeDecorator(opts.AccountKeeper, sigGasConsumer),
ante.NewSigVerificationDecorator(opts.AccountKeeper, opts.SignModeHandler),
ante.NewIncrementSequenceDecorator(opts.AccountKeeper),
ibcante.NewAnteDecorator(opts.IBCkeeper),
ibcante.NewRedundantRelayDecorator(opts.IBCkeeper),
}

return sdk.ChainAnteDecorators(anteDecorators...), nil
Expand Down
8 changes: 4 additions & 4 deletions ante/gov_ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/authz"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1"

gaiaerrors "github.com/cosmos/gaia/v15/types/errors"
)
Expand Down Expand Up @@ -47,10 +47,10 @@ func (g GovPreventSpamDecorator) AnteHandle(
// validateGovMsgs checks if the InitialDeposit amounts are greater than the minimum initial deposit amount
func (g GovPreventSpamDecorator) ValidateGovMsgs(ctx sdk.Context, msgs []sdk.Msg) error {
validMsg := func(m sdk.Msg) error {
if msg, ok := m.(*govtypes.MsgSubmitProposal); ok {
if msg, ok := m.(*govv1beta1.MsgSubmitProposal); ok {
// prevent messages with insufficient initial deposit amount
depositParams := g.govKeeper.GetDepositParams(ctx)
minInitialDeposit := g.calcMinInitialDeposit(depositParams.MinDeposit)
params := g.govKeeper.GetParams(ctx)
minInitialDeposit := g.calcMinInitialDeposit(params.MinDeposit)
if !msg.InitialDeposit.IsAllGTE(minInitialDeposit) {
return errorsmod.Wrapf(gaiaerrors.ErrInsufficientFunds, "insufficient initial deposit amount - required: %v", minInitialDeposit)
}
Expand Down
Loading
Loading