Skip to content

Commit

Permalink
Remove spurious gRPC changes and golang version bump (#1762)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Aug 9, 2022
1 parent f63feca commit 559ce15
Show file tree
Hide file tree
Showing 23 changed files with 46 additions and 59 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/build-and-test-mac-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 4 additions & 6 deletions .github/workflows/build-linux-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-public-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build-ubuntu-amd64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/build-ubuntu-arm64-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build-win-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 2 additions & 3 deletions .github/workflows/test.e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ linters:
disable-all: true
enable:
- asciicheck
- bodyclose
- deadcode
- depguard
- errcheck
Expand All @@ -41,7 +42,6 @@ linters:
- unconvert
- whitespace
- staticcheck
# - bodyclose
# - structcheck
# - lll
# - gomnd
Expand All @@ -53,7 +53,7 @@ linters:

linters-settings:
staticcheck:
go: "1.18"
go: "1.17"
# https://staticcheck.io/docs/options#checks
checks:
- "all"
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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++

Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
)
Expand Down
3 changes: 1 addition & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion proto/Dockerfile.buf
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
3 changes: 2 additions & 1 deletion scripts/build_avalanche.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion scripts/build_coreth.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 2 additions & 1 deletion scripts/local.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 0 additions & 1 deletion vms/rpcchainvm/grpcutils/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ var (
grpc.WithDefaultCallOptions(
grpc.MaxCallRecvMsgSize(math.MaxInt),
grpc.MaxCallSendMsgSize(math.MaxInt),
grpc.WaitForReady(true),
),
grpc.WithKeepaliveParams(keepalive.ClientParameters{
Time: defaultClientKeepAliveTime,
Expand Down
2 changes: 1 addition & 1 deletion vms/rpcchainvm/vm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 559ce15

Please sign in to comment.