From 0e02be38fc46a07fe50833582b622914e7ea6994 Mon Sep 17 00:00:00 2001 From: lklimek <842586+lklimek@users.noreply.github.com> Date: Thu, 14 Dec 2023 11:38:09 +0100 Subject: [PATCH] build(deps): update golang to 1.21 (#716) * build(deps): bump go to 1.21 * build: bump golangci-lint and golangci-lint-action --- .github/actions/bls/action.yml | 2 +- .github/workflows/build.yml | 6 +++--- .github/workflows/check-generated.yml | 4 ++-- .github/workflows/e2e.yml | 2 +- .github/workflows/lint.yml | 6 +++--- .github/workflows/release.yml | 4 ++-- .github/workflows/tests.yml | 2 +- DOCKER/Dockerfile | 2 +- docs/tutorials/go-built-in.md | 8 ++++++-- docs/tutorials/go.md | 2 +- go.mod | 4 ++-- test/e2e/docker/Dockerfile | 2 +- test/fuzz/README.md | 2 +- 13 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/actions/bls/action.yml b/.github/actions/bls/action.yml index 4fa4f2ca38..89137c285c 100644 --- a/.github/actions/bls/action.yml +++ b/.github/actions/bls/action.yml @@ -15,7 +15,7 @@ runs: steps: - uses: actions/setup-go@v2 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v2 with: submodules: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1506729da8..0654267eda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: @@ -54,7 +54,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: @@ -79,7 +79,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index dbd930dedf..3cacbf21f6 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v4 @@ -49,7 +49,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v4 with: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 0c7fa3e7b1..27b8f79ca1 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.0.0 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index f29584422f..bbea7ff9df 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -30,7 +30,7 @@ jobs: submodules: true - uses: actions/setup-go@v5.0.0 with: - go-version: "^1.19" + go-version: "^1.21" - uses: technote-space/get-diff-action@v6 with: PATTERNS: | @@ -45,12 +45,12 @@ jobs: name: Install BLS library if: "env.GIT_DIFF != ''" - - uses: golangci/golangci-lint-action@v3.4.0 + - uses: golangci/golangci-lint-action@v3.7.0 with: # Required: the version of golangci-lint is required and # must be specified without patch version: we always use the # latest patch version. - version: v1.46 + version: v1.55 args: --timeout 10m github-token: ${{ secrets.github_token }} if: env.GIT_DIFF diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5c703beb3..8c3c4e4bd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,14 +14,14 @@ jobs: - uses: actions/setup-go@v5.0.0 with: - go-version: '1.19' + go-version: "1.21" - name: Build uses: goreleaser/goreleaser-action@v5 if: ${{ github.event_name == 'pull_request' }} with: version: latest - args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run + args: build --skip-validate # skip validate skips initial sanity checks in order to be able to fully run - run: echo https://github.com/tendermint/tendermint/blob/${GITHUB_REF#refs/tags/}/CHANGELOG.md#${GITHUB_REF#refs/tags/} > ../release_notes.md diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9dbcce3faf..6660932e42 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.0 with: - go-version: "1.19" + go-version: "1.21" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index 10f46d8c0f..e030327fa2 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -5,7 +5,7 @@ # * image - creates final image of minimal size ARG ALIPNE_VERSION=3.17 -ARG GOLANG_VERSION=1.19 +ARG GOLANG_VERSION=1.21 ################################# # STAGE 1: install dependencies # ################################# diff --git a/docs/tutorials/go-built-in.md b/docs/tutorials/go-built-in.md index 380ada0a72..8ef441d827 100644 --- a/docs/tutorials/go-built-in.md +++ b/docs/tutorials/go-built-in.md @@ -43,10 +43,11 @@ Verify that you have the latest version of Go installed: ```sh $ go version -go version go1.19.x darwin/amd64 +go version go1.21.x darwin/amd64 ``` Note that the exact patch number may differ as Go releases come out. + ## 1.2 Creating a new Go project We'll start by creating a new Go project. First, initialize the project folder with `go mod init`. Running this command should create the `go.mod` file. @@ -270,6 +271,7 @@ func (app *KVStoreApplication) DeliverTx(req abcitypes.RequestDeliverTx) abcityp return abcitypes.ResponseDeliverTx{Code: 0} } ``` + Note that we check the validity of the transaction _again_ during `DeliverTx`. Transactions are not guaranteed to be valid when they are delivered to an application. This can happen if the application state is used to determine transaction @@ -300,6 +302,7 @@ func (app *KVStoreApplication) Commit() abcitypes.ResponseCommit { "github.com/dgraph-io/badger/v3" abcitypes "github.com/tendermint/tendermint/abci/types" ) + ``` You may have noticed that the application we are writing will _crash_ if it receives an @@ -493,6 +496,7 @@ Next, we create a database handle and use it to construct our ABCI application: ``` Then we construct a logger: + ```go ... logger := tmlog.MustNewDefaultLogger(tmlog.LogFormatPlain, tmlog.LogLevelInfo, false) @@ -592,7 +596,7 @@ This will populate the `go.mod` with a release number followed by a hash for Ten ```go module github.com//kvstore -go 1.19 +go 1.21 require ( github.com/dgraph-io/badger/v3 v3.2103.2 diff --git a/docs/tutorials/go.md b/docs/tutorials/go.md index 7524a14b52..aebe066ab0 100644 --- a/docs/tutorials/go.md +++ b/docs/tutorials/go.md @@ -454,7 +454,7 @@ This will populate the `go.mod` with a release number followed by a hash for Ten ```go module github.com//kvstore -go 1.19 +go 1.21 require ( github.com/dgraph-io/badger/v3 v3.2103.2 diff --git a/go.mod b/go.mod index e74beaf565..881c98ec28 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dashpay/tenderdash -go 1.19 +go 1.21 require ( github.com/BurntSushi/toml v1.2.0 @@ -18,7 +18,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.2 github.com/golang/snappy v0.0.4 // indirect - github.com/golangci/golangci-lint v1.48.0 + github.com/golangci/golangci-lint v1.55.0 github.com/google/btree v1.1.2 // indirect github.com/google/gopacket v1.1.19 github.com/google/orderedcode v0.0.1 diff --git a/test/e2e/docker/Dockerfile b/test/e2e/docker/Dockerfile index 44d2e2c9f1..170f69e989 100644 --- a/test/e2e/docker/Dockerfile +++ b/test/e2e/docker/Dockerfile @@ -1,6 +1,6 @@ ## Stage 1 and 2 is copied from /DOCKER/Dockerfile ARG ALIPNE_VERSION=3.17 -ARG GOLANG_VERSION=1.19 +ARG GOLANG_VERSION=1.21 ################################# # STAGE 1: install dependencies # ################################# diff --git a/test/fuzz/README.md b/test/fuzz/README.md index c75373cf64..b43dd8041f 100644 --- a/test/fuzz/README.md +++ b/test/fuzz/README.md @@ -1,7 +1,7 @@ # fuzz Fuzzing for various packages in Tendermint using the fuzzing infrastructure included in -Go 1.19. +Go 1.21. Inputs: