From 559ce151a6b6f28d8115e0189627d8deaf00d9fb Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Tue, 9 Aug 2022 16:24:21 -0400 Subject: [PATCH] Remove spurious gRPC changes and golang version bump (#1762) --- .github/workflows/build-and-test-mac-windows.yml | 5 ++--- .github/workflows/build-and-test.yml | 5 ++--- .github/workflows/build-linux-binaries.yml | 10 ++++------ .github/workflows/build-macos-release.yml | 5 ++--- .github/workflows/build-public-api.yml | 5 ++--- .github/workflows/build-ubuntu-amd64-release.yml | 10 ++++------ .github/workflows/build-ubuntu-arm64-release.yml | 10 ++++------ .github/workflows/build-win-release.yml | 5 ++--- .github/workflows/build.yml | 5 ++--- .github/workflows/static-analysis.yaml | 5 ++--- .github/workflows/test.e2e.yml | 5 ++--- .github/workflows/test.upgrade.yml | 5 ++--- .golangci.yml | 4 ++-- Dockerfile | 3 ++- README.md | 2 +- go.mod | 5 +++-- go.sum | 3 +-- proto/Dockerfile.buf | 2 +- scripts/build_avalanche.sh | 3 ++- scripts/build_coreth.sh | 2 +- scripts/local.Dockerfile | 3 ++- vms/rpcchainvm/grpcutils/util.go | 1 - vms/rpcchainvm/vm_test.go | 2 +- 23 files changed, 46 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build-and-test-mac-windows.yml b/.github/workflows/build-and-test-mac-windows.yml index cb121d348a16..6785aa1b4a5c 100644 --- a/.github/workflows/build-and-test-mac-windows.yml +++ b/.github/workflows/build-and-test-mac-windows.yml @@ -17,10 +17,9 @@ jobs: os: [windows-latest, macos-latest] steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. # Downgrade mingw due to a regression causing tests with --race enabled to # fail. See: https://github.com/actions/virtual-environments/issues/5841 - name: Install mingw 10.2.0 diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3c73a7a8ba6e..20883a714e3f 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -9,10 +9,9 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - name: build_test shell: bash run: .github/workflows/build_and_test.sh diff --git a/.github/workflows/build-linux-binaries.yml b/.github/workflows/build-linux-binaries.yml index 2d1cdda9e2e1..c6191b464968 100644 --- a/.github/workflows/build-linux-binaries.yml +++ b/.github/workflows/build-linux-binaries.yml @@ -11,10 +11,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Build the avalanchego binaries @@ -50,10 +49,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Build the avalanchego binaries diff --git a/.github/workflows/build-macos-release.yml b/.github/workflows/build-macos-release.yml index 2f9435e79dac..8beb77cae678 100644 --- a/.github/workflows/build-macos-release.yml +++ b/.github/workflows/build-macos-release.yml @@ -19,10 +19,9 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version # Runs a single command using the runners shell diff --git a/.github/workflows/build-public-api.yml b/.github/workflows/build-public-api.yml index 4dbe6318170f..1006519d3e84 100644 --- a/.github/workflows/build-public-api.yml +++ b/.github/workflows/build-public-api.yml @@ -12,10 +12,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Install aws cli diff --git a/.github/workflows/build-ubuntu-amd64-release.yml b/.github/workflows/build-ubuntu-amd64-release.yml index 3e9668171e85..12eac14ad70b 100644 --- a/.github/workflows/build-ubuntu-amd64-release.yml +++ b/.github/workflows/build-ubuntu-amd64-release.yml @@ -11,10 +11,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Build the avalanchego binaries @@ -50,10 +49,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Build the avalanchego binaries diff --git a/.github/workflows/build-ubuntu-arm64-release.yml b/.github/workflows/build-ubuntu-arm64-release.yml index f4e43d919f94..04ce9483310f 100644 --- a/.github/workflows/build-ubuntu-arm64-release.yml +++ b/.github/workflows/build-ubuntu-arm64-release.yml @@ -11,10 +11,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Build the avalanchego binaries @@ -50,10 +49,9 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Build the avalanchego binaries diff --git a/.github/workflows/build-win-release.yml b/.github/workflows/build-win-release.yml index 404b738ab70d..5ed25df32bb1 100644 --- a/.github/workflows/build-win-release.yml +++ b/.github/workflows/build-win-release.yml @@ -18,10 +18,9 @@ jobs: steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: "1.17.9" # The Go version to download (if necessary) and use. - run: go version - name: Get the version diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b50dd81f4653..a2dfff6b956e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,10 +17,9 @@ jobs: with: fetch-depth: 0 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: 1.17 - name: Run GoReleaser uses: goreleaser/goreleaser-action@v2 with: diff --git a/.github/workflows/static-analysis.yaml b/.github/workflows/static-analysis.yaml index a3fbc1cc850b..0bd2a6d76457 100644 --- a/.github/workflows/static-analysis.yaml +++ b/.github/workflows/static-analysis.yaml @@ -15,10 +15,9 @@ jobs: - name: Checkout uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: 1.17 - name: Run static analysis tests shell: bash run: scripts/lint.sh diff --git a/.github/workflows/test.e2e.yml b/.github/workflows/test.e2e.yml index f14b2a7d310b..2367b3d10201 100644 --- a/.github/workflows/test.e2e.yml +++ b/.github/workflows/test.e2e.yml @@ -16,10 +16,9 @@ jobs: - name: Git checkout uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: 1.17.12 - name: Build the avalanchego binaries shell: bash run: ./scripts/build.sh diff --git a/.github/workflows/test.upgrade.yml b/.github/workflows/test.upgrade.yml index 042b8f86734a..5966c8fb444f 100644 --- a/.github/workflows/test.upgrade.yml +++ b/.github/workflows/test.upgrade.yml @@ -16,10 +16,9 @@ jobs: - name: Git checkout uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v2 with: - go-version: '1.18' - check-latest: true + go-version: 1.17.12 - name: Build the avalanchego binaries shell: bash run: ./scripts/build.sh diff --git a/.golangci.yml b/.golangci.yml index 632234d0b8f2..c05260477f3c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,6 +15,7 @@ linters: disable-all: true enable: - asciicheck + - bodyclose - deadcode - depguard - errcheck @@ -41,7 +42,6 @@ linters: - unconvert - whitespace - staticcheck - # - bodyclose # - structcheck # - lll # - gomnd @@ -53,7 +53,7 @@ linters: linters-settings: staticcheck: - go: "1.18" + go: "1.17" # https://staticcheck.io/docs/options#checks checks: - "all" diff --git a/Dockerfile b/Dockerfile index 8700a76f112b..9a1a745449a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,12 @@ # Changes to the minimum golang version must also be replicated in +# scripts/ansible/roles/golang_base/defaults/main.yml # scripts/build_avalanche.sh # scripts/local.Dockerfile # Dockerfile (here) # README.md # go.mod # ============= Compilation Stage ================ -FROM golang:1.18.5-buster AS builder +FROM golang:1.17.9-buster AS builder RUN apt-get update && apt-get install -y --no-install-recommends bash=5.0-4 git=1:2.20.1-2+deb10u3 make=4.2.1-1.2 gcc=4:8.3.0-1 musl-dev=1.1.21-2 ca-certificates=20200601~deb10u2 linux-headers-amd64 WORKDIR /build diff --git a/README.md b/README.md index e66c13156c19..b20f2f84ef20 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ The minimum recommended hardware specification for nodes connected to Mainnet is If you plan to build AvalancheGo from source, you will also need the following software: -- [Go](https://golang.org/doc/install) version >= 1.18.1 +- [Go](https://golang.org/doc/install) version >= 1.17.9 - [gcc](https://gcc.gnu.org/) - g++ diff --git a/go.mod b/go.mod index c8ebb4b38ce2..70f311a11f17 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,13 @@ module github.com/ava-labs/avalanchego // Changes to the minimum golang version must also be replicated in +// scripts/ansible/roles/golang_base/defaults/main.yml // scripts/build_avalanche.sh // scripts/local.Dockerfile // Dockerfile // README.md // go.mod (here, only major.minor can be specified) -go 1.18 +go 1.17 require ( github.com/Microsoft/go-winio v0.5.2 @@ -52,7 +53,7 @@ require ( golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac gonum.org/v1/gonum v0.11.0 google.golang.org/genproto v0.0.0-20220712132514-bdd2acd4974d - google.golang.org/grpc v1.48.0 + google.golang.org/grpc v1.47.0 google.golang.org/protobuf v1.28.0 gopkg.in/natefinch/lumberjack.v2 v2.0.0 ) diff --git a/go.sum b/go.sum index d7740bb7eca7..28d74c1e3dd9 100644 --- a/go.sum +++ b/go.sum @@ -814,9 +814,8 @@ google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.47.0 h1:9n77onPX5F3qfFCqjy9dhn8PbNQsIKeVU04J9G7umt8= google.golang.org/grpc v1.47.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= -google.golang.org/grpc v1.48.0 h1:rQOsyJ/8+ufEDJd/Gdsz7HG220Mh9HAhFHRGnIjda0w= -google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACuMGWk= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/proto/Dockerfile.buf b/proto/Dockerfile.buf index 31740880c611..e77d40bebd04 100644 --- a/proto/Dockerfile.buf +++ b/proto/Dockerfile.buf @@ -6,7 +6,7 @@ RUN apt-get update && apt -y install bash curl unzip git WORKDIR /opt RUN \ - curl -L https://golang.org/dl/go1.18.5.linux-amd64.tar.gz > golang.tar.gz && \ + curl -L https://golang.org/dl/go1.17.9.linux-amd64.tar.gz > golang.tar.gz && \ mkdir golang && \ tar -zxvf golang.tar.gz -C golang/ diff --git a/scripts/build_avalanche.sh b/scripts/build_avalanche.sh index b0f44dc63329..03e63eb7b555 100755 --- a/scripts/build_avalanche.sh +++ b/scripts/build_avalanche.sh @@ -5,12 +5,13 @@ set -o nounset set -o pipefail # Changes to the minimum golang version must also be replicated in +# scripts/ansible/roles/golang_base/defaults/main.yml # scripts/build_avalanche.sh (here) # scripts/local.Dockerfile # Dockerfile # README.md # go.mod -go_version_minimum="1.18.1" +go_version_minimum="1.17.9" go_version() { go version | sed -nE -e 's/[^0-9.]+([0-9.]+).+/\1/p' diff --git a/scripts/build_coreth.sh b/scripts/build_coreth.sh index 453b0b1b23c0..c16f1a69342f 100755 --- a/scripts/build_coreth.sh +++ b/scripts/build_coreth.sh @@ -33,4 +33,4 @@ go build -ldflags "-X github.com/ava-labs/coreth/plugin/evm.Version=$coreth_vers cd "$AVALANCHE_PATH" # Building coreth + using go get can mess with the go.mod file. -go mod tidy -compat=1.18 +go mod tidy -compat=1.17 diff --git a/scripts/local.Dockerfile b/scripts/local.Dockerfile index 6f65bb62964d..766eb714c021 100644 --- a/scripts/local.Dockerfile +++ b/scripts/local.Dockerfile @@ -4,12 +4,13 @@ # in order to build an image using the local version of coreth # Changes to the minimum golang version must also be replicated in +# scripts/ansible/roles/golang_base/defaults/main.yml # scripts/build_avalanche.sh # scripts/local.Dockerfile (here) # Dockerfile # README.md # go.mod -FROM golang:1.18.5-buster +FROM golang:1.17.9-buster RUN mkdir -p /go/src/github.com/ava-labs diff --git a/vms/rpcchainvm/grpcutils/util.go b/vms/rpcchainvm/grpcutils/util.go index 21aab7b9fa04..0d3367dfea97 100644 --- a/vms/rpcchainvm/grpcutils/util.go +++ b/vms/rpcchainvm/grpcutils/util.go @@ -79,7 +79,6 @@ var ( grpc.WithDefaultCallOptions( grpc.MaxCallRecvMsgSize(math.MaxInt), grpc.MaxCallSendMsgSize(math.MaxInt), - grpc.WaitForReady(true), ), grpc.WithKeepaliveParams(keepalive.ClientParameters{ Time: defaultClientKeepAliveTime, diff --git a/vms/rpcchainvm/vm_test.go b/vms/rpcchainvm/vm_test.go index 2784e26f0ebe..7fd19f54d20f 100644 --- a/vms/rpcchainvm/vm_test.go +++ b/vms/rpcchainvm/vm_test.go @@ -203,7 +203,7 @@ func testHTTPPingRequest(target, endpoint string, payload []byte) error { func testWebsocketEchoRequest(target, endpoint string, expectedMsgCount int, payload []byte) error { dialTarget := fmt.Sprintf("ws://%s%s", target, endpoint) - cli, _, err := websocket.DefaultDialer.Dial(dialTarget, nil) + cli, _, err := websocket.DefaultDialer.Dial(dialTarget, nil) //nolint if err != nil { return err }