Skip to content

Commit 4da8eba

Browse files
chore: bump Go to 1.26.2 (Squashed #977 needed signing) (#981)
Squashes commits from #977 commit fa478bf Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 17:00:25 2026 +0800 ci: address review issues commit 826c52a Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 16:38:55 2026 +0800 ci: fix operations-gen linting commit 52d673a Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 16:34:31 2026 +0800 ci: fix goconst linter errors commit 5c25692 Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 14:52:32 2026 +0800 ci: fix gosec linter errors commit d73f68d Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 14:42:04 2026 +0800 ci: fix staticcheck linter errors commit 053f182 Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 14:39:18 2026 +0800 ci: fix govet linter errors commit bc55c2f Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 14:33:34 2026 +0800 ci: fix prealloc linter errors commit 160a354 Author: James Kong <james.kong@smartcontract.com> Date: Fri May 15 14:14:49 2026 +0800 ci: update linter commit f3b2374 Author: James Kong <james.kong@smartcontract.com> Date: Thu May 14 17:41:58 2026 +0800 chore: bump Go to 1.26.2 Bumps the Go version to 1.26.2 and updates dependencies
1 parent 2fd8a93 commit 4da8eba

40 files changed

Lines changed: 250 additions & 354 deletions

File tree

.changeset/slimy-icons-divide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"chainlink-deployments-framework": minor
3+
---
4+
5+
Bump to Go 1.26.2, update several dependencies, and migrate from `pgx/v4` to `pgx/v5`.

.github/workflows/pull-request-main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v2 # ci-lint-go@2.0.0
3737
with:
3838
only-new-issues: "false"
39-
golangci-lint-version: v2.8.0
39+
golangci-lint-version: v2.12.2
4040

4141
ci-lint-operations-gen:
4242
name: Lint operations-gen
@@ -52,7 +52,7 @@ jobs:
5252
uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v2 # ci-lint-go@2.0.0
5353
with:
5454
only-new-issues: "false"
55-
golangci-lint-version: v2.8.0
55+
golangci-lint-version: v2.12.2
5656
go-directory: tools/operations-gen
5757

5858
ci-lint-misc:

.github/workflows/schedule-main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: smartcontractkit/.github/actions/ci-lint-go@ci-lint-go/v2 # ci-lint-go@2.0.0
2020
with:
2121
only-new-issues: "false"
22-
golangci-lint-version: v2.8.0
22+
golangci-lint-version: v2.12.2
2323

2424
ci-lint-misc:
2525
name: Lint GH Actions and scripts

.golangci.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ linters:
8585
desc: We want to avoid importing this package as it creates import cycles
8686
goconst:
8787
min-len: 5
88+
min-occurrences: 5
89+
ignore-tests: true
8890
govet:
8991
enable:
9092
- shadow
@@ -134,13 +136,17 @@ linters:
134136
- legacy
135137
- std-error-handling
136138
rules:
137-
- linters:
138-
- goconst
139-
path: (.+)_test\.go
140139
- linters:
141140
- staticcheck
142141
text: "SA1019:.*aws-sdk-go.*is deprecated"
143142
path: (.+)\.go
143+
# The aws-sdk-go v1 KMS signer paths depend on ecdsa.PublicKey.X/Y, which were
144+
# deprecated in Go 1.26. We are not upgrading the AWS SDK at the moment, so allow these here.
145+
# Once we switch over to using the chainlink keystore, this can be removed.
146+
- linters:
147+
- staticcheck
148+
text: "SA1019:.*(has been deprecated since Go 1\\.26).*ParseUncompressedPublicKey"
149+
path: chain/(evm|tron)/provider/kms_signer(_test)?\.go
144150
paths:
145151
- third_party$
146152
- builtin$

.tool-versions

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
golang 1.25.5
2-
golangci-lint 2.8.0
1+
golang 1.26.2
2+
golangci-lint 2.12.2
33
mockery 3.6.3
44
nodejs 20.16.0
55
pnpm 10.6.5

chain/blockchain.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ func getChainsByType[VT any, PT any](b BlockChains) map[uint64]VT {
250250
chains[sel] = c
251251
case PT:
252252
val := reflect.ValueOf(c)
253-
if val.Kind() == reflect.Ptr && !val.IsNil() {
253+
if val.Kind() == reflect.Pointer && !val.IsNil() {
254254
elem := val.Elem()
255255
if elem.CanInterface() {
256256
if v, ok := elem.Interface().(VT); ok {

chain/evm/operations/contract/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ func deployZkContractImpl(
231231
// arrayify converts a struct or pointer to struct into a slice of its field values.
232232
func arrayify[ARGS any](args ARGS) ([]any, error) {
233233
v := reflect.ValueOf(args)
234-
if v.Kind() == reflect.Ptr {
234+
if v.Kind() == reflect.Pointer {
235235
if v.IsNil() {
236236
return nil, errors.New("expected non-nil pointer to struct, got nil")
237237
}

chain/evm/operations2/contract/deploy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ func deployZkContractImpl(
225225
// arrayify converts a struct or pointer to struct into a slice of its field values.
226226
func arrayify[ARGS any](args ARGS) ([]any, error) {
227227
v := reflect.ValueOf(args)
228-
if v.Kind() == reflect.Ptr {
228+
if v.Kind() == reflect.Pointer {
229229
if v.IsNil() {
230230
return nil, errors.New("expected non-nil pointer to struct, got nil")
231231
}

chain/evm/provider/kms_signer.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,15 @@ func recoverEVMSignature(expectedPublicKey, txHash, r, s []byte) ([]byte, error)
250250
return evmSig, nil
251251
}
252252

253-
// padTo32Bytes pads the given byte slice to 32 bytes by trimming leading zeros and prepending
254-
// zeros.
253+
// padTo32Bytes pads the given byte slice to 32 bytes by trimming leading zeros and left-padding
254+
// with zeros.
255255
func padTo32Bytes(buffer []byte) []byte {
256256
buffer = bytes.TrimLeft(buffer, "\x00")
257-
for len(buffer) < 32 {
258-
zeroBuf := []byte{0}
259-
buffer = append(zeroBuf, buffer...)
257+
if len(buffer) >= 32 {
258+
return buffer
260259
}
260+
out := make([]byte, 32)
261+
copy(out[32-len(buffer):], buffer)
261262

262-
return buffer
263+
return out
263264
}

chain/evm/provider/zksync_signer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Test_zkSyncSigner_SignTypedData(t *testing.T) {
7373
return func(hash []byte) ([]byte, error) {
7474
sig := make([]byte, 65)
7575
copy(sig, hash)
76-
sig[64] = byte(v)
76+
sig[64] = byte(v) //nolint:gosec // G115: v is a test-controlled small int (recovery byte 0/1/27/28)
7777

7878
return sig, nil
7979
}

0 commit comments

Comments
 (0)