Skip to content

Commit 309a633

Browse files
prestonvanloonfernantho
authored andcommitted
Update go to 1.24.0 (OffchainLabs#14969)
* Update rules_go to v0.53.0 * Update staticcheck to v0.6.0 * Update to go 1.24.0 * Update github.com/trailofbits/go-mutexasserts to latest * Use rules_go @ cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9 * Provide the go binary to SszGen. bazel-contrib/rules_go#4173 * Unskip SA9003 * Update github ci checks to go1.24.0 * CI: Update gosec to v2.22.1 and golangci to v1..64.5 * Temporarily disable usetesting lint check for go1.24 * gosec: Disable G115 - integer overflow conversion * gosec: Ignore G407 for "hardcoded" IV. It's not hardcoded. * Fix uses of rand.Seed. This is a no-op in go1.24 and deprecated since go1.20. * Changelog fragment
1 parent dc1b433 commit 309a633

File tree

13 files changed

+111
-80
lines changed

13 files changed

+111
-80
lines changed

.github/actions/gomodtidy/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23-alpine
1+
FROM golang:1.24-alpine
22

33
COPY entrypoint.sh /entrypoint.sh
44

.github/workflows/go.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ jobs:
2828
steps:
2929
- name: Checkout
3030
uses: actions/checkout@v4
31-
- name: Set up Go 1.23
31+
- name: Set up Go 1.24
3232
uses: actions/setup-go@v4
3333
with:
34-
go-version: '1.23.5'
34+
go-version: '1.24.0'
3535
- name: Run Gosec Security Scanner
3636
run: | # https://github.com/securego/gosec/issues/469
3737
export PATH=$PATH:$(go env GOPATH)/bin
38-
go install github.com/securego/gosec/v2/cmd/gosec@v2.19.0
39-
gosec -exclude-generated -exclude=G307 -exclude-dir=crypto/bls/herumi ./...
38+
go install github.com/securego/gosec/v2/cmd/gosec@v2.22.1
39+
gosec -exclude-generated -exclude=G307,G115 -exclude-dir=crypto/bls/herumi ./...
4040
4141
lint:
4242
name: Lint
@@ -45,16 +45,16 @@ jobs:
4545
- name: Checkout
4646
uses: actions/checkout@v4
4747

48-
- name: Set up Go 1.23
48+
- name: Set up Go 1.24
4949
uses: actions/setup-go@v4
5050
with:
51-
go-version: '1.23.5'
51+
go-version: '1.24.0'
5252
id: go
5353

5454
- name: Golangci-lint
5555
uses: golangci/golangci-lint-action@v5
5656
with:
57-
version: v1.63.4
57+
version: v1.64.5
5858
args: --config=.golangci.yml --out-${NO_FUTURE}format colored-line-number
5959

6060
build:
@@ -64,7 +64,7 @@ jobs:
6464
- name: Set up Go 1.x
6565
uses: actions/setup-go@v4
6666
with:
67-
go-version: '1.23.5'
67+
go-version: '1.24.0'
6868
id: go
6969

7070
- name: Check out code into the Go module directory

.golangci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ linters:
7575
- tagliatelle
7676
- thelper
7777
- unparam
78+
- usetesting
7879
- varnamelen
7980
- wrapcheck
8081
- wsl

BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ STATICCHECK_ANALYZERS = [
165165
"sa6006",
166166
"sa9001",
167167
"sa9002",
168-
#"sa9003", # Doesn't build. See https://github.com/dominikh/go-tools/pull/1483
168+
"sa9003",
169169
"sa9004",
170170
"sa9005",
171171
"sa9006",

WORKSPACE

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,15 +160,15 @@ oci_register_toolchains(
160160

161161
http_archive(
162162
name = "io_bazel_rules_go",
163+
integrity = "sha256-JD8o94crTb2DFiJJR8nMAGdBAW95zIENB4cbI+JnrI4=",
163164
patch_args = ["-p1"],
164165
patches = [
165166
# Expose internals of go_test for custom build transitions.
166167
"//third_party:io_bazel_rules_go_test.patch",
167168
],
168-
sha256 = "b2038e2de2cace18f032249cb4bb0048abf583a36369fa98f687af1b3f880b26",
169+
strip_prefix = "rules_go-cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9",
169170
urls = [
170-
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
171-
"https://github.com/bazelbuild/rules_go/releases/download/v0.48.1/rules_go-v0.48.1.zip",
171+
"https://github.com/bazel-contrib/rules_go/archive/cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9.tar.gz",
172172
],
173173
)
174174

@@ -210,7 +210,7 @@ load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_depe
210210
go_rules_dependencies()
211211

212212
go_register_toolchains(
213-
go_version = "1.23.5",
213+
go_version = "1.24.0",
214214
nogo = "@//:nogo",
215215
)
216216

@@ -431,7 +431,7 @@ gometalinter_dependencies()
431431

432432
load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
433433

434-
gazelle_dependencies()
434+
gazelle_dependencies(go_sdk = "go_sdk")
435435

436436
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
437437

changelog/pvl_go1.24.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
### Changed
2+
3+
- Updated go to go1.24.0.
4+
- Updated gosec to v2.22.1 and golangci to v1.64.5.
5+
- Updated github.com/trailofbits/go-mutexasserts.
6+
- Updated rules_go to cf3c3af34bd869b864f5f2b98e2f41c2b220d6c9 to support go1.24.0.
7+
8+
### Fixed
9+
10+
- Fixed use of deprecated rand.Seed.
11+
- Fixed build issue with SszGen where the go binary was not present in the $PATH.

crypto/keystore/keystore.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func EncryptKey(key *Key, password string, scryptN, scryptP int) ([]byte, error)
146146
return nil, errors.New("reading from crypto/rand failed: " + err.Error())
147147
}
148148

149-
cipherText, err := aesCTRXOR(encryptKey, keyBytes, iv)
149+
cipherText, err := aesCTRXOR(encryptKey, keyBytes, iv) // #nosec G407
150150
if err != nil {
151151
return nil, err
152152
}

deps.bzl

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ def prysm_deps():
3737
go_repository(
3838
name = "co_honnef_go_tools",
3939
importpath = "honnef.co/go/tools",
40-
sum = "h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I=",
41-
version = "v0.5.1",
40+
sum = "h1:TAODvD3knlq75WCp2nyGJtT4LeRV/o7NN9nYPeVJXf8=",
41+
version = "v0.6.0",
4242
)
4343
go_repository(
4444
name = "com_github_aclements_go_moremath",
@@ -3363,8 +3363,8 @@ def prysm_deps():
33633363
go_repository(
33643364
name = "com_github_trailofbits_go_mutexasserts",
33653365
importpath = "github.com/trailofbits/go-mutexasserts",
3366-
sum = "h1:+LynomhWB+14Plp/bOONEAZCtvCZk4leRbTvNzNVkL0=",
3367-
version = "v0.0.0-20230328101604-8cdbc5f3d279",
3366+
sum = "h1:EBoYk5zHOfuHDBqLFx4eSPRVcbnW+L3aFJzoCi8zRnk=",
3367+
version = "v0.0.0-20250212181730-4c2b8e9e784b",
33683368
)
33693369
go_repository(
33703370
name = "com_github_tyler_smith_go_bip39",
@@ -4739,8 +4739,8 @@ def prysm_deps():
47394739
go_repository(
47404740
name = "org_golang_x_crypto",
47414741
importpath = "golang.org/x/crypto",
4742-
sum = "h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=",
4743-
version = "v0.32.0",
4742+
sum = "h1:IOBPskki6Lysi0lo9qQvbxiQ+FvsCC/YWOecCHAixus=",
4743+
version = "v0.33.0",
47444744
)
47454745
go_repository(
47464746
name = "org_golang_x_exp",
@@ -4775,14 +4775,14 @@ def prysm_deps():
47754775
go_repository(
47764776
name = "org_golang_x_mod",
47774777
importpath = "golang.org/x/mod",
4778-
sum = "h1:D4nJWe9zXqHOmWqj4VMOJhvzj7bEZg4wEYa759z1pH4=",
4779-
version = "v0.22.0",
4778+
sum = "h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=",
4779+
version = "v0.23.0",
47804780
)
47814781
go_repository(
47824782
name = "org_golang_x_net",
47834783
importpath = "golang.org/x/net",
4784-
sum = "h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0=",
4785-
version = "v0.34.0",
4784+
sum = "h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8=",
4785+
version = "v0.35.0",
47864786
)
47874787
go_repository(
47884788
name = "org_golang_x_oauth2",
@@ -4799,14 +4799,14 @@ def prysm_deps():
47994799
go_repository(
48004800
name = "org_golang_x_sync",
48014801
importpath = "golang.org/x/sync",
4802-
sum = "h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ=",
4803-
version = "v0.10.0",
4802+
sum = "h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w=",
4803+
version = "v0.11.0",
48044804
)
48054805
go_repository(
48064806
name = "org_golang_x_sys",
48074807
importpath = "golang.org/x/sys",
4808-
sum = "h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=",
4809-
version = "v0.29.0",
4808+
sum = "h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=",
4809+
version = "v0.30.0",
48104810
)
48114811
go_repository(
48124812
name = "org_golang_x_telemetry",
@@ -4817,14 +4817,14 @@ def prysm_deps():
48174817
go_repository(
48184818
name = "org_golang_x_term",
48194819
importpath = "golang.org/x/term",
4820-
sum = "h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg=",
4821-
version = "v0.28.0",
4820+
sum = "h1:L6pJp37ocefwRRtYPKSWOWzOtWSxVajvz2ldH/xi3iU=",
4821+
version = "v0.29.0",
48224822
)
48234823
go_repository(
48244824
name = "org_golang_x_text",
48254825
importpath = "golang.org/x/text",
4826-
sum = "h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=",
4827-
version = "v0.21.0",
4826+
sum = "h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=",
4827+
version = "v0.22.0",
48284828
)
48294829
go_repository(
48304830
name = "org_golang_x_time",
@@ -4835,8 +4835,8 @@ def prysm_deps():
48354835
go_repository(
48364836
name = "org_golang_x_tools",
48374837
importpath = "golang.org/x/tools",
4838-
sum = "h1:Xx0h3TtM9rzQpQuR4dKLrdglAmCEN5Oi+P74JdhdzXE=",
4839-
version = "v0.29.0",
4838+
sum = "h1:BgcpHewrV5AUp2G9MebG4XPFI1E2W41zU1SaqVA9vJY=",
4839+
version = "v0.30.0",
48404840
)
48414841
go_repository(
48424842
name = "org_golang_x_xerrors",

go.mod

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/prysmaticlabs/prysm/v5
22

3-
go 1.23.5
3+
go 1.24.0
44

55
require (
66
github.com/MariusVanDerWijden/FuzzyVM v0.0.0-20240516070431-7828990cad7d
@@ -71,7 +71,7 @@ require (
7171
github.com/stretchr/testify v1.10.0
7272
github.com/supranational/blst v0.3.14
7373
github.com/thomaso-mirodin/intmath v0.0.0-20160323211736-5dc6d854e46e
74-
github.com/trailofbits/go-mutexasserts v0.0.0-20230328101604-8cdbc5f3d279
74+
github.com/trailofbits/go-mutexasserts v0.0.0-20250212181730-4c2b8e9e784b
7575
github.com/tyler-smith/go-bip39 v1.1.0
7676
github.com/urfave/cli/v2 v2.27.1
7777
github.com/uudashr/gocognit v1.0.5
@@ -87,17 +87,17 @@ require (
8787
go.opentelemetry.io/otel/trace v1.34.0
8888
go.uber.org/automaxprocs v1.5.2
8989
go.uber.org/mock v0.4.0
90-
golang.org/x/crypto v0.32.0
90+
golang.org/x/crypto v0.33.0
9191
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa
92-
golang.org/x/sync v0.10.0
93-
golang.org/x/tools v0.29.0
92+
golang.org/x/sync v0.11.0
93+
golang.org/x/tools v0.30.0
9494
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
9595
google.golang.org/grpc v1.69.4
9696
google.golang.org/protobuf v1.36.3
9797
gopkg.in/d4l3k/messagediff.v1 v1.2.1
9898
gopkg.in/yaml.v2 v2.4.0
9999
gopkg.in/yaml.v3 v3.0.1
100-
honnef.co/go/tools v0.5.1
100+
honnef.co/go/tools v0.6.0
101101
k8s.io/apimachinery v0.30.4
102102
k8s.io/client-go v0.30.4
103103
)
@@ -259,11 +259,11 @@ require (
259259
go.uber.org/multierr v1.11.0 // indirect
260260
go.uber.org/zap v1.27.0 // indirect
261261
golang.org/x/exp/typeparams v0.0.0-20231108232855-2478ac86f678 // indirect
262-
golang.org/x/mod v0.22.0 // indirect
263-
golang.org/x/net v0.34.0 // indirect
262+
golang.org/x/mod v0.23.0 // indirect
263+
golang.org/x/net v0.35.0 // indirect
264264
golang.org/x/oauth2 v0.24.0 // indirect
265-
golang.org/x/term v0.28.0 // indirect
266-
golang.org/x/text v0.21.0 // indirect
265+
golang.org/x/term v0.29.0 // indirect
266+
golang.org/x/text v0.22.0 // indirect
267267
golang.org/x/time v0.5.0 // indirect
268268
gopkg.in/cenkalti/backoff.v1 v1.1.0 // indirect
269269
gopkg.in/inf.v0 v0.9.1 // indirect
@@ -284,7 +284,7 @@ require (
284284
github.com/go-playground/validator/v10 v10.13.0
285285
github.com/peterh/liner v1.2.0 // indirect
286286
github.com/prysmaticlabs/gohashtree v0.0.4-beta.0.20240624100937-73632381301b
287-
golang.org/x/sys v0.29.0 // indirect
287+
golang.org/x/sys v0.30.0 // indirect
288288
k8s.io/klog/v2 v2.120.1 // indirect
289289
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
290290
)

0 commit comments

Comments
 (0)