Skip to content

Commit e586dc9

Browse files
authored
Merge pull request #1707 from chris-j-h/go-and-dep-upgrades
Go and dependency upgrades
2 parents 6cf0f5a + 9ce3faa commit e586dc9

Some content is hidden

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

43 files changed

+395
-301
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
branches:
1010
- master
1111
env:
12-
GO_VERSION: 1.19
12+
GO_VERSION: 1.21.3
1313
GOPATH: ${{ github.workspace }}/go
1414
WORKING_DIR: ${{ github.workspace }}/go/src/github.com/ethereum/go-ethereum
1515
jobs:

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- '**.md'
77
- .gitignore
88
env:
9-
GO_VERSION: 1.19
9+
GO_VERSION: 1.21.3
1010
jobs:
1111
lint:
1212
name: 'Code linters'

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
tags:
88
- 'v*'
99
env:
10-
GO_VERSION: 1.19
10+
GO_VERSION: 1.21.3
1111
GOPATH: ${{ github.workspace }}/go
1212
WORKING_DIR: ${{ github.workspace }}/go/src/github.com/ethereum/go-ethereum
1313
jobs:

.golangci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ issues:
6363
text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.'
6464
- path: rpc/
6565
text: 'SA1019: "github.com/golang/protobuf/ptypes" is deprecated: Well-known types have specialized functionality directly injected into the generated packages for each message type. See the deprecation notice for each function for the suggested alternative'
66+
- path: metrics/sample_test.go
67+
text: 'SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value. Programs that call Seed with a known value to get a specific sequence of results should use New.NewSource.seed.. to obtain a local random generator.'
6668
exclude:
6769
- 'SA1019: event.TypeMux is deprecated: use Feed'
6870
- 'SA1019: strings.Title is deprecated'
6971
- 'SA1019: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead.'
7072
- 'SA1029: should not use built-in type string as key for value'
73+
# quorum: ignore due to large number of changes required to remedy. ioutil now only operates as a simple delegate for the preferred os and io packages anyway.
74+
# If we want to correctly resolve these lint issues, upstream PR https://github.com/ethereum/go-ethereum/pull/24869 can provide guidance.
75+
- 'SA1019: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package .io. or package .os., and those implementations should be preferred in new code. See the specific function documentation for details.'

.travis.yml

Lines changed: 39 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,15 @@ jobs:
55
allow_failures:
66
- stage: build
77
os: osx
8-
go: 1.17.x
98
env:
109
- azure-osx
11-
- azure-ios
12-
- cocoapods-ios
1310

1411
include:
1512
# This builder only tests code linters on latest version of Go
1613
- stage: lint
1714
os: linux
1815
dist: bionic
19-
go: 1.18.x
16+
go: 1.21.x
2017
env:
2118
- lint
2219
git:
@@ -31,7 +28,7 @@ jobs:
3128
os: linux
3229
arch: amd64
3330
dist: bionic
34-
go: 1.18.x
31+
go: 1.21.x
3532
env:
3633
- docker
3734
services:
@@ -48,7 +45,7 @@ jobs:
4845
os: linux
4946
arch: arm64
5047
dist: bionic
51-
go: 1.18.x
48+
go: 1.21.x
5249
env:
5350
- docker
5451
services:
@@ -60,37 +57,13 @@ jobs:
6057
script:
6158
- go run build/ci.go docker -image -manifest amd64,arm64 -upload ethereum/client-go
6259

63-
# This builder does the Ubuntu PPA upload
64-
- stage: build
65-
if: type = push
66-
os: linux
67-
dist: bionic
68-
go: 1.18.x
69-
env:
70-
- ubuntu-ppa
71-
- GO111MODULE=on
72-
git:
73-
submodules: false # avoid cloning ethereum/tests
74-
addons:
75-
apt:
76-
packages:
77-
- devscripts
78-
- debhelper
79-
- dput
80-
- fakeroot
81-
- python-bzrlib
82-
- python-paramiko
83-
script:
84-
- echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts
85-
- go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder <[email protected]>"
86-
8760
# This builder does the Linux Azure uploads
8861
- stage: build
8962
if: type = push
9063
os: linux
9164
dist: bionic
9265
sudo: required
93-
go: 1.18.x
66+
go: 1.21.x
9467
env:
9568
- azure-linux
9669
- GO111MODULE=on
@@ -120,112 +93,81 @@ jobs:
12093
- go run build/ci.go install -dlgo -arch arm64 -cc aarch64-linux-gnu-gcc
12194
- go run build/ci.go archive -arch arm64 -type tar -signer LINUX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
12295

123-
# This builder does the Android Maven and Azure uploads
124-
- stage: build
125-
if: type = push
126-
os: linux
127-
dist: bionic
128-
addons:
129-
apt:
130-
packages:
131-
- openjdk-8-jdk
132-
env:
133-
- azure-android
134-
- maven-android
135-
- GO111MODULE=on
136-
git:
137-
submodules: false # avoid cloning ethereum/tests
138-
before_install:
139-
# Install Android and it's dependencies manually, Travis is stale
140-
- export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
141-
- curl https://dl.google.com/android/repository/commandlinetools-linux-6858069_latest.zip -o android.zip
142-
- unzip -q android.zip -d $HOME/sdk && rm android.zip
143-
- mv $HOME/sdk/cmdline-tools $HOME/sdk/latest && mkdir $HOME/sdk/cmdline-tools && mv $HOME/sdk/latest $HOME/sdk/cmdline-tools
144-
- export PATH=$PATH:$HOME/sdk/cmdline-tools/latest/bin
145-
- export ANDROID_HOME=$HOME/sdk
146-
147-
- yes | sdkmanager --licenses >/dev/null
148-
- sdkmanager "platform-tools" "platforms;android-15" "platforms;android-19" "platforms;android-24" "ndk-bundle"
149-
150-
# Install Go to allow building with
151-
- curl https://dl.google.com/go/go1.18.linux-amd64.tar.gz | tar -xz
152-
- export PATH=`pwd`/go/bin:$PATH
153-
- export GOROOT=`pwd`/go
154-
- export GOPATH=$HOME/go
155-
script:
156-
# Build the Android archive and upload it to Maven Central and Azure
157-
- mkdir -p $GOPATH/src/github.com/ethereum
158-
- ln -s `pwd` $GOPATH/src/github.com/ethereum/go-ethereum
159-
- go run build/ci.go aar -signer ANDROID_SIGNING_KEY -signify SIGNIFY_KEY -deploy https://oss.sonatype.org -upload gethstore/builds
160-
161-
# This builder does the OSX Azure, iOS CocoaPods and iOS Azure uploads
96+
# This builder does the OSX Azure uploads
16297
- stage: build
16398
if: type = push
16499
os: osx
165-
go: 1.18.x
100+
go: 1.21.x
166101
env:
167102
- azure-osx
168-
- azure-ios
169-
- cocoapods-ios
170103
- GO111MODULE=on
171104
git:
172105
submodules: false # avoid cloning ethereum/tests
173106
script:
174107
- go run build/ci.go install -dlgo
175108
- go run build/ci.go archive -type tar -signer OSX_SIGNING_KEY -signify SIGNIFY_KEY -upload gethstore/builds
176109

177-
# Build the iOS framework and upload it to CocoaPods and Azure
178-
- gem uninstall cocoapods -a -x
179-
- gem install cocoapods
180-
181-
- mv ~/.cocoapods/repos/master ~/.cocoapods/repos/master.bak
182-
- sed -i '.bak' 's/repo.join/!repo.join/g' $(dirname `gem which cocoapods`)/cocoapods/sources_manager.rb
183-
- if [ "$TRAVIS_PULL_REQUEST" = "false" ]; then git clone --depth=1 https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master && pod setup --verbose; fi
184-
185-
- xctool -version
186-
- xcrun simctl list
187-
188-
# Workaround for https://github.com/golang/go/issues/23749
189-
- export CGO_CFLAGS_ALLOW='-fmodules|-fblocks|-fobjc-arc'
190-
- go run build/ci.go xcode -signer IOS_SIGNING_KEY -signify SIGNIFY_KEY -deploy trunk -upload gethstore/builds
191-
192110
# These builders run the tests
193111
- stage: build
194112
os: linux
195113
arch: amd64
196114
dist: bionic
197-
go: 1.18.x
115+
go: 1.21.x
198116
env:
199117
- GO111MODULE=on
200118
script:
201-
- go run build/ci.go test -coverage $TEST_PACKAGES
119+
- go run build/ci.go test $TEST_PACKAGES
202120

203121
- stage: build
204122
if: type = pull_request
205123
os: linux
206124
arch: arm64
207125
dist: bionic
208-
go: 1.18.x
126+
go: 1.20.x
209127
env:
210128
- GO111MODULE=on
211129
script:
212-
- go run build/ci.go test -coverage $TEST_PACKAGES
130+
- go run build/ci.go test $TEST_PACKAGES
213131

214132
- stage: build
215133
os: linux
216134
dist: bionic
217-
go: 1.17.x
135+
go: 1.20.x
218136
env:
219137
- GO111MODULE=on
220138
script:
221-
- go run build/ci.go test -coverage $TEST_PACKAGES
139+
- go run build/ci.go test $TEST_PACKAGES
140+
141+
# This builder does the Ubuntu PPA nightly uploads
142+
- stage: build
143+
if: type = cron || (type = push && tag ~= /^v[0-9]/)
144+
os: linux
145+
dist: bionic
146+
go: 1.21.x
147+
env:
148+
- ubuntu-ppa
149+
- GO111MODULE=on
150+
git:
151+
submodules: false # avoid cloning ethereum/tests
152+
addons:
153+
apt:
154+
packages:
155+
- devscripts
156+
- debhelper
157+
- dput
158+
- fakeroot
159+
- python-bzrlib
160+
- python-paramiko
161+
script:
162+
- echo '|1|7SiYPr9xl3uctzovOTj4gMwAC1M=|t6ReES75Bo/PxlOPJ6/GsGbTrM0= ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA0aKz5UTUndYgIGG7dQBV+HaeuEZJ2xPHo2DS2iSKvUL4xNMSAY4UguNW+pX56nAQmZKIZZ8MaEvSj6zMEDiq6HFfn5JcTlM80UwlnyKe8B8p7Nk06PPQLrnmQt5fh0HmEcZx+JU9TZsfCHPnX7MNz4ELfZE6cFsclClrKim3BHUIGq//t93DllB+h4O9LHjEUsQ1Sr63irDLSutkLJD6RXchjROXkNirlcNVHH/jwLWR5RcYilNX7S5bIkK8NlWPjsn/8Ua5O7I9/YoE97PpO6i73DTGLh5H9JN/SITwCKBkgSDWUt61uPK3Y11Gty7o2lWsBjhBUm2Y38CBsoGmBw==' >> ~/.ssh/known_hosts
163+
- go run build/ci.go debsrc -upload ethereum/ethereum -sftp-user geth-ci -signer "Go Ethereum Linux Builder <[email protected]>"
222164

223165
# This builder does the Azure archive purges to avoid accumulating junk
224166
- stage: build
225167
if: type = cron
226168
os: linux
227169
dist: bionic
228-
go: 1.18.x
170+
go: 1.21.x
229171
env:
230172
- azure-purge
231173
- GO111MODULE=on
@@ -239,9 +181,9 @@ jobs:
239181
if: type = cron
240182
os: linux
241183
dist: bionic
242-
go: 1.18.x
184+
go: 1.21.x
243185
env:
244186
- GO111MODULE=on
245187
script:
246-
- go run build/ci.go test -race -coverage $TEST_PACKAGES
188+
- go run build/ci.go test -race $TEST_PACKAGES
247189

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.19-alpine as builder
7+
FROM golang:1.21-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

Dockerfile.alltools

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ARG VERSION=""
44
ARG BUILDNUM=""
55

66
# Build Geth in a stock Go builder container
7-
FROM golang:1.19-alpine as builder
7+
FROM golang:1.20-alpine as builder
88

99
RUN apk add --no-cache gcc musl-dev linux-headers git
1010

accounts/keystore/account_cache_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func TestWatchNoDir(t *testing.T) {
9595
t.Parallel()
9696

9797
// Create ks but not the directory that it watches.
98-
rand.Seed(time.Now().UnixNano())
98+
//rand.Seed(time.Now().UnixNano()) // quorum: deprecated after go upgrade
9999
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-watch-test-%d-%d", os.Getpid(), rand.Int()))
100100
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
101101

@@ -321,7 +321,7 @@ func TestUpdatedKeyfileContents(t *testing.T) {
321321
t.Parallel()
322322

323323
// Create a temporary kesytore to test with
324-
rand.Seed(time.Now().UnixNano())
324+
//rand.Seed(time.Now().UnixNano()) // quorum: deprecated after go upgrade
325325
dir := filepath.Join(os.TempDir(), fmt.Sprintf("eth-keystore-watch-test-%d-%d", os.Getpid(), rand.Int()))
326326
ks := NewKeyStore(dir, LightScryptN, LightScryptP)
327327

accounts/pluggable/wallet_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package pluggable
22

33
import (
4+
crand "crypto/rand"
45
"math/big"
5-
"math/rand"
66
"testing"
77

88
"github.com/ethereum/go-ethereum/accounts"
@@ -282,7 +282,7 @@ func TestWallet_SignTx(t *testing.T) {
282282
hashToSign := tt.signer.Hash(toSign)
283283

284284
mockSig := make([]byte, 65)
285-
rand.Read(mockSig)
285+
crand.Read(mockSig) // quorum: math/rand.Read deprecated after go upgrade
286286

287287
mockClient := mock_plugin.NewMockService(ctrl)
288288
mockClient.
@@ -370,7 +370,7 @@ func TestWallet_SignTxWithPassphrase(t *testing.T) {
370370
hashToSign := tt.signer.Hash(toSign)
371371

372372
mockSig := make([]byte, 65)
373-
rand.Read(mockSig)
373+
crand.Read(mockSig) // quorum: math/rand.Read deprecated after go upgrade
374374

375375
mockClient := mock_plugin.NewMockService(ctrl)
376376
mockClient.

build/checksums.txt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
# This file contains sha256 checksums of optional build dependencies.
22

3-
8e486e8e85a281fc5ce3f0bedc5b9d2dbf6276d7db0b25d3ec034f313da0375f go1.19.5.src.tar.gz
4-
23d22bb6571bbd60197bee8aaa10e702f9802786c2e2ddce5c84527e86b66aa0 go1.19.5.darwin-amd64.tar.gz
5-
4a67f2bf0601afe2177eb58f825adf83509511d77ab79174db0712dc9efa16c8 go1.19.5.darwin-arm64.tar.gz
6-
b18a5e1e60130003896e1d1c8a9e142c7cccf6f5063d52c55dd42006434419c1 go1.19.5.freebsd-386.tar.gz
7-
317996f7427691ff3a7ffd1b6aa089b9c66cd76f32e9107443f2f6aad1bb568a go1.19.5.freebsd-amd64.tar.gz
8-
f68331aa7458a3598060595f5601d5731fd452bb2c62ff23095ddad68854e510 go1.19.5.linux-386.tar.gz
9-
36519702ae2fd573c9869461990ae550c8c0d955cd28d2827a6b159fda81ff95 go1.19.5.linux-amd64.tar.gz
10-
fc0aa29c933cec8d76f5435d859aaf42249aa08c74eb2d154689ae44c08d23b3 go1.19.5.linux-arm64.tar.gz
11-
ec14f04bdaf4a62bdcf8b55b9b6434cc27c2df7d214d0bb7076a7597283b026a go1.19.5.linux-armv6l.tar.gz
12-
e4032e7c52ebc48bad5c58ba8de0759b6091d9b1e59581a8a521c8c9d88dbe93 go1.19.5.linux-ppc64le.tar.gz
13-
764871cbca841a99a24e239b63c68a4aaff4104658e3165e9ca450cac1fcbea3 go1.19.5.linux-s390x.tar.gz
14-
8873f5871d996106b701febd979c5af022e6ea58bdbbb3817a28ab948b22c286 go1.19.5.windows-386.zip
15-
167db91a2e40aeb453d3e59d213ecab06f62e1c4a84d13a06ccda1d999961caa go1.19.5.windows-amd64.zip
16-
85a75555e82d8aa6f486d8d29491c593389682acce9f0c270090d5938eee30ef go1.19.5.windows-arm64.zip
3+
818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a go1.21.0.src.tar.gz
4+
b314de9f704ab122c077d2ec8e67e3670affe8865479d1f01991e7ac55d65e70 go1.21.0.darwin-amd64.tar.gz
5+
3aca44de55c5e098de2f406e98aba328898b05d509a2e2a356416faacf2c4566 go1.21.0.darwin-arm64.tar.gz
6+
312a0065714a50862af714e7a5b3fbbd70fe68f905ffb9bcc56d42eadf6bffab go1.21.0.freebsd-386.tar.gz
7+
b8eaa36654625df799654f77f4af0ea7bd9e5e760ebe86e68fe7c484748ae995 go1.21.0.freebsd-amd64.tar.gz
8+
0e6f378d9b072fab0a3d9ff4d5e990d98487d47252dba8160015a61e6bd0bcba go1.21.0.linux-386.tar.gz
9+
d0398903a16ba2232b389fb31032ddf57cac34efda306a0eebac34f0965a0742 go1.21.0.linux-amd64.tar.gz
10+
f3d4548edf9b22f26bbd49720350bbfe59d75b7090a1a2bff1afad8214febaf3 go1.21.0.linux-arm64.tar.gz
11+
e377a0004957c8c560a3ff99601bce612330a3d95ba3b0a2ae144165fc87deb1 go1.21.0.linux-armv6l.tar.gz
12+
e938ffc81d8ebe5efc179240960ba22da6a841ff05d5cab7ce2547112b14a47f go1.21.0.linux-ppc64le.tar.gz
13+
be7338df8e5d5472dfa307b0df2b446d85d001b0a2a3cdb1a14048d751b70481 go1.21.0.linux-s390x.tar.gz
14+
af920fbb74fc3d173118dc3cc35f02a709c1de642700e92a91a7d16981df3fec go1.21.0.windows-386.zip
15+
732121e64e0ecb07c77fdf6cc1bc5ce7b242c2d40d4ac29021ad4c64a08731f6 go1.21.0.windows-amd64.zip
16+
41342f5a0f8c083b14c68bde738ddcd313a4f53a5854bfdfab47f0e88247de12 go1.21.0.windows-arm64.zip
17+
1718

1819
fba08acc4027f69f07cef48fbff70b8a7ecdfaa1c2aba9ad3fb31d60d9f5d4bc golangci-lint-1.51.1-darwin-amd64.tar.gz
1920
75b8f0ff3a4e68147156be4161a49d4576f1be37a0b506473f8c482140c1e7f2 golangci-lint-1.51.1-darwin-arm64.tar.gz
@@ -41,3 +42,6 @@ c4f58b7e227b9fd41f0e9310dc83f4a4e7d026598e2f6e95b78761081a6d9bd2 golangci-lint-
4142
eb57f9bcb56646f2e3d6ccaf02ec227815fb05077b2e0b1bf9e755805acdc2b9 golangci-lint-1.51.1-windows-arm64.zip
4243
bce02f7232723cb727755ee11f168a700a00896a25d37f87c4b173bce55596b4 golangci-lint-1.51.1-windows-armv6.zip
4344
cf6403f84707ce8c98664736772271bc8874f2e760c2fd0f00cf3e85963507e9 golangci-lint-1.51.1-windows-armv7.zip
45+
46+
# This is the builder on PPA that will build Go itself (inception-y), don't modify!
47+
d7f0013f82e6d7f862cc6cb5c8cdb48eef5f2e239b35baa97e2f1a7466043767 go1.19.6.src.tar.gz

0 commit comments

Comments
 (0)