From 2eee8d5a316eec6cf66067de23db98e1af3dab2e Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 8 Sep 2025 22:59:10 +0300 Subject: [PATCH 1/4] go.mod: upgrade min Go to 1.24, fix #144 Signed-off-by: Roman Khimov --- .github/workflows/build.yml | 2 +- .github/workflows/go.yml | 10 +++++----- CHANGELOG.md | 1 + go.mod | 2 +- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 33bea7e8..c33c8d1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,7 +35,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: '1.24' + go-version: '1.25' cache: true - name: Run simulation diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index a0b4a4a8..a0d50567 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -20,17 +20,17 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - go: [ '1.23', '1.24'] + go: [ '1.24', '1.25'] os: [ubuntu-latest, windows-2022, macos-14] exclude: # Only latest Go version for Windows and MacOS. - os: windows-2022 - go: '1.23' + go: '1.24' - os: macos-14 - go: '1.23' + go: '1.24' # Exclude latest Go version for Ubuntu as Coverage uses it. - os: ubuntu-latest - go: '1.24' + go: '1.25' steps: - name: Setup go @@ -52,7 +52,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: 1.24 + go-version: 1.25 - name: Check out uses: actions/checkout@v4 diff --git a/CHANGELOG.md b/CHANGELOG.md index 75b23fe7..48c8ab9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ New features: Behaviour changes: Improvements: + * minimum required Go version is 1.24 (#144) Bugs fixed: diff --git a/go.mod b/go.mod index 789d0548..33487e6d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/nspcc-dev/dbft -go 1.23 +go 1.24 require ( github.com/stretchr/testify v1.9.0 From 30289deb4838e74b2687ec9cec0bb80599dc616b Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 8 Sep 2025 23:00:20 +0300 Subject: [PATCH 2/4] CHANGELOG: fix spacing error Signed-off-by: Roman Khimov --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c8ab9a..50a8717d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -81,7 +81,7 @@ Improvements: * add Commit message verification callback (#134) Bugs fixed: - * context-bound PreBlock and PreHeader are not reset properly (#127) + * context-bound PreBlock and PreHeader are not reset properly (#127) * PreHeader is constructed instead of PreBlock to create PreCommit message (#128) * enable anti-MEV extension with respect to the current block index (#132) * (*Context).PreBlock() method returns PreHeader instead of PreBlock (#133) From 07e2e2634173d72cb1f2dcb0aef31bd2ec44e986 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 8 Sep 2025 23:00:52 +0300 Subject: [PATCH 3/4] *: rand.Read never fails with Go 1.24 Signed-off-by: Roman Khimov --- context.go | 5 +---- internal/consensus/message_test.go | 3 +-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/context.go b/context.go index f161887a..28918446 100644 --- a/context.go +++ b/context.go @@ -322,10 +322,7 @@ func (c *Context[H]) Fill(force bool) bool { } b := make([]byte, 8) - _, err := rand.Read(b) - if err != nil { - panic(err) - } + _, _ = rand.Read(b) c.Nonce = binary.LittleEndian.Uint64(b) c.TransactionHashes = make([]H, len(txx)) diff --git a/internal/consensus/message_test.go b/internal/consensus/message_test.go index c35cb1b5..f4bad7c2 100644 --- a/internal/consensus/message_test.go +++ b/internal/consensus/message_test.go @@ -202,6 +202,5 @@ func testMarshalUnmarshal(t *testing.T, expected, actual *Payload) { } func fillRandom(t *testing.T, arr []byte) { - _, err := rand.Read(arr) - require.NoError(t, err) + _, _ = rand.Read(arr) } From aa9abbd44182832ffbe7962371ed1e0c54cc2c2d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 8 Sep 2025 23:02:44 +0300 Subject: [PATCH 4/4] go.mod: upgrade github.com/stretchr/testify to v1.11.1 Signed-off-by: Roman Khimov --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 33487e6d..e3d5cf0e 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/nspcc-dev/dbft go 1.24 require ( - github.com/stretchr/testify v1.9.0 + github.com/stretchr/testify v1.11.1 go.uber.org/zap v1.27.0 ) diff --git a/go.sum b/go.sum index af4ca60f..92630fbd 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= -github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.10.0 h1:S0h4aNzvfcFsC3dRF1jLoaov7oRaKqRGC/pUEJ2yvPQ=