Skip to content

Commit 07441d7

Browse files
authored
Upgrade to go 1.24.5 (#2357)
Upgrade the go module to 1.24.5 and reflect across docker builds. Upgrade golangci-lint and fix many many lint issues Upgrade all CI workflows to go 1.24 consistent with go module Fix golangci-lint config to comply with schema
1 parent 042d28e commit 07441d7

File tree

154 files changed

+477
-449
lines changed

Some content is hidden

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

154 files changed

+477
-449
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: actions/checkout@v3
2727
- uses: actions/setup-go@v3
2828
with:
29-
go-version: 1.21
29+
go-version: 1.24
3030
# Initializes the CodeQL tools for scanning.
3131
- name: Initialize CodeQL
3232
uses: github/codeql-action/init@v2

.github/workflows/compatiblity_check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v3
1616
- uses: actions/setup-go@v3
1717
with:
18-
go-version: 1.21
18+
go-version: 1.24
1919

2020
- name: Check Latest Dependencies
2121
run: |

.github/workflows/eth_blocktests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: Set up Go
4747
uses: actions/setup-go@v2
4848
with:
49-
go-version: 1.21
49+
go-version: 1.24
5050

5151
- name: Clone ETH Blocktests
5252
run: |

.github/workflows/golangci.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,10 @@ jobs:
1919
steps:
2020
- uses: actions/setup-go@v3
2121
with:
22-
go-version: 1.21
22+
go-version: 1.24
2323
- uses: actions/checkout@v3
2424
- name: golangci-lint
25-
uses: golangci/golangci-lint-action@v3
25+
uses: golangci/golangci-lint-action@v8
2626
with:
27-
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
28-
version: v1.60.1
27+
version: v2.4.0
2928
args: --timeout 10m0s

.github/workflows/integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ jobs:
148148
- name: Set up Go
149149
uses: actions/setup-go@v3
150150
with:
151-
go-version: 1.21
151+
go-version: 1.24
152152

153153
- name: Start 4 node docker cluster
154154
run: make clean && INVARIANT_CHECK_INTERVAL=10 ${{matrix.test.env}} make docker-cluster-start &

.github/workflows/mock_balances_build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-go@v3
1818
with:
19-
go-version: 1.21
19+
go-version: 1.24
2020

2121
- name: Build with Mock Balances
2222
run: make install-mock-balances

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
steps:
2121
- uses: actions/setup-go@v3
2222
with:
23-
go-version: "1.21"
23+
go-version: "1.24"
2424
- uses: actions/checkout@v3
2525
- uses: technote-space/get-diff-action@v6
2626
with:
@@ -55,7 +55,7 @@ jobs:
5555
- uses: actions/checkout@v3
5656
- uses: actions/setup-go@v3
5757
with:
58-
go-version: 1.21
58+
go-version: 1.24
5959

6060
# Download all coverage reports from the 'tests' job
6161
- name: Download coverage reports

.golangci.yml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,32 @@
1+
version: "2"
12
run:
23
tests: false
3-
# # timeout for analysis, e.g. 30s, 5m, default is 1m
44
timeout: 10m
55
build-tags:
66
- codeanalysis
77

88
linters:
9-
disable-all: true
9+
default: none
1010
enable:
1111
- bodyclose
12-
# - depguard ## see https://github.com/golangci/golangci-lint/issues/3906
1312
- dogsled
14-
- exportloopref
1513
- errcheck
1614
- goconst
17-
# - gocritic
18-
- gofmt
19-
- goimports
2015
- gosec
21-
- gosimple
2216
- govet
2317
- ineffassign
2418
- misspell
25-
# - nakedret
2619
- prealloc
2720
- staticcheck
28-
# - structcheck ## author abandoned project
29-
- stylecheck
30-
# - revive
31-
# - typecheck
3221
- unconvert
33-
# - unused
34-
# - unparam
3522
- misspell
36-
# - nolintlint ## does not work with IDEs like VSCode which automatically insert leading spaces
23+
exclusions:
24+
rules:
25+
- linters:
26+
- gosec
27+
text: "Use of weak random number generator"
3728

38-
issues:
39-
exclude-rules:
40-
- text: "Use of weak random number generator"
41-
linters:
42-
- gosec
43-
- text: "ST1003:"
44-
linters:
45-
- stylecheck
46-
# FIXME: Disabled until golangci-lint updates stylecheck with this fix:
47-
# https://github.com/dominikh/go-tools/issues/389
48-
- text: "ST1016:"
49-
linters:
50-
- stylecheck
29+
formatters:
30+
enable:
31+
- gofmt
32+
- goimports

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# ---------- Builder ----------
2-
FROM golang:1.23.7 AS go-builder
2+
FROM golang:1.24.5 AS go-builder
33
WORKDIR /app/sei-chain
44

55
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates wget && \

app/app.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ func New(
949949
tmos.Exit(err.Error())
950950
}
951951

952-
ctx := app.BaseApp.NewUncachedContext(true, tmproto.Header{})
952+
ctx := app.NewUncachedContext(true, tmproto.Header{})
953953
if err := app.WasmKeeper.InitializePinnedCodes(ctx); err != nil {
954954
tmos.Exit(fmt.Sprintf("failed initialize pinned codes %s", err))
955955
}
@@ -1871,7 +1871,7 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig
18711871

18721872
// RegisterTxService implements the Application.RegisterTxService method.
18731873
func (app *App) RegisterTxService(clientCtx client.Context) {
1874-
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
1874+
authtx.RegisterTxService(app.GRPCQueryRouter(), clientCtx, app.Simulate, app.interfaceRegistry)
18751875
}
18761876

18771877
func (app *App) RPCContextProvider(i int64) sdk.Context {
@@ -1893,7 +1893,7 @@ func (app *App) RPCContextProvider(i int64) sdk.Context {
18931893

18941894
// RegisterTendermintService implements the Application.RegisterTendermintService method.
18951895
func (app *App) RegisterTendermintService(clientCtx client.Context) {
1896-
tmservice.RegisterTendermintService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
1896+
tmservice.RegisterTendermintService(app.GRPCQueryRouter(), clientCtx, app.interfaceRegistry)
18971897
txConfigProvider := func(height int64) client.TxConfig {
18981898
if app.ChainID != "pacific-1" {
18991899
return app.encodingConfig.TxConfig
@@ -1989,7 +1989,7 @@ func (app *App) checkTotalBlockGas(ctx sdk.Context, txs [][]byte) bool {
19891989
gasWanted = feeTx.GetGas()
19901990
}
19911991

1992-
if int64(gasWanted) < 0 || int64(totalGas) > math.MaxInt64-int64(gasWanted) {
1992+
if int64(gasWanted) < 0 || int64(totalGas) > math.MaxInt64-int64(gasWanted) { // nolint:gosec
19931993
return false
19941994
}
19951995

@@ -2007,11 +2007,11 @@ func (app *App) checkTotalBlockGas(ctx sdk.Context, txs [][]byte) bool {
20072007
totalGas += gasWanted
20082008
}
20092009

2010-
if totalGasWanted > uint64(ctx.ConsensusParams().Block.MaxGasWanted) {
2010+
if totalGasWanted > uint64(ctx.ConsensusParams().Block.MaxGasWanted) { //nolint:gosec
20112011
return false
20122012
}
20132013

2014-
if totalGas > uint64(ctx.ConsensusParams().Block.MaxGas) {
2014+
if totalGas > uint64(ctx.ConsensusParams().Block.MaxGas) { //nolint:gosec
20152015
return false
20162016
}
20172017
}

0 commit comments

Comments
 (0)