Skip to content

Commit a6a3d33

Browse files
darioushholimanMariusVanDerWijdenqdm12richardpringle
authored
chore: Bump avalanchego to master (#1443)
Co-authored-by: Martin HS <[email protected]> Co-authored-by: Marius van der Wijden <[email protected]> Co-authored-by: Quentin McGaw <[email protected]> Co-authored-by: Richard Pringle <[email protected]> Co-authored-by: Ceyhun Onur <[email protected]> Co-authored-by: Tsachi Herman <[email protected]>
1 parent b049381 commit a6a3d33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+133
-128
lines changed

.github/workflows/bench.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v4
1212
- uses: actions/setup-go@v4
1313
with:
14-
go-version: "~1.22.8"
14+
go-version: "~1.23.6"
1515
- run: go mod download
1616
shell: bash
1717
- run: ./scripts/build_bench_precompiles.sh

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
- name: Set up Go
2525
uses: actions/setup-go@v5
2626
with:
27-
go-version: "~1.22.8"
27+
go-version: "~1.23.6"
2828
- name: Set up arm64 cross compiler
2929
run: |
3030
sudo apt-get -y update

.github/workflows/tests.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
pull_request:
1010

1111
env:
12-
min_go_version: "~1.22.8"
12+
min_go_version: "~1.23.6"
1313

1414
jobs:
1515
lint_test:
@@ -25,7 +25,7 @@ jobs:
2525
- name: golangci-lint
2626
uses: golangci/golangci-lint-action@v3
2727
with:
28-
version: v1.56
28+
version: v1.63
2929
working-directory: .
3030
args: --timeout 10m
3131
skip-pkg-cache: true

.golangci.yml

+11-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@
33
run:
44
timeout: 10m
55
tests: true
6-
# default is true. Enables skipping of directories:
7-
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
8-
skip-dirs-use-default: true
9-
# Include non-test files tagged as test-only.
10-
# Context: https://github.com/ava-labs/avalanchego/pull/3173
116

127
linters:
138
disable-all: true
@@ -18,8 +13,19 @@ linters:
1813
- ineffassign
1914
- misspell
2015
- unconvert
16+
- typecheck
2117
- unused
18+
# - staticcheck
19+
- bidichk
20+
- durationcheck
21+
- copyloopvar
2222
- whitespace
23+
# - revive # only certain checks enabled
24+
- durationcheck
25+
- gocheckcompilerdirectives
26+
- reassign
27+
- mirror
28+
- tenv
2329

2430
linters-settings:
2531
gofmt:

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
ARG AVALANCHEGO_NODE_IMAGE
66

77
# ============= Compilation Stage ================
8-
FROM --platform=$BUILDPLATFORM golang:1.22.8-bullseye AS builder
8+
FROM --platform=$BUILDPLATFORM golang:1.23.6-bullseye AS builder
99

1010
WORKDIR /build
1111

@@ -14,7 +14,7 @@ WORKDIR /build
1414
COPY go.mod go.sum avalanchego* ./
1515

1616
# Download avalanche dependencies using go mod
17-
RUN go mod download && go mod tidy -compat=1.22
17+
RUN go mod download && go mod tidy -compat=1.23
1818

1919
# Copy the code into the container
2020
COPY . .

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To support these changes, there have been a number of changes to the SubnetEVM b
5959

6060
### Clone Subnet-evm
6161

62-
First install Go 1.22.8 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
62+
First install Go 1.23.6 or later. Follow the instructions [here](https://go.dev/doc/install). You can verify by running `go version`.
6363

6464
Set `$GOPATH` environment variable properly for Go to look for Go Workspaces. Please read [this](https://go.dev/doc/code) for details. You can verify by running `echo $GOPATH`.
6565

RELEASES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Release Notes
22

33
## Pending Release
4-
4+
* Bump golang version to v1.23.6
5+
* Bump golangci-lint to v1.63 and add linters
56
* Refactored trie_prefetcher.go to be structurally similar to upstream.
67
* Remove legacy gossip handler and metrics
78

accounts/abi/abi_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,6 @@ func TestUnpackRevert(t *testing.T) {
12101210
{"4e487b7100000000000000000000000000000000000000000000000000000000000000ff", "unknown panic code: 0xff", nil},
12111211
}
12121212
for index, c := range cases {
1213-
index, c := index, c
12141213
t.Run(fmt.Sprintf("case %d", index), func(t *testing.T) {
12151214
t.Parallel()
12161215
got, err := UnpackRevert(common.Hex2Bytes(c.input))

accounts/abi/bind/bind.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ func BindHelper(types []string, abis []string, bytecodes []string, fsigs []map[s
266266
}
267267
// Parse library references.
268268
for pattern, name := range libs {
269-
matched, err := regexp.Match("__\\$"+pattern+"\\$__", []byte(contracts[types[i]].InputBin))
269+
matched, err := regexp.MatchString("__\\$"+pattern+"\\$__", contracts[types[i]].InputBin)
270270
if err != nil {
271271
log.Error("Could not search for pattern", "pattern", pattern, "contract", contracts[types[i]], "err", err)
272272
}

accounts/abi/bind/bind_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -2179,7 +2179,7 @@ func golangBindings(t *testing.T, overload bool) {
21792179
if out, err := replacer.CombinedOutput(); err != nil {
21802180
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
21812181
}
2182-
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.22")
2182+
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.23")
21832183
tidier.Dir = pkg
21842184
if out, err := tidier.CombinedOutput(); err != nil {
21852185
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out)

accounts/abi/bind/precompilebind/precompile_bind_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ func TestPrecompileBind(t *testing.T) {
695695
if out, err := replacer.CombinedOutput(); err != nil {
696696
t.Fatalf("failed to replace binding test dependency to current source tree: %v\n%s", err, out)
697697
}
698-
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.22")
698+
tidier := exec.Command(gocmd, "mod", "tidy", "-compat=1.23")
699699
tidier.Dir = pkg
700700
if out, err := tidier.CombinedOutput(); err != nil {
701701
t.Fatalf("failed to tidy Go module file: %v\n%s", err, out)

accounts/abi/event_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,6 @@ func TestEventTupleUnpack(t *testing.T) {
341341

342342
for _, tc := range testCases {
343343
assert := assert.New(t)
344-
tc := tc
345344
t.Run(tc.name, func(t *testing.T) {
346345
err := unpackTestEventData(tc.dest, tc.data, tc.jsonLog, assert)
347346
if tc.error == "" {

accounts/abi/pack_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ import (
4444
func TestPack(t *testing.T) {
4545
t.Parallel()
4646
for i, test := range packUnpackTests {
47-
i, test := i, test
4847
t.Run(strconv.Itoa(i), func(t *testing.T) {
4948
t.Parallel()
5049
encb, err := hex.DecodeString(test.packed)

accounts/abi/reflect_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,6 @@ var reflectTests = []reflectTest{
182182
func TestReflectNameToStruct(t *testing.T) {
183183
t.Parallel()
184184
for _, test := range reflectTests {
185-
test := test
186185
t.Run(test.name, func(t *testing.T) {
187186
t.Parallel()
188187
m, err := mapArgNamesToStructFields(test.args, reflect.ValueOf(test.struc))

accounts/abi/topics_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ func TestMakeTopics(t *testing.T) {
147147
},
148148
}
149149
for _, tt := range tests {
150-
tt := tt
151150
t.Run(tt.name, func(t *testing.T) {
152151
t.Parallel()
153152
got, err := MakeTopics(tt.args.query...)
@@ -383,7 +382,6 @@ func TestParseTopics(t *testing.T) {
383382
tests := setupTopicsTests()
384383

385384
for _, tt := range tests {
386-
tt := tt
387385
t.Run(tt.name, func(t *testing.T) {
388386
t.Parallel()
389387
createObj := tt.args.createObj()
@@ -403,7 +401,6 @@ func TestParseTopicsIntoMap(t *testing.T) {
403401
tests := setupTopicsTests()
404402

405403
for _, tt := range tests {
406-
tt := tt
407404
t.Run(tt.name, func(t *testing.T) {
408405
t.Parallel()
409406
outMap := make(map[string]interface{})

accounts/abi/unpack_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ func TestMethodMultiReturn(t *testing.T) {
399399
"Can not unpack into a slice with wrong types",
400400
}}
401401
for _, tc := range testCases {
402-
tc := tc
403402
t.Run(tc.name, func(t *testing.T) {
404403
require := require.New(t)
405404
err := abi.UnpackIntoInterface(tc.dest, "multi", data)
@@ -957,7 +956,7 @@ func TestOOMMaliciousInput(t *testing.T) {
957956
}
958957
encb, err := hex.DecodeString(test.enc)
959958
if err != nil {
960-
t.Fatalf("invalid hex: %s" + test.enc)
959+
t.Fatalf("invalid hex: %s", test.enc)
961960
}
962961
_, err = abi.Methods["method"].Outputs.UnpackValues(encb)
963962
if err == nil {

cmd/evm/t8n_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ func TestT9n(t *testing.T) {
429429
ok, err := cmpJson(have, want)
430430
switch {
431431
case err != nil:
432-
t.Logf(string(have))
432+
t.Log(string(have))
433433
t.Fatalf("test %d, json parsing failed: %v", i, err)
434434
case !ok:
435435
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))
@@ -561,7 +561,7 @@ func TestB11r(t *testing.T) {
561561
ok, err := cmpJson(have, want)
562562
switch {
563563
case err != nil:
564-
t.Logf(string(have))
564+
t.Log(string(have))
565565
t.Fatalf("test %d, json parsing failed: %v", i, err)
566566
case !ok:
567567
t.Fatalf("test %d: output wrong, have \n%v\nwant\n%v\n", i, string(have), string(want))

cmd/simulator/load/loader.go

-3
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ func (l *Loader[T]) Execute(ctx context.Context) error {
6666
log.Info("Starting tx agents...")
6767
eg := errgroup.Group{}
6868
for _, agent := range agents {
69-
agent := agent
7069
eg.Go(func() error {
7170
return agent.Execute(ctx)
7271
})
@@ -100,8 +99,6 @@ func (l *Loader[T]) ConfirmReachedTip(ctx context.Context) error {
10099

101100
eg := errgroup.Group{}
102101
for i, client := range l.clients {
103-
i := i
104-
client := client
105102
eg.Go(func() error {
106103
for {
107104
latestHeight, err := client.LatestHeight(ctx)

core/blockchain_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ func TestBlockChainOfflinePruningUngracefulShutdown(t *testing.T) {
293293
return createBlockChain(db, pruningConfig, gspec, lastAcceptedHash)
294294
}
295295
for _, tt := range tests {
296-
tt := tt
297296
t.Run(tt.Name, func(t *testing.T) {
298297
t.Parallel()
299298
tt.testFunc(t, create)

core/predicate_check_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,6 @@ func TestCheckPredicate(t *testing.T) {
293293
expectedErr: ErrIntrinsicGas,
294294
},
295295
} {
296-
test := test
297296
t.Run(name, func(t *testing.T) {
298297
require := require.New(t)
299298
// Create the rules from TestChainConfig and update the predicates based on the test params

core/rawdb/accessors_chain_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ func TestBlockReceiptStorage(t *testing.T) {
291291
// Insert the receipt slice into the database and check presence
292292
WriteReceipts(db, hash, 0, receipts)
293293
if rs := ReadReceipts(db, hash, 0, 0, params.TestChainConfig); len(rs) == 0 {
294-
t.Fatalf("no receipts returned")
294+
t.Fatal("no receipts returned")
295295
} else {
296296
if err := checkReceiptsRLP(rs, receipts); err != nil {
297-
t.Fatalf(err.Error())
297+
t.Fatal(err)
298298
}
299299
}
300300
// Delete the body and ensure that the receipts are no longer returned (metadata can't be recomputed)
@@ -308,7 +308,7 @@ func TestBlockReceiptStorage(t *testing.T) {
308308
}
309309
// Ensure that receipts without metadata can be returned without the block body too
310310
if err := checkReceiptsRLP(ReadRawReceipts(db, hash, 0), receipts); err != nil {
311-
t.Fatalf(err.Error())
311+
t.Fatal(err)
312312
}
313313
// Sanity check that body and header alone without the receipt is a full purge
314314
WriteHeader(db, header)

core/types/transaction_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,7 @@ func TestYParityJSONUnmarshalling(t *testing.T) {
520520
DynamicFeeTxType,
521521
BlobTxType,
522522
} {
523-
txType := txType
524523
for _, test := range tests {
525-
test := test
526524
t.Run(fmt.Sprintf("txType=%d: %s", txType, test.name), func(t *testing.T) {
527525
// Copy the base json
528526
testJson := make(map[string]interface{})

eth/filters/api.go

-1
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,6 @@ func (api *FilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc.Subsc
350350
select {
351351
case logs := <-matchedLogs:
352352
for _, log := range logs {
353-
log := log
354353
notifier.Notify(rpcSub.ID, &log)
355354
}
356355
case <-rpcSub.Err(): // client send an unsubscribe request

eth/tracers/internal/tracetest/calltrace_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ func testCallTracer(tracerName string, dirPath string, t *testing.T) {
113113
if !strings.HasSuffix(file.Name(), ".json") {
114114
continue
115115
}
116-
file := file // capture range variable
117116
t.Run(camel(strings.TrimSuffix(file.Name(), ".json")), func(t *testing.T) {
118117
t.Parallel()
119118

@@ -205,7 +204,6 @@ func BenchmarkTracers(b *testing.B) {
205204
if !strings.HasSuffix(file.Name(), ".json") {
206205
continue
207206
}
208-
file := file // capture range variable
209207
b.Run(camel(strings.TrimSuffix(file.Name(), ".json")), func(b *testing.B) {
210208
blob, err := os.ReadFile(filepath.Join("testdata", "call_tracer", file.Name()))
211209
if err != nil {

eth/tracers/internal/tracetest/flat_calltrace_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ func testFlatCallTracer(tracerName string, dirPath string, t *testing.T) {
168168
if !strings.HasSuffix(file.Name(), ".json") {
169169
continue
170170
}
171-
file := file // capture range variable
172171
t.Run(camel(strings.TrimSuffix(file.Name(), ".json")), func(t *testing.T) {
173172
t.Parallel()
174173

eth/tracers/internal/tracetest/prestate_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ func testPrestateDiffTracer(tracerName string, dirPath string, t *testing.T) {
8383
if !strings.HasSuffix(file.Name(), ".json") {
8484
continue
8585
}
86-
file := file // capture range variable
8786
t.Run(camel(strings.TrimSuffix(file.Name(), ".json")), func(t *testing.T) {
8887
t.Parallel()
8988

eth/tracers/logger/logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ func formatLogs(logs []StructLog) []StructLogRes {
446446
}
447447
formatted[index].Stack = &stack
448448
}
449-
if trace.ReturnData != nil && len(trace.ReturnData) > 0 {
449+
if len(trace.ReturnData) > 0 {
450450
formatted[index].ReturnData = hexutil.Bytes(trace.ReturnData).String()
451451
}
452452
if trace.Memory != nil {

go.mod

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
module github.com/ava-labs/subnet-evm
22

3-
go 1.22.8
3+
go 1.23.6
44

55
require (
66
github.com/VictoriaMetrics/fastcache v1.12.1
77
github.com/antithesishq/antithesis-sdk-go v0.3.8
8-
github.com/ava-labs/avalanchego v1.12.2
8+
github.com/ava-labs/avalanchego v1.12.3-0.20250218154446-f1ec9a13b90a
99
github.com/cespare/cp v0.1.0
1010
github.com/crate-crypto/go-ipa v0.0.0-20231025140028-3c0104f4b233
1111
github.com/davecgh/go-spew v1.1.1
@@ -57,7 +57,7 @@ require (
5757
require (
5858
github.com/DataDog/zstd v1.5.2 // indirect
5959
github.com/NYTimes/gziphandler v1.1.1 // indirect
60-
github.com/ava-labs/coreth v0.14.1-rc.1 // indirect
60+
github.com/ava-labs/coreth v0.14.1-rc.1.0.20250217192834-6060a4a6a6d3 // indirect
6161
github.com/beorn7/perks v1.0.1 // indirect
6262
github.com/bits-and-blooms/bitset v1.10.0 // indirect
6363
github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect

go.sum

+4-4
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ github.com/antithesishq/antithesis-sdk-go v0.3.8/go.mod h1:IUpT2DPAKh6i/YhSbt6Gl
6060
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=
6161
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio=
6262
github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs=
63-
github.com/ava-labs/avalanchego v1.12.2 h1:vZroUgB5xMMczDQnw9etDD1XhZsejFlKky+ZZv8wOKc=
64-
github.com/ava-labs/avalanchego v1.12.2/go.mod h1:uEDLbAUPcGCfDWW680rVfysEofUe/jWte5qQk0j5hMs=
65-
github.com/ava-labs/coreth v0.14.1-rc.1 h1:U72XlRm/fKyASmjThsWzfO/ZRvu1kaONFaX+KdJNxIc=
66-
github.com/ava-labs/coreth v0.14.1-rc.1/go.mod h1:lxDSXLcrszMo0N/PVJzfZ//H+bRwXF/KQWtpEYgXZqM=
63+
github.com/ava-labs/avalanchego v1.12.3-0.20250218154446-f1ec9a13b90a h1:cBuGdwpaB1TBnfHS0w7oJyBJlM2UGOS4CEioxqMCG2g=
64+
github.com/ava-labs/avalanchego v1.12.3-0.20250218154446-f1ec9a13b90a/go.mod h1:pgUuh27zaeaXeMiIqqu/OWpbAhJQkYMJMft6nxXG9FE=
65+
github.com/ava-labs/coreth v0.14.1-rc.1.0.20250217192834-6060a4a6a6d3 h1:0OrQidq+b3kb7KlnDqc5mkB/73i1zxYEMiXioWSU4+w=
66+
github.com/ava-labs/coreth v0.14.1-rc.1.0.20250217192834-6060a4a6a6d3/go.mod h1:/XrU+CAm/0wiY5Ui05TLj2/n+czbCV6/Qrw/UMWp5aI=
6767
github.com/aymerick/raymond v2.0.3-0.20180322193309-b565731e1464+incompatible/go.mod h1:osfaiScAUVup+UC9Nfq76eWqDhXlp+4UYaA8uhTBO6g=
6868
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
6969
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=

internal/flags/flags_test.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
package flags
2828

2929
import (
30-
"os"
3130
"os/user"
3231
"runtime"
3332
"testing"
@@ -61,7 +60,7 @@ func TestPathExpansion(t *testing.T) {
6160
}
6261
}
6362

64-
os.Setenv(`DDDXXX`, `/tmp`)
63+
t.Setenv(`DDDXXX`, `/tmp`)
6564
for test, expected := range tests {
6665
got := expandPath(test)
6766
if got != expected {

0 commit comments

Comments
 (0)