Skip to content

Commit

Permalink
build(deps): Bump minimum Go version to v1.23 (#4041)
Browse files Browse the repository at this point in the history
Closes #4039 

cometbft-db PR: cometbft/cometbft-db#194

---

#### PR checklist

- [ ] ~~Tests written/updated~~
- [x] Changelog entry added in `.changelog` (we use
[unclog](https://github.com/informalsystems/unclog) to manage our
changelog)
- [x] Updated relevant documentation (`docs/` or `spec/`) and code
comments

---------

Co-authored-by: Andy Nogueira <[email protected]>
  • Loading branch information
melekes and andynog authored Sep 11, 2024
1 parent 580b923 commit ff34f75
Show file tree
Hide file tree
Showing 18 changed files with 61 additions and 70 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- `[go/runtime]` Bump minimum Go version to v1.23
([\#4039](https://github.com/cometbft/cometbft/issues/4039))
2 changes: 1 addition & 1 deletion .github/workflows/go-version.env
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# .github/workflows/go-version.env
GO_VERSION=1.22.7
GO_VERSION=1.23.1
2 changes: 1 addition & 1 deletion DOCKER/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Use a build arg to ensure that both stages use the same,
# hopefully current, go version.
ARG GOLANG_BASE_IMAGE=golang:1.22.7-alpine
ARG GOLANG_BASE_IMAGE=golang:1.23.1-alpine

# stage 1 Generate CometBFT Binary
FROM --platform=$BUILDPLATFORM $GOLANG_BASE_IMAGE as builder

Check warning on line 6 in DOCKER/Dockerfile

View workflow job for this annotation

GitHub Actions / build

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ Please see [SECURITY.md](./SECURITY.md).

| CometBFT version | Requirement | Version | Tested with |
|------------------|-------------|----------------|--------------|
| main | Go version | 1.22 or higher | up to 1.22.5 |
| v1.x | Go version | 1.22 or higher | up to 1.22 |
| v0.38.x | Go version | 1.21 or higher | up to 1.22 |
| v0.37.x | Go version | 1.20 or higher | up to 1.22 |
| v0.34.x | Go version | 1.20 or higher | up to 1.20 |
| main | Go version | 1.23 or higher | up to 1.23.1 |
| v1.x | Go version | 1.23 or higher | up to 1.23.1 |
| v0.38.x | Go version | 1.22 or higher | up to 1.22 |
| v0.37.x | Go version | 1.22 or higher | up to 1.22 |
| v0.34.x | Go version | 1.22 or higher | up to 1.22 |

### Install

Expand Down
4 changes: 2 additions & 2 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ versioning:

### Building CometBFT

The minimum Go version has been bumped to [v1.22][go122].
The minimum Go version has been bumped to [v1.23][go123].

### Proposer-Based Timestamps

Expand Down Expand Up @@ -398,5 +398,5 @@ please see the [Tendermint Core upgrading instructions][tmupgrade].
[discussions]: https://github.com/cometbft/cometbft/discussions
[tmupgrade]: https://github.com/tendermint/tendermint/blob/35581cf54ec436b8c37fabb43fdaa3f48339a170/UPGRADING.md
[go120]: https://go.dev/blog/go1.20
[go122]: https://go.dev/blog/go1.22
[go123]: https://go.dev/blog/go1.23
[pbts-spec]: ./spec/consensus/proposer-based-timestamp/README.md
2 changes: 1 addition & 1 deletion api/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/cometbft/cometbft/api

go 1.22
go 1.23.1

require (
github.com/cosmos/gogoproto v1.4.12
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/go-built-in.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ have installed and the computer platform):

```bash
$ go version
go version go1.22.5 darwin/amd64
go version go1.23.1 darwin/amd64

```

Expand Down Expand Up @@ -122,7 +122,7 @@ go: to add module requirements and sums:
go mod tidy
```

go 1.22.5
go 1.23.1
Now, lets add `cometbft` as a dependency to our project. Run the `go get` command below:

```bash
Expand All @@ -143,7 +143,7 @@ The go.mod file should look similar to:
```go
module kvstore

go 1.22.5
go 1.23.1

require github.com/cometbft/cometbft v1.0.0 // indirect
```
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Verify that you have the latest version of Go installed (refer to the [official

```bash
$ go version
go version go1.22.2 darwin/amd64
go version go1.23.1 darwin/amd64
```

## 1.1 Installing CometBFT
Expand Down Expand Up @@ -137,7 +137,7 @@ The go.mod file should look similar to:
```go
module kvstore
go 1.22.5
go 1.23.1
require github.com/cometbft/cometbft v1.0.0 // indirect
Expand Down
54 changes: 24 additions & 30 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
module github.com/cometbft/cometbft

go 1.22.5

toolchain go1.22.7
go 1.23.1

require (
github.com/BurntSushi/toml v1.4.0
github.com/Masterminds/semver/v3 v3.3.0
github.com/adlio/schema v1.3.6
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.6
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
github.com/cometbft/cometbft-db v0.15.0
github.com/cometbft/cometbft-load-test v0.3.0
github.com/cometbft/cometbft/api v1.0.0-rc.1
github.com/cosmos/gogoproto v1.7.0
github.com/creachadair/atomicfile v0.3.5
github.com/creachadair/tomledit v0.0.26
github.com/dgraph-io/badger/v4 v4.3.0
github.com/fortytw2/leaktest v1.3.0
github.com/go-git/go-git/v5 v5.12.0
github.com/go-kit/kit v0.13.0
github.com/go-kit/log v0.2.1
github.com/go-logfmt/logfmt v0.6.0
github.com/goccmack/goutil v1.2.3
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/orderedcode v0.0.1
github.com/google/uuid v1.6.0
github.com/gorilla/websocket v1.5.3
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/lib/pq v1.10.9
github.com/minio/highwayhash v1.0.3
github.com/mitchellh/mapstructure v1.5.0
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae
github.com/ory/dockertest v3.3.5+incompatible
github.com/pelletier/go-toml/v2 v2.2.3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.20.3
github.com/prometheus/client_model v0.6.1
Expand All @@ -31,34 +44,15 @@ require (
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.27.0
golang.org/x/net v0.29.0
google.golang.org/grpc v1.66.0
)

require github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7

require (
github.com/Masterminds/semver/v3 v3.3.0
github.com/btcsuite/btcd/btcec/v2 v2.3.4
github.com/btcsuite/btcd/btcutil v1.1.6
github.com/cometbft/cometbft-db v0.14.0
github.com/cometbft/cometbft-load-test v0.3.0
github.com/cometbft/cometbft/api v1.0.0-rc.1
github.com/cosmos/gogoproto v1.7.0
github.com/dgraph-io/badger/v4 v4.3.0
github.com/go-git/go-git/v5 v5.12.0
github.com/goccmack/goutil v1.2.3
github.com/google/uuid v1.6.0
github.com/hashicorp/golang-lru/v2 v2.0.7
github.com/mitchellh/mapstructure v1.5.0
github.com/oasisprotocol/curve25519-voi v0.0.0-20220708102147-0a8a51822cae
github.com/pelletier/go-toml/v2 v2.2.3
github.com/supranational/blst v0.3.13
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7
golang.org/x/crypto v0.27.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
golang.org/x/net v0.29.0
golang.org/x/sync v0.8.0
golang.org/x/text v0.18.0
gonum.org/v1/gonum v0.15.1
google.golang.org/grpc v1.66.0
google.golang.org/protobuf v1.34.2
)

Expand All @@ -75,7 +69,7 @@ require (
github.com/cockroachdb/errors v1.11.3 // indirect
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/pebble v1.1.1 // indirect
github.com/cockroachdb/pebble v1.1.2 // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect
github.com/containerd/continuity v0.3.0 // indirect
Expand All @@ -96,7 +90,7 @@ require (
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/btree v1.1.2 // indirect
github.com/google/btree v1.1.3 // indirect
github.com/google/flatbuffers v2.0.8+incompatible // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/gotestyourself/gotestyourself v2.2.0+incompatible // indirect
Expand All @@ -109,7 +103,7 @@ require (
github.com/klauspost/compress v1.17.9 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/linxGnu/grocksdb v1.9.3 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
Expand All @@ -134,7 +128,7 @@ require (
github.com/stretchr/objx v0.5.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.etcd.io/bbolt v1.3.10 // indirect
go.etcd.io/bbolt v1.3.11 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/mod v0.17.0 // indirect
Expand Down
20 changes: 10 additions & 10 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce h1:giXvy4KSc/6g/e
github.com/cockroachdb/fifo v0.0.0-20240606204812-0bbfbd93a7ce/go.mod h1:9/y3cnZ5GKakj/H4y9r9GTjCvAFta7KLgSHPJJYc52M=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE=
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs=
github.com/cockroachdb/pebble v1.1.1 h1:XnKU22oiCLy2Xn8vp1re67cXg4SAasg/WDt1NtcRFaw=
github.com/cockroachdb/pebble v1.1.1/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU=
github.com/cockroachdb/pebble v1.1.2 h1:CUh2IPtR4swHlEj48Rhfzw6l/d0qA31fItcIszQVIsA=
github.com/cockroachdb/pebble v1.1.2/go.mod h1:4exszw1r40423ZsmkG/09AFEG83I0uDgfujJdbL6kYU=
github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30=
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
github.com/cometbft/cometbft-db v0.14.0 h1:dKnK/tQL8BwciH6SgFEuZxwKupMokR4NlwYfJWy7C48=
github.com/cometbft/cometbft-db v0.14.0/go.mod h1:JOXKwjrxS/MW5qJ1xuVpELa8HGBVgHpgI+t8j0L0JEo=
github.com/cometbft/cometbft-db v0.15.0 h1:VLtsRt8udD4jHCyjvrsTBpgz83qne5hnL245AcPJVRk=
github.com/cometbft/cometbft-db v0.15.0/go.mod h1:EBrFs1GDRiTqrWXYi4v90Awf/gcdD5ExzdPbg4X8+mk=
github.com/cometbft/cometbft-load-test v0.3.0 h1:z6iZZvFwhci29ca/EZQaWh/d92NLe8bK4eBvFyv2EKY=
github.com/cometbft/cometbft-load-test v0.3.0/go.mod h1:zKrQpRm3Ay5+RfeRTNWoLniFJNIPnw9JPEM1wuWS3TA=
github.com/cometbft/cometbft/api v1.0.0-rc.1 h1:GtdXwDGlqwHYs16A4egjwylfYOMYyEacLBrs3Zvpt7g=
Expand Down Expand Up @@ -201,8 +201,8 @@ github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM=
github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU=
github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/btree v1.1.3 h1:CVpQJjYgC4VbzxeGVHfvZrv1ctoYCAI8vbl07Fcxlyg=
github.com/google/btree v1.1.3/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4=
github.com/google/flatbuffers v2.0.8+incompatible h1:ivUb1cGomAB101ZM1T0nOiWz9pSrTMoa9+EiY7igmkM=
github.com/google/flatbuffers v2.0.8+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
Expand Down Expand Up @@ -260,8 +260,8 @@ github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0
github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ=
github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA=
github.com/linxGnu/grocksdb v1.9.3 h1:s1cbPcOd0cU2SKXRG1nEqCOWYAELQjdqg3RVI2MH9ik=
github.com/linxGnu/grocksdb v1.9.3/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA=
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0=
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
Expand Down Expand Up @@ -388,8 +388,8 @@ github.com/xeipuuv/gojsonschema v1.2.0/go.mod h1:anYRn/JVcOK2ZgGU+IjEV4nwlhoK5sQ
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.etcd.io/bbolt v1.3.10 h1:+BqfJTcCzTItrop8mq/lbzL8wSGtj94UO/3U31shqG0=
go.etcd.io/bbolt v1.3.10/go.mod h1:bK3UQLPJZly7IlNmV7uVHJDxfe5aK9Ll93e/74Y9oEQ=
go.etcd.io/bbolt v1.3.11 h1:yGEzV1wPz2yVCLsD8ZAiGHhHVlczyC9d1rP43/VCRJ0=
go.etcd.io/bbolt v1.3.11/go.mod h1:dksAq7YMXoljX0xu6VF5DMZGbhYYoLUalEiSySYAS4I=
go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0=
go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo=
go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0=
Expand Down
2 changes: 1 addition & 1 deletion go.work
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
go 1.22.7
go 1.23.1

use (
.
Expand Down
4 changes: 1 addition & 3 deletions internal/blocksync/pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,7 @@ OUTER_LOOP:
// If the second peer was just set, reset the retryTimer to give the
// second peer a chance to respond.
if picked := bpr.pickSecondPeerAndSendRequest(); picked {
if !retryTimer.Stop() { //nolint:revive // suppress max-control-nesting linter
<-retryTimer.C
}
_ = retryTimer.Stop()
retryTimer.Reset(requestRetrySeconds * time.Second)
}
}
Expand Down
7 changes: 2 additions & 5 deletions internal/consensus/ticker.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/cometbft/cometbft/libs/service"
)

var tickTockBufferSize = 10
const tickTockBufferSize = 10

// TimeoutTicker is a timer that schedules timeouts
// conditional on the height/round/step in the timeoutInfo.
Expand Down Expand Up @@ -81,10 +81,7 @@ func (t *timeoutTicker) stopTimer() {
if !t.timerActive {
return
}
// Stop() returns false if it was already fired or was stopped
if !t.timer.Stop() {
<-t.timer.C
}
_ = t.timer.Stop()
t.timerActive = false
}

Expand Down
4 changes: 3 additions & 1 deletion internal/consensus/wal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const (
)

func TestWALTruncate(t *testing.T) {
const numBlocks = 60

walDir, err := os.MkdirTemp("", "wal")
require.NoError(t, err)
defer os.RemoveAll(walDir)
Expand Down Expand Up @@ -63,7 +65,7 @@ func TestWALTruncate(t *testing.T) {
// 60 block's size nearly 70K, greater than group's headBuf size(4096 * 10),
// when headBuf is full, truncate content will Flush to the file. at this
// time, RotateFile is called, truncate content exist in each file.
err = WALGenerateNBlocks(t, wal.Group(), 60, getConfig(t))
err = WALGenerateNBlocks(t, wal.Group(), numBlocks, getConfig(t))
require.NoError(t, err)

time.Sleep(1 * time.Millisecond) // wait groupCheckDuration, make sure RotateFile run
Expand Down
2 changes: 1 addition & 1 deletion test/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.22.7
FROM golang:1.23.1

# Grab deps (jq, hexdump, xxd, killall)
RUN apt-get update && \
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# We need to build in a Linux environment to support C libraries, e.g. RocksDB.
# We use Debian instead of Alpine, so that we can use binary database packages
# instead of spending time compiling them.
FROM cometbft/cometbft-db-testing:v0.14.1
FROM cometbft/cometbft-db-testing:v0.15.0

RUN apt-get -qq update -y && apt-get -qq upgrade -y >/dev/null

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/docker/Dockerfile.debug
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# We need to build in a Linux environment to support C libraries, e.g. RocksDB.
# We use Debian instead of Alpine, so that we can use binary database packages
# instead of spending time compiling them.
FROM cometbft/cometbft-db-testing:v0.14.1
FROM cometbft/cometbft-db-testing:v0.15.0

RUN apt-get -qq update -y && apt-get -qq upgrade -y >/dev/null
RUN apt-get -qq install -y zsh vim >/dev/null
Expand Down

0 comments on commit ff34f75

Please sign in to comment.