Skip to content

Commit

Permalink
Merge branch 'main' into interchaintest/v20
Browse files Browse the repository at this point in the history
  • Loading branch information
MSalopek authored Sep 16, 2024
2 parents a71a47d + 233c5c1 commit 8df29d3
Show file tree
Hide file tree
Showing 22 changed files with 100 additions and 97 deletions.
5 changes: 5 additions & 0 deletions .changelog/unreleased/api-breaking/3335-bump-ics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Bump [ICS](https://github.com/cosmos/interchain-security) to
[v6.0.0](https://github.com/cosmos/interchain-security/releases/tag/v6.0.0).
This release of ICS introduces several API breaking changes.
See the [ICS changelog](https://github.com/cosmos/interchain-security/blob/v6.0.0/CHANGELOG.md#api-breaking) for details.
([\#3335](https://github.com/cosmos/gaia/pull/3335))
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Migrate consensus params - initialize Version field
([\#3333](https://github.com/cosmos/gaia/pull/3333))
3 changes: 0 additions & 3 deletions .changelog/unreleased/dependencies/3305-bump-ibc.md

This file was deleted.

3 changes: 3 additions & 0 deletions .changelog/unreleased/dependencies/3335-bump-ics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Bump [ICS](https://github.com/cosmos/interchain-security) to
[v6.0.0](https://github.com/cosmos/interchain-security/releases/tag/v6.0.0).
([\#3335](https://github.com/cosmos/gaia/pull/3335))
3 changes: 3 additions & 0 deletions .changelog/unreleased/dependencies/3338-bump-ibc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Bump [ibc-go](https://github.com/cosmos/ibc-go) to
[v8.5.1](https://github.com/cosmos/ibc-go/releases/tag/v8.5.1)
([\#3338](https://github.com/cosmos/gaia/pull/3338))
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/3308-ics-metadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Set the metadata for launched ICS consumer chains.
([\#3308](https://github.com/cosmos/gaia/pull/3308))
3 changes: 3 additions & 0 deletions .changelog/unreleased/features/3316-ics-props-migrate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Migrate active ICS gov proposal to the new messages
introduced by the permissionless ICS feature.
([\#3316](https://github.com/cosmos/gaia/pull/3316))
6 changes: 6 additions & 0 deletions .changelog/unreleased/features/3335-bump-ics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Bump [ICS](https://github.com/cosmos/interchain-security) to
[v6.0.0](https://github.com/cosmos/interchain-security/releases/tag/v6.0.0).
This release of ICS enables the permissionless creation of consumer chains
and allows validators outside the active validator set to opt in to validate
on consumer chains.
([\#3335](https://github.com/cosmos/gaia/pull/3335))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Set the `MaxProviderConsensusValidators` parameter of the provider module to 180.
This parameter will be used to govern the number of validators participating in consensus,
and takes over this role from the `MaxValidators` parameter of the staking module.
([\#3263](https://github.com/cosmos/gaia/pull/3263))
5 changes: 5 additions & 0 deletions .changelog/unreleased/state-breaking/3263-max-validators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Set the `MaxValidators` parameter of the staking module to 200, which is the current number of 180 plus 20.
This is done as a result of introducing the inactive-validators feature of Interchain Security,
which entails that the number of validators participating in consensus will be governed by the
`MaxProviderConsensusValidators` parameter in the provider module.
([\#3263](https://github.com/cosmos/gaia/pull/3263))
2 changes: 2 additions & 0 deletions .changelog/unreleased/state-breaking/3308-ics-metadata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Set the metadata for launched ICS consumer chains.
([\#3308](https://github.com/cosmos/gaia/pull/3308))
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Migrate active ICS gov proposal to the new messages
introduced by the permissionless ICS feature.
([\#3316](https://github.com/cosmos/gaia/pull/3316))
3 changes: 3 additions & 0 deletions .changelog/unreleased/state-breaking/3335-bump-ics.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Bump [ICS](https://github.com/cosmos/interchain-security) to
[v6.0.0](https://github.com/cosmos/interchain-security/releases/tag/v6.0.0).
([\#3335](https://github.com/cosmos/gaia/pull/3335))
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ updates:
directory: "/"
schedule:
interval: daily
target-branch: "release/v18.1.x"
target-branch: "release/v19.2.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
Expand All @@ -31,7 +31,7 @@ updates:
directory: "/"
schedule:
interval: daily
target-branch: "release/v19.1.x"
target-branch: "release/v20.x"
# Only allow automated security-related dependency updates on release branches.
open-pull-requests-limit: 0
labels:
Expand Down
68 changes: 0 additions & 68 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,72 +76,6 @@ builds:
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,static_wasm
- -X github.com/cometbft/cometbft/version.TMCoreSemVer={{ .Env.TM_VERSION }}

- id: gaiad-linux-amd64
main: ./cmd/gaiad
binary: gaiad
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.x86_64.a -O /lib/libwasmvm_muslc.x86_64.a
goos:
- linux
goarch:
- amd64
env:
- CC=x86_64-linux-gnu-gcc
flags:
- -mod=readonly
- -trimpath
ldflags:
- -X main.commit={{.Commit}}
- -X main.date={{ .CommitDate }}
- -X github.com/cosmos/cosmos-sdk/version.Name=gaia
- -X github.com/cosmos/cosmos-sdk/version.AppName=gaiad
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cometbft/cometbft/version.TMCoreSemVer={{ .Env.TM_VERSION }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger,muslc,osusergo
- -w -s
- -linkmode=external
- -extldflags '-Wl,-z,muldefs -static -lm'
tags:
- netgo
- ledger
- muslc
- osusergo

- id: gaiad-linux-arm64
main: ./cmd/gaiad
binary: gaiad
hooks:
pre:
- wget https://github.com/CosmWasm/wasmvm/releases/download/{{ .Env.COSMWASM_VERSION }}/libwasmvm_muslc.aarch64.a -O /lib/libwasmvm_muslc.aarch64.a
goos:
- linux
goarch:
- arm64
env:
- CC=aarch64-linux-gnu-gcc
flags:
- -mod=readonly
- -trimpath
ldflags:
- -s -w
- -linkmode=external
- -X main.commit={{.Commit}}
- -X main.date={{ .CommitDate }}
- -X github.com/cosmos/cosmos-sdk/version.Name=gaia
- -X github.com/cosmos/cosmos-sdk/version.AppName=gaiad
- -X github.com/cosmos/cosmos-sdk/version.Version=v{{ .Version }}
- -X github.com/cosmos/cosmos-sdk/version.Commit={{ .Commit }}
- -X github.com/cosmos/cosmos-sdk/version.BuildTags=netgo,ledger
- -X github.com/cometbft/cometbft/version.TMCoreSemVer={{ .Env.TM_VERSION }}
- -extldflags '-Wl,-z,muldefs -static -lm'
tags:
- netgo
- ledger
- muslc
- osusergo


universal_binaries:
- id: gaiad-darwin-universal
Expand All @@ -168,8 +102,6 @@ archives:
builds:
- gaiad-darwin-arm64
- gaiad-darwin-amd64
- gaiad-linux-amd64
- gaiad-linux-arm64
wrap_in_directory: false
files:
- none*
Expand Down
12 changes: 6 additions & 6 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ pull_request_rules:
{{ title }} (#{{ number }})
{{ body }}
- name: Backport patches to the release/v18.1.x branch
- name: Backport patches to the release/v19.2.x branch
conditions:
- base=main
- label=A:backport/v18.1.x
- label=A:backport/v19.2.x
actions:
backport:
branches:
- release/v18.1.x
- release/v19.2.x

- name: Backport patches to the release/v19.1.x branch
- name: Backport patches to the release/v20.x branch
conditions:
- base=main
- label=A:backport/v19.1.x
- label=A:backport/v20.x
actions:
backport:
branches:
- release/v19.1.x
- release/v20.x
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,6 @@ vulncheck: $(BUILDDIR)/
GOBIN=$(BUILDDIR) go install golang.org/x/vuln/cmd/govulncheck@latest
$(BUILDDIR)/govulncheck ./...

build-linux: go.sum
LEDGER_ENABLED=false GOOS=linux GOARCH=amd64 $(MAKE) build

go.sum: go.mod
@echo "--> Ensure dependencies have not been modified"
@echo "--> Ensure dependencies have not been modified unless suppressed by SKIP_MOD_VERIFY"
Expand Down Expand Up @@ -184,9 +181,27 @@ else
@echo "--> No tag specified, skipping tag release"
endif


# uses goreleaser to create static binaries for linux an darwin on local machine
# platform is set because not setting it results in broken builds for linux-amd64
# Build static binaries for linux/amd64 using docker buildx
# Pulled from neutron-org/neutron: https://github.com/neutron-org/neutron/blob/v4.2.2/Makefile#L107
build-static-linux-amd64: go.sum $(BUILDDIR)/
$(DOCKER) buildx create --name gaiabuilder || true
$(DOCKER) buildx use gaiabuilder
$(DOCKER) buildx build \
--build-arg GO_VERSION=$(GO_VERSION) \
--build-arg GIT_VERSION=$(VERSION) \
--build-arg GIT_COMMIT=$(COMMIT) \
--build-arg BUILD_TAGS=$(build_tags_comma_sep),muslc \
--platform linux/amd64 \
-t gaiad-static-amd64 \
-f Dockerfile . \
--load
$(DOCKER) rm -f gaiabinary || true
$(DOCKER) create -ti --name gaiabinary gaiad-static-amd64
$(DOCKER) cp gaiabinary:/usr/local/bin/ $(BUILDDIR)/gaiad-linux-amd64
$(DOCKER) rm -f gaiabinary


# uses goreleaser to create static binaries for darwin on local machine
goreleaser-build-local:
docker run \
--rm \
Expand All @@ -195,7 +210,6 @@ goreleaser-build-local:
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v `pwd`:/go/src/gaiad \
-w /go/src/gaiad \
--platform=linux/amd64 \
$(GORELEASER_IMAGE) \
release \
--snapshot \
Expand All @@ -216,7 +230,6 @@ ci-release:
-e COSMWASM_VERSION=$(COSMWASM_VERSION) \
-v `pwd`:/go/src/gaiad \
-w /go/src/gaiad \
--platform=linux/amd64 \
$(GORELEASER_IMAGE) \
release \
--release-notes ./RELEASE_NOTES.md \
Expand Down
24 changes: 24 additions & 0 deletions app/upgrades/v20/upgrades.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"encoding/json"
"fmt"

cmtproto "github.com/cometbft/cometbft/proto/tendermint/types"

providerkeeper "github.com/cosmos/interchain-security/v6/x/ccv/provider/keeper"
providertypes "github.com/cosmos/interchain-security/v6/x/ccv/provider/types"

Expand All @@ -15,6 +17,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/types/module"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
consensusparamkeeper "github.com/cosmos/cosmos-sdk/x/consensus/keeper"
govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1"
Expand Down Expand Up @@ -54,6 +57,13 @@ func CreateUpgradeHandler(
return vm, errorsmod.Wrapf(err, "running module migrations")
}

ctx.Logger().Info("Initializing ConsensusParam Version...")
err = InitializeConsensusParamVersion(ctx, keepers.ConsensusParamsKeeper)
if err != nil {
// don't hard fail here, as this is not critical for the upgrade to succeed
ctx.Logger().Error("Error initializing ConsensusParam Version:", "message", err.Error())
}

ctx.Logger().Info("Initializing MaxProviderConsensusValidators parameter...")
InitializeMaxProviderConsensusParam(ctx, keepers.ProviderKeeper)

Expand Down Expand Up @@ -87,6 +97,20 @@ func CreateUpgradeHandler(
}
}

// InitializeConsensusParamVersion initializes the consumer params that were missed in a consensus keeper migration.
// Some fields were set to nil values instead of zero values, which causes a panic during Txs to modify the params.
// Context:
// - https://github.com/cosmos/cosmos-sdk/issues/21483
// - https://github.com/cosmos/cosmos-sdk/pull/21484
func InitializeConsensusParamVersion(ctx sdk.Context, consensusKeeper consensusparamkeeper.Keeper) error {
params, err := consensusKeeper.ParamsStore.Get(ctx)
if err != nil {
return err
}
params.Version = &cmtproto.VersionParams{}
return consensusKeeper.ParamsStore.Set(ctx, params)
}

// InitializeMaxProviderConsensusParam initializes the MaxProviderConsensusValidators parameter.
// It is set to 180, which is the current number of validators participating in consensus on the Cosmos Hub.
// This parameter will be used to govern the number of validators participating in consensus on the Cosmos Hub,
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ require (
github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8 v8.0.2
github.com/cosmos/ibc-apps/modules/rate-limiting/v8 v8.0.0
github.com/cosmos/ibc-go/modules/capability v1.0.1
github.com/cosmos/ibc-go/v8 v8.5.0
github.com/cosmos/interchain-security/v6 v6.0.0-20240911170053-c05141e163b2
github.com/cosmos/ibc-go/v8 v8.5.1
github.com/cosmos/interchain-security/v6 v6.0.0
github.com/google/gofuzz v1.2.0
github.com/gorilla/mux v1.8.1
github.com/ory/dockertest/v3 v3.11.0
Expand Down
12 changes: 4 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -439,16 +439,12 @@ github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0
github.com/cosmos/ibc-go/modules/apps/callbacks v0.2.1-0.20231113120333-342c00b0f8bd/go.mod h1:JWfpWVKJKiKtd53/KbRoKfxWl8FsT2GPcNezTOk0o5Q=
github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI=
github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E=
github.com/cosmos/ibc-go/v8 v8.5.0 h1:OjaSXz480JT8ZuMrASxGgS7XzloZ2NuuJPwZB/fKDgE=
github.com/cosmos/ibc-go/v8 v8.5.0/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo=
github.com/cosmos/ibc-go/v8 v8.5.1 h1:3JleEMKBjRKa3FeTKt4fjg22za/qygLBo7mDkoYTNBs=
github.com/cosmos/ibc-go/v8 v8.5.1/go.mod h1:P5hkAvq0Qbg0h18uLxDVA9q1kOJ0l36htMsskiNwXbo=
github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU=
github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0=
github.com/cosmos/interchain-security/v6 v6.0.0-20240906165300-5b6252c77268 h1:UJEywL1Fi/HYAFao8fUQxvQXudrt2Vv+D3BL9JK/osM=
github.com/cosmos/interchain-security/v6 v6.0.0-20240906165300-5b6252c77268/go.mod h1:+5zIZEzkL4yNHB/UWXCu75t6GeEgEmWHbz5OnBWiL0o=
github.com/cosmos/interchain-security/v6 v6.0.0-20240911164533-804b53b1bdc8 h1:5Y5h7ANC36DEOrrDhDFl9ecKUXAl/ZmSwXDQMHR2Gl4=
github.com/cosmos/interchain-security/v6 v6.0.0-20240911164533-804b53b1bdc8/go.mod h1:+5zIZEzkL4yNHB/UWXCu75t6GeEgEmWHbz5OnBWiL0o=
github.com/cosmos/interchain-security/v6 v6.0.0-20240911170053-c05141e163b2 h1:wGfWTO+frkqPbRsa0otX1tWappl6ovWgrlA/n7J9XcA=
github.com/cosmos/interchain-security/v6 v6.0.0-20240911170053-c05141e163b2/go.mod h1:+5zIZEzkL4yNHB/UWXCu75t6GeEgEmWHbz5OnBWiL0o=
github.com/cosmos/interchain-security/v6 v6.0.0 h1:BieZEefykqrD2Vvt3onsYjEAa5O+aWoRWSF8nN5aidE=
github.com/cosmos/interchain-security/v6 v6.0.0/go.mod h1:+5zIZEzkL4yNHB/UWXCu75t6GeEgEmWHbz5OnBWiL0o=
github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo=
github.com/cosmos/keyring v1.2.0/go.mod h1:fc+wB5KTk9wQ9sDx0kFXB3A0MaeGHM9AwRStKOQ5vOA=
github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM=
Expand Down

0 comments on commit 8df29d3

Please sign in to comment.