Skip to content

Commit 1ecddc7

Browse files
authored
Update to go 1.23.6 (#3722)
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
1 parent df1bf8c commit 1ecddc7

File tree

10 files changed

+41
-41
lines changed

10 files changed

+41
-41
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
To start developing on AvalancheGo, you'll need a few things installed.
66

7-
- Golang version >= 1.22.8
7+
- Golang version >= 1.23.6
88
- gcc
99
- g++
1010

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The minimum recommended hardware specification for nodes connected to Mainnet is
2323

2424
If you plan to build AvalancheGo from source, you will also need the following software:
2525

26-
- [Go](https://golang.org/doc/install) version >= 1.22.8
26+
- [Go](https://golang.org/doc/install) version >= 1.23.6
2727
- [gcc](https://gcc.gnu.org/)
2828
- g++
2929

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module github.com/ava-labs/avalanchego
55
// - README.md
66
// - go.mod (here)
77
//
8-
// - If updating between minor versions (e.g. 1.22.x -> 1.23.x):
8+
// - If updating between minor versions (e.g. 1.23.x -> 1.24.x):
99
// - Consider updating the version of golangci-lint (in scripts/lint.sh).
10-
go 1.22.8
10+
go 1.23.6
1111

1212
require (
1313
github.com/DataDog/zstd v1.5.2

utils/hashing/consistent/ring.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,8 @@ func (h *hashRing) get(key Hashable) (Hashable, error) {
213213
// If found nothing ascending the tree, we need to wrap around the ring to
214214
// the left-most (min) node.
215215
if result == nil {
216-
min, _ := h.ring.Min()
217-
result = min.value
216+
minNode, _ := h.ring.Min()
217+
result = minNode.value
218218
}
219219
return result, nil
220220
}

utils/sampler/rand.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ func (r *rng) Uint64Inclusive(n uint64) uint64 {
6161
//
6262
// ref: https://github.com/golang/go/blob/ce10e9d84574112b224eae88dc4e0f43710808de/src/math/rand/rand.go#L127-L132
6363
default:
64-
max := (1 << 63) - 1 - (1<<63)%(n+1)
64+
maximum := (1 << 63) - 1 - (1<<63)%(n+1)
6565
v := r.uint63()
66-
for v > max {
66+
for v > maximum {
6767
v = r.uint63()
6868
}
6969
return v % (n + 1)

utils/sampler/rand_test.go

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -56,91 +56,91 @@ func (s *testSTDSource) Uint64() uint64 {
5656

5757
func TestRNG(t *testing.T) {
5858
tests := []struct {
59-
max uint64
59+
maximum uint64
6060
nums []uint64
6161
expected uint64
6262
}{
6363
{
64-
max: math.MaxUint64,
64+
maximum: math.MaxUint64,
6565
nums: []uint64{
6666
0x01,
6767
},
6868
expected: 0x01,
6969
},
7070
{
71-
max: math.MaxUint64,
71+
maximum: math.MaxUint64,
7272
nums: []uint64{
7373
0x0102030405060708,
7474
},
7575
expected: 0x0102030405060708,
7676
},
7777
{
78-
max: math.MaxUint64,
78+
maximum: math.MaxUint64,
7979
nums: []uint64{
8080
0xF102030405060708,
8181
},
8282
expected: 0xF102030405060708,
8383
},
8484
{
85-
max: math.MaxInt64,
85+
maximum: math.MaxInt64,
8686
nums: []uint64{
8787
0x01,
8888
},
8989
expected: 0x01,
9090
},
9191
{
92-
max: math.MaxInt64,
92+
maximum: math.MaxInt64,
9393
nums: []uint64{
9494
0x0102030405060708,
9595
},
9696
expected: 0x0102030405060708,
9797
},
9898
{
99-
max: math.MaxInt64,
99+
maximum: math.MaxInt64,
100100
nums: []uint64{
101101
0x8102030405060708,
102102
},
103103
expected: 0x0102030405060708,
104104
},
105105
{
106-
max: 15,
106+
maximum: 15,
107107
nums: []uint64{
108108
0x810203040506071a,
109109
},
110110
expected: 0x0a,
111111
},
112112
{
113-
max: math.MaxInt64 + 1,
113+
maximum: math.MaxInt64 + 1,
114114
nums: []uint64{
115115
math.MaxInt64 + 1,
116116
},
117117
expected: math.MaxInt64 + 1,
118118
},
119119
{
120-
max: math.MaxInt64 + 1,
120+
maximum: math.MaxInt64 + 1,
121121
nums: []uint64{
122122
math.MaxInt64 + 2,
123123
0,
124124
},
125125
expected: 0,
126126
},
127127
{
128-
max: math.MaxInt64 + 1,
128+
maximum: math.MaxInt64 + 1,
129129
nums: []uint64{
130130
math.MaxInt64 + 2,
131131
0x0102030405060708,
132132
},
133133
expected: 0x0102030405060708,
134134
},
135135
{
136-
max: 2,
136+
maximum: 2,
137137
nums: []uint64{
138138
math.MaxInt64 - 2,
139139
},
140140
expected: 0x02,
141141
},
142142
{
143-
max: 2,
143+
maximum: 2,
144144
nums: []uint64{
145145
math.MaxInt64 - 1,
146146
0x01,
@@ -157,11 +157,11 @@ func TestRNG(t *testing.T) {
157157
nums: test.nums,
158158
}
159159
r := &rng{rng: source}
160-
val := r.Uint64Inclusive(test.max)
160+
val := r.Uint64Inclusive(test.maximum)
161161
require.Equal(test.expected, val)
162162
require.Empty(source.nums)
163163

164-
if test.max >= math.MaxInt64 {
164+
if test.maximum >= math.MaxInt64 {
165165
return
166166
}
167167

@@ -170,7 +170,7 @@ func TestRNG(t *testing.T) {
170170
nums: test.nums,
171171
}
172172
mathRNG := rand.New(stdSource) //#nosec G404
173-
stdVal := mathRNG.Int63n(int64(test.max + 1))
173+
stdVal := mathRNG.Int63n(int64(test.maximum + 1))
174174
require.Equal(test.expected, uint64(stdVal))
175175
require.Empty(source.nums)
176176
})
@@ -182,12 +182,12 @@ func FuzzRNG(f *testing.F) {
182182
require := require.New(t)
183183

184184
var (
185-
max uint64
185+
maximum uint64
186186
sourceNums []uint64
187187
)
188188
fz := fuzzer.NewFuzzer(data)
189-
fz.Fill(&max, &sourceNums)
190-
if max >= math.MaxInt64 {
189+
fz.Fill(&maximum, &sourceNums)
190+
if maximum >= math.MaxInt64 {
191191
t.SkipNow()
192192
}
193193

@@ -196,14 +196,14 @@ func FuzzRNG(f *testing.F) {
196196
nums: sourceNums,
197197
}
198198
r := &rng{rng: source}
199-
val := r.Uint64Inclusive(max)
199+
val := r.Uint64Inclusive(maximum)
200200

201201
stdSource := &testSTDSource{
202202
onInvalid: t.SkipNow,
203203
nums: sourceNums,
204204
}
205205
mathRNG := rand.New(stdSource) //#nosec G404
206-
stdVal := mathRNG.Int63n(int64(max + 1))
206+
stdVal := mathRNG.Int63n(int64(maximum + 1))
207207
require.Equal(val, uint64(stdVal))
208208
require.Len(stdSource.nums, len(source.nums))
209209
})

utils/ulimit/ulimit_bsd.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ const DefaultFDLimit = 32 * 1024
2323
// privileges. Bumping the Max limit further would require superuser privileges.
2424
// If the value is below the recommendation warn on start.
2525
// see: http://0pointer.net/blog/file-descriptor-limits.html
26-
func Set(max uint64, log logging.Logger) error {
26+
func Set(limit uint64, log logging.Logger) error {
2727
// Note: BSD Rlimit is type int64
2828
// ref: https://cs.opensource.google/go/x/sys/+/b874c991:unix/ztypes_freebsd_amd64.go
29-
bsdMax := int64(max)
29+
bsdMax := int64(limit)
3030
var rLimit syscall.Rlimit
3131
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
3232
if err != nil {

utils/ulimit/ulimit_darwin.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const DefaultFDLimit = 10 * 1024
2323
// privileges. Bumping the Max limit further would require superuser privileges.
2424
// If the value is below the recommendation warn on start.
2525
// see: http://0pointer.net/blog/file-descriptor-limits.html
26-
func Set(max uint64, log logging.Logger) error {
26+
func Set(limit uint64, log logging.Logger) error {
2727
var rLimit syscall.Rlimit
2828
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
2929
if err != nil {
@@ -34,11 +34,11 @@ func Set(max uint64, log logging.Logger) error {
3434
// The max file limit is 10240, even though the max returned by
3535
// Getrlimit is 1<<63-1. This is OPEN_MAX in sys/syslimits.h.
3636
// See https://github.com/golang/go/issues/30401
37-
if max > DefaultFDLimit {
38-
return fmt.Errorf("error fd-limit: (%d) greater than max: (%d)", max, DefaultFDLimit)
37+
if limit > DefaultFDLimit {
38+
return fmt.Errorf("error fd-limit: (%d) greater than max: (%d)", limit, DefaultFDLimit)
3939
}
4040

41-
rLimit.Cur = max
41+
rLimit.Cur = limit
4242

4343
// set new limit
4444
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {

utils/ulimit/ulimit_unix.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,18 @@ const DefaultFDLimit = 32 * 1024
2323
// privileges. Bumping the Max limit further would require superuser privileges.
2424
// If the current Max is below our recommendation we will warn on start.
2525
// see: http://0pointer.net/blog/file-descriptor-limits.html
26-
func Set(max uint64, log logging.Logger) error {
26+
func Set(limit uint64, log logging.Logger) error {
2727
var rLimit syscall.Rlimit
2828
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, &rLimit)
2929
if err != nil {
3030
return fmt.Errorf("error getting rlimit: %w", err)
3131
}
3232

33-
if max > rLimit.Max {
34-
return fmt.Errorf("error fd-limit: (%d) greater than max: (%d)", max, rLimit.Max)
33+
if limit > rLimit.Max {
34+
return fmt.Errorf("error fd-limit: (%d) greater than max: (%d)", limit, rLimit.Max)
3535
}
3636

37-
rLimit.Cur = max
37+
rLimit.Cur = limit
3838

3939
// set new limit
4040
if err := syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit); err != nil {

utils/ulimit/ulimit_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import "github.com/ava-labs/avalanchego/utils/logging"
1111
const DefaultFDLimit = 16384
1212

1313
// Set is a no-op for windows and will warn if the default is not used.
14-
func Set(max uint64, log logging.Logger) error {
15-
if max != DefaultFDLimit {
14+
func Set(limit uint64, log logging.Logger) error {
15+
if limit != DefaultFDLimit {
1616
log.Warn("fd-limit is not supported for windows")
1717
}
1818
return nil

0 commit comments

Comments
 (0)