Skip to content

Commit 772a715

Browse files
authored
Node: Update golang (#4161)
* Node: Update golang * node: Upgrade golangci-lint
1 parent b0eb131 commit 772a715

File tree

12 files changed

+41
-31
lines changed

12 files changed

+41
-31
lines changed

.github/workflows/build.yml

+6-7
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@v2
4949
- uses: actions/setup-go@v2
5050
with:
51-
go-version: "1.21.9"
51+
go-version: "1.23.3"
5252
- run: make node
5353

5454
algorand:
@@ -186,8 +186,7 @@ jobs:
186186
done
187187
188188
cargo test --workspace --features "nft-bridge/instructions token-bridge/instructions wormhole-bridge-solana/instructions"
189-
shell:
190-
bash
189+
shell: bash
191190

192191
aptos:
193192
name: Aptos
@@ -271,7 +270,7 @@ jobs:
271270
- uses: actions/checkout@v2
272271
- uses: actions/setup-go@v2
273272
with:
274-
go-version: "1.21.9"
273+
go-version: "1.23.3"
275274
- run: cd sdk/vaa && go test && go test -v -fuzz FuzzCalculateQuorum -run FuzzCalculateQuorum -fuzztime 15s
276275

277276
# Run Go linters
@@ -288,13 +287,13 @@ jobs:
288287
- uses: actions/checkout@v2
289288
- uses: actions/setup-go@v2
290289
with:
291-
go-version: "1.21.9"
290+
go-version: "1.23.3"
292291
- name: Install formatter
293292
run: go install golang.org/x/tools/cmd/goimports@v0.8.0
294293
- name: Formatting checks
295294
run: ./scripts/lint.sh -l -g format
296295
- name: Install linters
297-
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.57.2
296+
run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.60.1
298297
- name: Run linters
299298
run: make generate && golangci-lint --version && ./scripts/lint.sh -g lint
300299
- name: Ensure generated proto matches
@@ -330,7 +329,7 @@ jobs:
330329
- uses: actions/checkout@v2
331330
- uses: actions/setup-go@v2
332331
with:
333-
go-version: "1.21.9"
332+
go-version: "1.23.3"
334333
# The go-ethereum and celo-blockchain packages both implement secp256k1 using the exact same header, but that causes duplicate symbols.
335334
- name: Run golang tests
336335
run: cd node && go test -v -timeout 5m -race -ldflags '-extldflags "-Wl,--allow-multiple-definition" ' ./...

DEVELOP.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
The following dependencies are required for local development:
66

7-
- [Go](https://golang.org/dl/) >= 1.21.9 (latest minor release is recommended)
7+
- [Go](https://golang.org/dl/) >= 1.23.3 (latest minor release is recommended)
88
- [Tilt](http://tilt.dev/) >= 0.20.8
99
- Any of the local Kubernetes clusters supported by Tilt.
1010
We strongly recommend [minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/) >=

Dockerfile.proto

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
2-
FROM docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS go-tools
2+
FROM docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb AS go-tools
33

44
RUN mkdir /app
55

@@ -10,7 +10,7 @@ RUN --mount=type=cache,target=/root/.cache --mount=type=cache,target=/go \
1010
cd /app/tools && CGO_ENABLED=0 ./build.sh
1111

1212
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
13-
FROM docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS go-build
13+
FROM docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb AS go-build
1414

1515
COPY --from=go-tools /app /app
1616

docs/operations.md

+22-13
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ so you can test changes for your mainnet full nodes and gain operational experie
1717
### Solana node requirements
1818

1919
Refer to the [Solana documentation](https://docs.solanalabs.com/operations/setup-an-rpc-node) on how to run an RPC
20-
(full) node. [Solana's Discord server](https://solana.com/community) is a great resource for questions regarding
20+
(full) node. [Solana's Discord server](https://solana.com/community) is a great resource for questions regarding
2121
operations.
2222

2323
The `#rpc-server-operators` channel is especially useful for setting up Solana RPC nodes.
@@ -91,7 +91,6 @@ since only very few nodes support the light client protocol.
9191
Running a full node typically requires ~500G of SSD storage, 8G of RAM and 4-8 CPU threads (depending on clock
9292
frequency). Light clients have much lower hardware requirements.
9393

94-
9594
### Terra
9695

9796
Terra is also sometimes referred to as Terra 2, but the correct name is just simply "Terra". The previous version was renamed to "Terra Classic".
@@ -102,17 +101,18 @@ Refer to the [Terra documentation](https://docs.terra.money/full-node/run-a-full
102101

103102
Refer to the [Terra Classic documentation](https://classic-docs.terra.money/docs/full-node/run-a-full-terra-node/README.html) on how to run a full node.
104103

105-
106104
### Wormchain
107105

108106
All guardians **must run validators for wormchain**, the codename of [Wormhole Gateway](https://wormhole.com/gateway/).
109107

110108
#### Pre-requisites
111-
- Ensure you have [Go](https://golang.org/dl/) >= 1.21.9 installed.
109+
110+
- Ensure you have [Go](https://golang.org/dl/) >= 1.23.3 installed.
112111

113112
#### Building wormchaind binary
113+
114114
There is not a pre-built binary available. You need to check out the repo and build the
115-
wormchaind binary from source:
115+
wormchaind binary from source:
116116

117117
First, check out the version of the Wormhole repo that you want to deploy:
118118

@@ -125,18 +125,22 @@ Then, compile the release binary as an unprivileged build user:
125125
```bash
126126
make build/wormchaind
127127
```
128+
128129
You'll find `wormchaind` binary in `wormchain/build/wormchaind`.
129130

130131
#### Initialize environment
132+
131133
Initialize the Wormchain environment with the necessary configuration.
132134

133135
```bash
134136
/path/to/wormchain/bin/wormchaind init <your-node-name> --chain-id wormchain --home /path/to/wormchain/directory
135137
```
138+
136139
This command will generate the private validator key. That key should be backed up.
137140
This key is set in `config.toml` file under the `priv_validator_key_file` field.
138141

139142
#### Generate configuration files
143+
140144
The `--wormchainURL` argument to the guardian node should point to `<validator address>:9090` which is the `grpc` port
141145
in the app.toml.
142146

@@ -174,24 +178,29 @@ For signing, consider setting up a remote threshold signer such as
174178
in front of your wormchain validator.
175179

176180
#### Retrieve the Genesis File
181+
177182
Download the genesis file from the wormhole repository.
178183

179184
```bash
180185
wget -O /path/to/wormchain/config/genesis.json https://raw.githubusercontent.com/wormhole-foundation/wormhole/main/wormchain/<network>/genesis.json
181186
```
182187

183188
#### Generate wormchain keys
189+
184190
To generate wormchain keys, run the following command:
185191

186192
```bash
187193
/path/to/wormchain/bin/wormchaind keys add <key-name> --keyring-backend file --home /path/to/wormchain/directory
188194
```
189195

190196
This command will create a `<key-name>.info` file. To extract the key, run the following command:
197+
191198
```bash
192199
wormchaind keys export <key_name> --home /path/to/wormchain/directory --keyring-dir . --keyring-backend file
193200
```
201+
194202
This command will ask for a passphrase to be created for it. Both `wormchain.key` and `passphrase` will be used by the following `guardiand` flags:
203+
195204
- `--accountantKeyPath`
196205
- `--accountantKeyPassPhrase`
197206

@@ -262,9 +271,9 @@ to function correctly. By default in geth, [historical state is only kept in mem
262271
After 128 blocks, older states are garbage collected. Many of these chains are forks of geth that maintain this
263272
historical limitation.
264273

265-
* Arbitrum
266-
* Base
267-
* Optimism
274+
- Arbitrum
275+
- Base
276+
- Optimism
268277

269278
Newer execution clients such as [reth](https://github.com/paradigmxyz/reth) lack this limitation and are worth
270279
investigating once they are stable.
@@ -279,10 +288,10 @@ All modern Cosmos integrations happen by Wormhole observing IBC transactions on
279288

280289
The following Cosmos based nodes were added prior to Gateway and guardians need to run full nodes:
281290

282-
* Injective
283-
* Terra
284-
* Terra Classic
285-
* XPLA
291+
- Injective
292+
- Terra
293+
- Terra Classic
294+
- XPLA
286295

287296
**NOTE**: All guardians must run validators for wormchain.
288297

@@ -291,7 +300,7 @@ The following Cosmos based nodes were added prior to Gateway and guardians need
291300
For security reasons, we do not provide a pre-built binary. You need to check out the repo and build the
292301
guardiand binary from source. A Git repo is much harder to tamper with than release binaries.
293302

294-
To build the Wormhole node, you need [Go](https://golang.org/dl/) >= 1.21.9
303+
To build the Wormhole node, you need [Go](https://golang.org/dl/) >= 1.23.3
295304

296305
First, check out the version of the Wormhole repo that you want to deploy:
297306

node/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
2-
FROM --platform=linux/amd64 docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS dev
2+
FROM --platform=linux/amd64 docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb AS dev
33
# libwasmvm.so is not compatible with arm
44

55
FROM dev AS build

node/go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/certusone/wormhole/node
22

3-
go 1.21.9
3+
go 1.23.3
44

55
require (
66
github.com/celo-org/celo-blockchain v1.5.5

node/hack/query/ccqlistener/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
2-
FROM --platform=linux/amd64 docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35 AS build
2+
FROM --platform=linux/amd64 docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb AS build
33
# libwasmvm.so is not compatible with arm
44

55
WORKDIR /app

node/pkg/watchers/evm/connectors/finalizer_poller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package connectors
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"math/big"
78
"time"
@@ -68,7 +69,7 @@ func (b *FinalizerPollConnector) SubscribeForBlocks(ctx context.Context, errC ch
6869
sub.unsubDone <- struct{}{}
6970
return nil
7071
case v := <-innerErrSink:
71-
sub.err <- fmt.Errorf(v)
72+
sub.err <- errors.New(v)
7273
}
7374
}
7475
})

node/pkg/watchers/evm/connectors/logpoller.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package connectors
22

33
import (
44
"context"
5+
"errors"
56
"fmt"
67
"math/big"
78
"time"
@@ -94,7 +95,7 @@ func (l *LogPollConnector) WatchLogMessagePublished(ctx context.Context, errC ch
9495
sub.unsubDone <- struct{}{}
9596
return nil
9697
case v := <-innerErrSink:
97-
sub.err <- fmt.Errorf(v)
98+
sub.err <- errors.New(v)
9899
}
99100
}
100101
})

scripts/Dockerfile.lint

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker.io/docker/dockerfile:1.3@sha256:42399d4635eddd7a9b8a24be879d2f9a930d0ed040a61324cfdf59ef1357b3b2
2-
FROM docker.io/golang:1.21.9-bullseye@sha256:311468bffa9fa4747a334b94e6ce3681b564126d653675a6adc46698b2b88d35
2+
FROM docker.io/golang:1.23.3-bullseye@sha256:bc1b90c2a8eb0ffb62325e02a85d51031ad3afae15b3df4b6a48b7929b00badb
33

44
RUN useradd -u 1000 -U -m -d /home/lint lint
55
USER 1000

scripts/update-go-version.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function update_our_dockerfiles() {
6464
local image=docker.io/golang
6565

6666
# shellcheck disable=SC2207
67-
local wormhole_dockerfiles=($(git grep -lEi 'FROM.*go(lang)' | grep -Ev '^(wormchain/D|third_party|algorand|terra)'))
67+
local wormhole_dockerfiles=($(git grep -lEi 'FROM.*go(lang)' | grep -Ev '^(wormchain/D|third_party|algorand|terra|docs)'))
6868

6969
# shellcheck disable=SC2155
7070
local digest=$(get_docker_image_digest "$version" "docker.io/golang")

sdk/vaa/payloads.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ func LeftPadBytes(payload string, length int) (*bytes.Buffer, error) {
502502
}
503503

504504
if len(payload) > length {
505-
return nil, fmt.Errorf(fmt.Sprintf("payload longer than %d bytes", length))
505+
return nil, fmt.Errorf("payload longer than %d bytes", length)
506506
}
507507

508508
buf := &bytes.Buffer{}

0 commit comments

Comments
 (0)