Skip to content

Commit d85a1db

Browse files
authored
feat(go): upgrade Go from 1.17 to 1.18 (#2379)
* Upgrade from Go 1.17 to Go 1.18 * Add `go mod download` to mocks workflow * Run `go fix ./...`
1 parent 7cd4118 commit d85a1db

Some content is hidden

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

42 files changed

+89
-80
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
timeout-minutes: 60
2828
strategy:
2929
matrix:
30-
go-version: [1.17.x]
3130
platform: [macos-latest, ubuntu-latest]
3231
runs-on: ${{ matrix.platform }}
3332
steps:
@@ -37,7 +36,10 @@ jobs:
3736
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
3837
- uses: actions/setup-go@v2
3938
with:
40-
go-version: ${{ matrix.go-version }}
39+
go-version: 1.18
40+
stable: true
41+
check-latest: true
42+
4143
- uses: actions/checkout@v3
4244

4345
# cache go build cache
@@ -61,9 +63,6 @@ jobs:
6163

6264
publish-code-coverage:
6365
timeout-minutes: 60
64-
strategy:
65-
matrix:
66-
go-version: [1.17.x]
6766
runs-on: ubuntu-latest
6867
steps:
6968
- id: go-cache-paths
@@ -72,7 +71,10 @@ jobs:
7271
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
7372
- uses: actions/setup-go@v2
7473
with:
75-
go-version: ${{ matrix.go-version }}
74+
go-version: 1.18
75+
stable: true
76+
check-latest: true
77+
7678
- uses: actions/checkout@v3
7779

7880
# cache go build cache

.github/workflows/checks.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222

2323
- uses: actions/setup-go@v2
2424
with:
25-
go-version: "1.17.x"
25+
go-version: 1.18
26+
stable: true
27+
check-latest: true
2628

2729
- name: Lint
2830
run: make lint
@@ -36,7 +38,10 @@ jobs:
3638
steps:
3739
- uses: actions/setup-go@v2
3840
with:
39-
go-version: "1.17.x"
41+
go-version: 1.18
42+
stable: true
43+
check-latest: true
44+
4045
- uses: actions/checkout@v3
4146
- name: Checks PR has title and body description
4247
run: |

.github/workflows/code-cov.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ env:
2222
jobs:
2323
publish-code-coverage:
2424
timeout-minutes: 60
25-
strategy:
26-
matrix:
27-
go-version: [1.17.x]
2825
runs-on: ubuntu-latest
2926
steps:
3027
- id: go-cache-paths
@@ -33,7 +30,10 @@ jobs:
3330
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
3431
- uses: actions/setup-go@v2
3532
with:
36-
go-version: ${{ matrix.go-version }}
33+
go-version: 1.18
34+
stable: true
35+
check-latest: true
36+
3737
- uses: actions/checkout@v3
3838

3939
# cache go build cache

.github/workflows/copyright.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ jobs:
1818

1919
- uses: actions/setup-go@v2
2020
with:
21-
go-version: "^1.17"
21+
go-version: 1.18
22+
stable: true
23+
check-latest: true
2224

2325
- run: go install github.com/google/[email protected]
2426

.github/workflows/devnet.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,18 @@ on:
33
push:
44
branches:
55
- devnet
6-
6+
77
jobs:
88
update:
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v3
12+
1213
- uses: actions/setup-go@v2
1314
with:
14-
go-version: '^1.17.0'
15+
go-version: 1.18
16+
stable: true
17+
check-latest: true
1518

1619
- name: Configure AWS Credentials
1720
uses: aws-actions/configure-aws-credentials@v1
@@ -65,7 +68,7 @@ jobs:
6568
docker build --progress=plain \
6669
-t=$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG -t=$ECR_REGISTRY/$ECR_REPOSITORY:latest \
6770
--build-arg key=charlie --build-arg DD_API_KEY=$DD_API_KEY --build-arg METRICS_NAMESPACE=gossamer.ecs.devnet \
68-
-f=devnet/bob.Dockerfile .
71+
-f=devnet/bob.Dockerfile .
6972
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
7073
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
7174
@@ -74,12 +77,12 @@ jobs:
7477
working-directory: ./devnet/cmd/scale-down-ecs-service
7578
run: |
7679
go run . -c gssmr-ecs -s="gssmr-ecs-(Charlie|Bob)Service-.+$"
77-
80+
7881
- name: docker compose up
7982
id: docker-compose-up
8083
working-directory: ./devnet/gssmr-ecs
8184
run: |
8285
curl -L https://raw.githubusercontent.com/docker/compose-cli/main/scripts/install/install_linux.sh | sh
8386
docker context create ecs gssmr-ecs --from-env
8487
docker context use gssmr-ecs
85-
docker compose up
88+
docker compose up

.github/workflows/integration-tests.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ jobs:
3535
3636
- uses: actions/setup-go@v2
3737
with:
38-
go-version: 1.17.x
38+
go-version: 1.18
39+
stable: true
40+
check-latest: true
41+
3942
- uses: actions/checkout@v3
4043

4144
# cache go build cache

.github/workflows/mocks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ jobs:
1717

1818
- uses: actions/setup-go@v2
1919
with:
20-
go-version: "^1.17"
20+
go-version: 1.18
21+
stable: true
22+
check-latest: true
2123

2224
- run: go install github.com/vektra/mockery/[email protected]
2325

@@ -26,13 +28,15 @@ jobs:
2628
- name: Check devnet module
2729
run: |
2830
cd devnet && \
31+
go mod download && \
2932
go generate -run "mockery" -tags integration ./... && \
3033
go generate -run "mockgen" -tags integration ./... && \
3134
git diff --exit-code && \
3235
cd ..
3336
3437
- name: Check Gossamer module
3538
run: |
39+
go mod download && \
3640
go generate -run "mockery" -tags integration ./... && \
3741
go generate -run "mockgen" -tags integration ./... && \
3842
git diff --exit-code

.github/workflows/unit-tests.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ env:
2222
jobs:
2323
unit-tests:
2424
timeout-minutes: 60
25-
strategy:
26-
matrix:
27-
go-version: [1.17.x]
28-
platform: [ubuntu-latest]
29-
runs-on: ${{ matrix.platform }}
25+
runs-on: ubuntu-latest
3026
steps:
3127
- id: go-cache-paths
3228
run: |
@@ -35,7 +31,10 @@ jobs:
3531
3632
- uses: actions/setup-go@v2
3733
with:
38-
go-version: ${{ matrix.go-version }}
34+
go-version: 1.18
35+
stable: true
36+
check-latest: true
37+
3938
- uses: actions/checkout@v3
4039

4140
# cache go build cache

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG DEBIAN_VERSION=bullseye-slim
2-
ARG GO_VERSION=1.17-buster
2+
ARG GO_VERSION=1.18-buster
33

44
FROM golang:${GO_VERSION} AS builder
55

Dockerfile.staging

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.17
1+
FROM golang:1.18
22

33
ARG chain="polkadot"
44
ARG basepath="~/.gossamer"

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,28 +43,33 @@ For more information about Gossamer, the Polkadot ecosystem, and how to use Goss
4343

4444
### Prerequisites
4545

46-
install go version `>=1.17`
46+
Install Go version [`>=1.18`](https://go.dev/dl/#go1.18)
4747

4848
### Installation
4949

5050
get the [ChainSafe/gossamer](https://github.com/ChainSafe/gossamer) repository:
51+
5152
```
5253
git clone [email protected]:ChainSafe/gossamer
5354
cd gossamer
5455
```
5556

5657
build gossamer command:
58+
5759
```
5860
make gossamer
5961
```
62+
6063
### Troubleshooting for Apple Silicon users
6164

6265
If you are facing the following problem with the `wasmer`:
66+
6367
```
6468
undefined: cWasmerImportObjectT
6569
undefined: cWasmerImportFuncT
6670
undefined: cWasmerValueTag
6771
```
72+
6873
Make sure you have the following Golang enviroment variables:
6974

7075
- GOARCH="amd64"
@@ -74,8 +79,6 @@ Make sure you have the following Golang enviroment variables:
7479
7580
> use _go env -w **ENV_NAME**=**ENV_VALUE**_ to set the new value
7681
77-
78-
7982
### Run Development Node
8083

8184
To initialise a development node:
@@ -85,22 +88,25 @@ To initialise a development node:
8588
```
8689

8790
To start the development node:
91+
8892
```
8993
./bin/gossamer --chain dev
9094
```
9195

92-
The development node is configured to produce a block every slot and to finalise a block every round (as there is only one authority, `alice`.)
96+
The development node is configured to produce a block every slot and to finalise a block every round (as there is only one authority, `alice`.)
9397

9498
### Run Gossamer Node
9599

96100
The gossamer node runs by default as an authority with 9 authorites set at genesis. The built-in keys, corresponding to the authorities, that are available for the node are `alice`, `bob`, `charlie`, `dave`, `eve`, `ferdie`, `george`, and `ian`.
97101

98102
To initialise a gossamer node:
103+
99104
```
100105
./bin/gossamer --chain gssmr init
101106
```
102107

103108
To start the gossamer node:
109+
104110
```
105111
./bin/gossamer --chain gssmr --key alice
106112
```
@@ -112,11 +118,13 @@ Note: If you only run one gossamer node, the node will not build blocks every sl
112118
Kusama is currently supported as a **full node**, ie. it can sync the chain but not act as an authority.
113119

114120
To initialise a kusama node:
121+
115122
```
116123
./bin/gossamer --chain kusama init
117124
```
118125

119126
To start the kusama node:
127+
120128
```
121129
./bin/gossamer --chain kusama
122130
```
@@ -128,18 +136,20 @@ The node may not appear to do anything for the first minute or so (it's bootstra
128136
network = "debug"
129137
```
130138

131-
After it's finished bootstrapping, the node should begin to sync.
139+
After it's finished bootstrapping, the node should begin to sync.
132140

133141
### Run Polkadot Node
134142

135143
Polkadot is currently supported as a **full node**, ie. it can sync the chain but not act as an authority.
136144

137145
To initialise a polkadot node:
146+
138147
```
139148
./bin/gossamer --chain polkadot init
140149
```
141150

142151
To start the polkadot node:
152+
143153
```
144154
./bin/gossamer --chain polkadot
145155
```
@@ -159,19 +169,17 @@ Our work on gossamer is funded by grants. If you'd like to donate, you can send
159169
### Reporting a Security Bug
160170

161171
We take all security issues seriously, if you believe you have found a security issue within a ChainSafe
162-
project please notify us immediately. If an issue is confirmed, we will take all necessary precautions
172+
project please notify us immediately. If an issue is confirmed, we will take all necessary precautions
163173
to ensure a statement and patch release is made in a timely manner.
164174

165175
Please email us a description of the flaw and any related information (e.g. reproduction steps, version) to
166176
[security at chainsafe dot io](mailto:[email protected]).
167177

168-
169178
## License
170179

171180
_GNU Lesser General Public License v3.0_
172181

173182
<br />
174183
<p align="center">
175-
<img src="/docs/docs/assets/img/chainsafe_gopher.png">
184+
<img src="/docs/docs/assets/img/chainsafe_gopher.png">
176185
</p>
177-

devnet/alice.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright 2021 ChainSafe Systems (ON)
22
# SPDX-License-Identifier: LGPL-3.0-only
33

4-
FROM golang:1.17
4+
FROM golang:1.18
55

66
ARG POLKADOT_VERSION=v0.9.10
77

@@ -18,7 +18,7 @@ WORKDIR /gossamer
1818
COPY go.mod go.sum ./
1919
RUN go mod download
2020

21-
COPY . .
21+
COPY . .
2222

2323
RUN go install -trimpath github.com/ChainSafe/gossamer/cmd/gossamer
2424

devnet/bob.Dockerfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
# Copyright 2021 ChainSafe Systems (ON)
22
# SPDX-License-Identifier: LGPL-3.0-only
33

4-
5-
FROM golang:1.17
4+
FROM golang:1.18
65

76
ARG POLKADOT_VERSION=v0.9.10
87

devnet/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/ChainSafe/gossamer/devnet
22

3-
go 1.17
3+
go 1.18
44

55
require (
66
github.com/aws/aws-sdk-go v1.42.22

devnet/substrate_alice.Dockerfile

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

44
ARG POLKADOT_VERSION=v0.9.10
55

6-
FROM golang:1.17 as openmetrics
6+
FROM golang:1.18 as openmetrics
77
ARG METRICS_NAMESPACE=substrate.local.devnet
88

99
WORKDIR /devnet

0 commit comments

Comments
 (0)