From 4779ce8ef1c39c1795ecc52155a918e3a44341fe Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Fri, 24 Feb 2023 15:13:32 +0100 Subject: [PATCH] build: use cometbft in v0.45 (#15089) --- .github/workflows/release.yml | 3 +-- .github/workflows/sims.yml | 12 ++++++------ .github/workflows/test.yml | 12 ++++++------ CHANGELOG.md | 2 ++ Makefile | 2 +- README.md | 2 +- RELEASE_NOTES.md | 19 ++++++++++++------- contrib/images/simd-dlv/Dockerfile | 2 +- contrib/images/simd-env/Dockerfile | 2 +- go.mod | 10 ++++++---- go.sum | 6 ++++-- server/rollback.go | 2 +- server/start.go | 2 +- server/util.go | 2 +- store/rootmulti/snapshot_test.go | 2 +- store/snapshots/manager_test.go | 2 +- 16 files changed, 46 insertions(+), 36 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 962a75136f06..755c28affe75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,8 +20,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: "1.23" - check-latest: true + go-version: 1.19 - name: Unshallow run: git fetch --prune --unshallow - name: Create release diff --git a/.github/workflows/sims.yml b/.github/workflows/sims.yml index 7c5de4383b3e..77923a6e7003 100644 --- a/.github/workflows/sims.yml +++ b/.github/workflows/sims.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - run: make build @@ -32,7 +32,7 @@ jobs: steps: - uses: actions/setup-go@v2.1.3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - name: Install runsim @@ -49,7 +49,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: technote-space/get-diff-action@v4 @@ -76,7 +76,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: technote-space/get-diff-action@v4 @@ -104,7 +104,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-go@v2.1.3 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: technote-space/get-diff-action@v4 @@ -123,7 +123,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: technote-space/get-diff-action@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e888e72f2e9d..15eccfbc0845 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - name: install tparse @@ -42,7 +42,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v4 id: git_diff with: @@ -73,7 +73,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - name: Display go version run: go version - uses: technote-space/get-diff-action@v4 @@ -133,7 +133,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v4 with: PATTERNS: | @@ -525,7 +525,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v4 with: PATTERNS: | @@ -914,7 +914,7 @@ jobs: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: 1.19 - uses: technote-space/get-diff-action@v4 id: git_diff with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 34239d7d64b0..600ba90de0de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## Improvements +* (deps) Set minimum version to Go 1.19. Go 1.18 is no longer supported by the Go team. +* (deps) Migrate to [CometBFT](https://github.com/cometbft/cometbft). Follow the instructions in the [release notes](./RELEASE_NOTES.md). * (deps) [#15127](https://github.com/cosmos/cosmos-sdk/pull/15127) Bump btcd. * (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. diff --git a/Makefile b/Makefile index fb845cf6cab7..3bd9f8e4849a 100644 --- a/Makefile +++ b/Makefile @@ -402,7 +402,7 @@ proto-check-breaking: @$(DOCKER_BUF) breaking --against $(PR_TARGET_REPO)#branch=$(PR_TARGET_BRANCH) -TM_URL = https://raw.githubusercontent.com/agoric-labs/tendermint/v0.34.23-alpha.agoric.2/proto/tendermint +TM_URL = https://raw.githubusercontent.com/cometbft/cometbft/v0.34.27-alpha.2/proto/tendermint GOGO_PROTO_URL = https://raw.githubusercontent.com/regen-network/protobuf/cosmos COSMOS_PROTO_URL = https://raw.githubusercontent.com/regen-network/cosmos-proto/master CONFIO_URL = https://raw.githubusercontent.com/confio/ics23/v0.7.0 diff --git a/README.md b/README.md index b41c08b845c4..8b3d1a46edd4 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ The Cosmos SDK is a framework for building blockchain applications. [Tendermint **WARNING**: The Cosmos SDK has mostly stabilized, but we are still making some breaking changes. -**Note**: Requires [Go 1.18+](https://golang.org/dl/) +**Note**: Requires [Go 1.19+](https://golang.org/dl/) ## Quick Start diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d0e943bff686..33aabd217f61 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,14 +1,19 @@ -# Cosmos SDK v0.45.14 Release Notes +# Cosmos SDK v0.45.15 Release Notes -This release fixes a possible way to DoS a node. - -**NOTE**: Add or update the following replace in the `go.mod` of your application: +This release includes the migration to CometBFT. This migration should be not breaking. +From `v0.45.15`+, the following replace is *mandatory* in the `go.mod` of your application: ```go -// use informal system fork of tendermint -replace github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 +// use cometbft +replace github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27 ``` +A more complete migration is happening in Cosmos SDK v0.47. + +Additionally, the SDK sets its minimum version to Go 1.19. +This is not because the SDK uses new Go 1.19 functionalities, but because we recommend chains as well to upgrade to Go 1.19 because Go 1.18 is not supported anymore. +We recommend applications to perform a **coordinated upgrade** when migrating from Go 1.18 to Go 1.19. + Please see the [CHANGELOG](https://github.com/cosmos/cosmos-sdk/blob/release/v0.45.x/CHANGELOG.md) for an exhaustive list of changes. -**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.45.13...v0.45.14 +**Full Commit History**: https://github.com/cosmos/cosmos-sdk/compare/v0.45.14...v0.45.15 diff --git a/contrib/images/simd-dlv/Dockerfile b/contrib/images/simd-dlv/Dockerfile index f55463b26e66..14a5c694bf5b 100644 --- a/contrib/images/simd-dlv/Dockerfile +++ b/contrib/images/simd-dlv/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk add build-base git linux-headers libc-dev RUN go install github.com/go-delve/delve/cmd/dlv@latest WORKDIR /work diff --git a/contrib/images/simd-env/Dockerfile b/contrib/images/simd-env/Dockerfile index b83c3b831bac..d001c045194a 100644 --- a/contrib/images/simd-env/Dockerfile +++ b/contrib/images/simd-env/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.18-alpine AS build +FROM golang:1.19-alpine AS build RUN apk add build-base git linux-headers WORKDIR /work COPY go.mod go.sum /work/ diff --git a/go.mod b/go.mod index 7571a18d200f..4dcfe9f4bdb1 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/cosmos/cosmos-sdk -go 1.18 +go 1.19 require ( cosmossdk.io/core v0.5.1 @@ -41,7 +41,7 @@ require ( github.com/spf13/viper v1.14.0 github.com/stretchr/testify v1.8.1 github.com/tendermint/go-amino v0.16.0 - github.com/tendermint/tendermint v0.34.26 + github.com/tendermint/tendermint v0.34.27 github.com/tendermint/tm-db v0.6.6 github.com/tidwall/btree v1.5.0 golang.org/x/crypto v0.5.0 @@ -68,6 +68,7 @@ require ( github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v0.0.0-20220817183557-09c6e030a677 // indirect github.com/cockroachdb/redact v1.1.3 // indirect + github.com/cometbft/cometbft-db v0.7.0 // indirect github.com/cosmos/cosmos-db v0.0.0-20221226095112-f3c38ecb5e32 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.1 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect @@ -153,8 +154,9 @@ replace ( github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.3-alpha.regen.1 github.com/jhump/protoreflect => github.com/jhump/protoreflect v1.9.0 - // use informal system fork of tendermint - github.com/tendermint/tendermint => github.com/informalsystems/tendermint v0.34.26 + + // use cometbft + github.com/tendermint/tendermint => github.com/cometbft/cometbft v0.34.27-alpha.2 // The following is to test committingClient (allowing parallel queries during // write transactions): diff --git a/go.sum b/go.sum index 2d7473ea330f..4d011016b18e 100644 --- a/go.sum +++ b/go.sum @@ -202,6 +202,10 @@ github.com/codegangsta/inject v0.0.0-20150114235600-33e0aa1cb7c0/go.mod h1:4Zcju github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= +github.com/cometbft/cometbft v0.34.27-alpha.2 h1:ERW9qPlaHjshc6BuCAc5yfXcIWuDKAjGLCzJvQQ3YlM= +github.com/cometbft/cometbft v0.34.27-alpha.2/go.mod h1:6tEDwldPfO1ynAd9kx8j808atUVY0jUAJ18l3glfpuM= +github.com/cometbft/cometbft-db v0.7.0 h1:uBjbrBx4QzU0zOEnU8KxoDl18dMNgDh+zZRUE0ucsbo= +github.com/cometbft/cometbft-db v0.7.0/go.mod h1:yiKJIm2WKrt6x8Cyxtq9YTEcIMPcEe4XPxhgX59Fzf0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= github.com/confio/ics23/go v0.9.0/go.mod h1:4LPZ2NYqnYIVRklaozjNR1FScgDJ2s5Xrp+e/mYVRak= github.com/consensys/bavard v0.1.8-0.20210406032232-f3452dc9b572/go.mod h1:Bpd0/3mZuaj6Sj+PqrmIquiOKy397AKGThQPaGzNXAQ= @@ -557,8 +561,6 @@ github.com/influxdata/promql/v2 v2.12.0/go.mod h1:fxOPu+DY0bqCTCECchSRtWfc+0X19y github.com/influxdata/roaring v0.4.13-0.20180809181101-fc520f41fab6/go.mod h1:bSgUQ7q5ZLSO+bKBGqJiCBGAl+9DxyW63zLTujjUlOE= github.com/influxdata/tdigest v0.0.0-20181121200506-bf2b5ad3c0a9/go.mod h1:Js0mqiSBE6Ffsg94weZZ2c+v/ciT8QRHFOap7EKDrR0= github.com/influxdata/usage-client v0.0.0-20160829180054-6d3895376368/go.mod h1:Wbbw6tYNvwa5dlB6304Sd+82Z3f7PmVZHVKU637d4po= -github.com/informalsystems/tendermint v0.34.26 h1:89XvVexAy62geGWxmDmdmmJvfindx+Su2oTuwfSWMeU= -github.com/informalsystems/tendermint v0.34.26/go.mod h1:q3uAZ/t5+MblQhFuHSd4flqaLDx7iUtWpwWbwvHAFhs= github.com/iris-contrib/blackfriday v2.0.0+incompatible/go.mod h1:UzZ2bDEoaSGPbkg6SAB4att1aAwTmVIx/5gCVqeyUdI= github.com/iris-contrib/go.uuid v2.0.0+incompatible/go.mod h1:iz2lgM/1UnEf1kP0L/+fafWORmlnuysV2EMP8MW+qe0= github.com/iris-contrib/i18n v0.0.0-20171121225848-987a633949d0/go.mod h1:pMCz62A0xJL6I+umB2YTlFRwWXaDFA0jy+5HzGiJjqI= diff --git a/server/rollback.go b/server/rollback.go index f39c40cac4ff..1c819e9a1716 100644 --- a/server/rollback.go +++ b/server/rollback.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server/types" "github.com/spf13/cobra" - tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tmcmd "github.com/tendermint/tendermint/cmd/cometbft/commands" ) // NewRollbackCmd creates a command to rollback tendermint and multistore state by one height. diff --git a/server/start.go b/server/start.go index 38b1b972b3ae..3867a0601bda 100644 --- a/server/start.go +++ b/server/start.go @@ -16,7 +16,7 @@ import ( "github.com/spf13/cobra" "github.com/tendermint/tendermint/abci/server" - tcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tcmd "github.com/tendermint/tendermint/cmd/cometbft/commands" tmos "github.com/tendermint/tendermint/libs/os" "github.com/tendermint/tendermint/node" "github.com/tendermint/tendermint/p2p" diff --git a/server/util.go b/server/util.go index 71df7af793d7..ea98ef42dbc4 100644 --- a/server/util.go +++ b/server/util.go @@ -22,7 +22,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - tmcmd "github.com/tendermint/tendermint/cmd/tendermint/commands" + tmcmd "github.com/tendermint/tendermint/cmd/cometbft/commands" tmcfg "github.com/tendermint/tendermint/config" tmlog "github.com/tendermint/tendermint/libs/log" dbm "github.com/tendermint/tm-db" diff --git a/store/rootmulti/snapshot_test.go b/store/rootmulti/snapshot_test.go index 48cd4ff8f4f1..621b471aadf6 100644 --- a/store/rootmulti/snapshot_test.go +++ b/store/rootmulti/snapshot_test.go @@ -128,7 +128,7 @@ func TestMultistoreSnapshot_Checksum(t *testing.T) { "aa048b4ee0f484965d7b3b06822cf0772cdcaad02f3b1b9055e69f2cb365ef3c", "7921eaa3ed4921341e504d9308a9877986a879fe216a099c86e8db66fcba4c63", "a4a864e6c02c9fca5837ec80dc84f650b25276ed7e4820cf7516ced9f9901b86", - "980925390cc50f14998ecb1e87de719ca9dd7e72f5fefbe445397bf670f36c31", + "8ca5b957e36fa13e704c31494649b2a74305148d70d70f0f26dee066b615c1d0", }}, } for _, tc := range testcases { diff --git a/store/snapshots/manager_test.go b/store/snapshots/manager_test.go index 981c1d0a6da3..8c5c107c4597 100644 --- a/store/snapshots/manager_test.go +++ b/store/snapshots/manager_test.go @@ -98,7 +98,7 @@ func TestManager_Take(t *testing.T) { Height: 5, Format: snapshotter.SnapshotFormat(), Chunks: 1, - Hash: []uint8{0xc5, 0xf7, 0xfe, 0xea, 0xd3, 0x4d, 0x3e, 0x87, 0xff, 0x41, 0xa2, 0x27, 0xfa, 0xcb, 0x38, 0x17, 0xa, 0x5, 0xeb, 0x27, 0x4e, 0x16, 0x5e, 0xf3, 0xb2, 0x8b, 0x47, 0xd1, 0xe6, 0x94, 0x7e, 0x8b}, + Hash: []uint8{0x14, 0x38, 0x97, 0x96, 0xba, 0xe4, 0x81, 0xaf, 0x6c, 0xac, 0xff, 0xa5, 0xb8, 0x7e, 0x63, 0x4b, 0xac, 0x69, 0x3f, 0x38, 0x90, 0x5c, 0x7d, 0x57, 0xb3, 0xf, 0x69, 0x73, 0xb3, 0xa0, 0xe0, 0xad}, Metadata: types.Metadata{ ChunkHashes: checksums(expectChunks), },