Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies & misc #1838

Merged
merged 6 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: 1.20.4
go-version: 1.21.8

# Makes sure the artifacts are built correctly
- name: Build
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,17 @@ jobs:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v4
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: 1.20.4
- uses: actions/checkout@v3
go-version: '1.21'
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v4
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.52.2
args: --timeout=5m --verbose
# Require: The version of golangci-lint to use.
# When `install-mode` is `binary` (default) the value can be v1.2 or v1.2.3 or `latest` to use the latest version.
# When `install-mode` is `goinstall` the value can be v1.2.3, `latest`, or the hash of a commit.
version: v1.54
skip-pkg-cache: true

# Optional: working directory, useful for monorepos
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: 1.20.4
go-version: 1.21.8

- name: 'Login via Azure CLI'
uses: azure/login@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-deploy-testnet-validator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: 1.20.4
go-version: 1.21.8

- name: 'Login via Azure CLI'
uses: azure/login@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/manual-upgrade-testnet-l2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:

- uses: actions/setup-go@v4
with:
go-version: 1.20.4
go-version: 1.21.8

- name: 'Print GitHub variables'
# This is a useful record of what the environment variables were at the time the job ran, for debugging and reference
Expand Down
124 changes: 48 additions & 76 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,88 +1,60 @@
# This file configures github.com/golangci/golangci-lint.

run:
skip-dirs:
- design
- docs
timeout: 20m
tests: true
# default is true. Enables skipping of directories:
# vendor$, third_party$, testdata$, examples$, Godeps$, builtin$
skip-dirs-use-default: true
skip-files:
- core/genesis_alloc.go

linters:
# Disable all linters.
# Default: false
disable-all: true
# Enable specific linter
# https://golangci-lint.run/usage/linters/#enabled-by-default-linters
enable:
- asciicheck
- bidichk
- bodyclose
- contextcheck
- depguard
- dogsled
- dupl
- durationcheck
- errcheck
- errname
- errorlint
- exhaustive
- exportloopref
- gochecknoinits
- gocognit
- goconst
- gocyclo
- gofmt
- gofumpt # https://github.com/mvdan/gofumpt#gofumpt -> gofumpt -l -w .
- goheader
- goimports
- revive
#- gomoddirectives It complains with docker import fix
- gomodguard
- goprintffuncname
- gosec
- gosimple
- govet
- importas
- ineffassign
- makezero
- misspell
- nakedret
- nestif
- nilerr
- nilnil
- noctx
- nolintlint
- prealloc
- predeclared
- promlinter
- revive
- rowserrcheck
- sqlclosecheck
- staticcheck
- stylecheck
- tagliatelle
- tenv
- tparallel
- typecheck
- unconvert
- unparam
- typecheck
- unused
- wastedassign
- staticcheck
- bidichk
- durationcheck
- exportloopref
- whitespace
# - cyclop Would be nice to enable this
# - wrapcheck Helpful to add error tracing
# - varnamelen Handy to enforce much better readability
# - wsl would be nice to turn this on
# - forcetypeassert Usually good to enable
# - gocritic Would be nice to enabled this in the future
# - gochecknoglobals Should enable this at some stage too
# - godot
# - godox
# - goerr113
# - testpackage
# - thelper
# - nlreturn
# - paralleltest
# - interfacer
# - ireturn
# - lll
# - gomnd
# - exhaustivestruct
# - forbidigo
# - funlen
# - gci

# - structcheck # lots of false positives
# - errcheck #lot of false positives
# - contextcheck
# - errchkjson # lots of false positives
# - errorlint # this check crashes
# - exhaustive # silly check
# - makezero # false positives
# - nilerr # several intentional

linters-settings:
gofmt:
simplify: true

issues:
exclude-rules:
- path: crypto/bn256/cloudflare/optate.go
linters:
- deadcode
- staticcheck
- path: internal/build/pgp.go
text: 'SA1019: "golang.org/x/crypto/openpgp" is deprecated: this package is unmaintained except for security fixes.'
- path: core/vm/contracts.go
text: 'SA1019: "golang.org/x/crypto/ripemd160" is deprecated: RIPEMD-160 is a legacy hash and should not be used for new applications.'
- path: accounts/usbwallet/trezor.go
text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.'
- path: accounts/usbwallet/trezor/
text: 'SA1019: "github.com/golang/protobuf/proto" is deprecated: Use the "google.golang.org/protobuf/proto" package instead.'
exclude:
- 'SA1019: event.TypeMux is deprecated: use Feed'
- 'SA1019: strings.Title is deprecated'
- '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.'
- 'SA1029: should not use built-in type string as key for value'
2 changes: 1 addition & 1 deletion contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
"@openzeppelin/contracts-upgradeable": "^5.0.1",
"ethers": "^6.6.0",
"hardhat-ignore-warnings": "^0.2.6",
"ten-hardhat-plugin": "^0.0.8"
"ten-hardhat-plugin": "^0.0.9"
}
}
4 changes: 2 additions & 2 deletions dockerfiles/enclave.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Defaults to restricted flag mode
ARG TESTMODE=false

FROM ghcr.io/edgelesssys/ego-dev:v1.3.0 AS build-base
FROM ghcr.io/edgelesssys/ego-dev:v1.5.0 AS build-base

# setup container data structure
RUN mkdir -p /home/obscuro/go-obscuro
Expand Down Expand Up @@ -48,7 +48,7 @@ RUN ego sign enclave-test.json
FROM build-enclave-testmode-${TESTMODE} as build-enclave

# Trigger a new build stage and use the smaller ego version:
FROM ghcr.io/edgelesssys/ego-deploy:v1.3.0
FROM ghcr.io/edgelesssys/ego-deploy:v1.5.0

# Copy just the binary for the enclave into this build stage
COPY --from=build-enclave \
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/enclave.debug.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# build-enclave = copies over the source and builds the enclave using a go compiler cache
# final = using the base system copies over only the enclave executable and creates the final image without source and dependencies.

FROM golang:1.20-alpine3.18 as system
FROM golang:1.22.1-alpine3.19 as system

# install build utils
RUN apk add build-base
Expand Down
2 changes: 1 addition & 1 deletion dockerfiles/host.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# build-host = copies over the source code and builds the binaries using a compiler cache
# final = copies over only the executables in an alpine image that doesn't have any additional load.

FROM golang:1.20-alpine3.18 as system
FROM golang:1.22.1-alpine3.19 as system
# set the base libs to build / run
RUN apk add build-base bash
ENV CGO_ENABLED=1
Expand Down
Loading
Loading