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

build: update runner and go version #1260

Merged
merged 6 commits into from
Aug 27, 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
23 changes: 11 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ jobs:
with:
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.23.x

- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
Expand All @@ -30,14 +30,13 @@ jobs:
find . -type f -name '*.go' -exec sed -i 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
# on macos: find . -type f -name '*.go' -exec sed -i '' -E 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
version: v1.60
args: -v --timeout=5m
skip-pkg-cache: true

test:
runs-on: ubuntu-22.04-16core
runs-on: ubuntu-latest-128
permissions:
pull-requests: write
outputs:
Expand All @@ -46,15 +45,15 @@ jobs:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.23.x

- name: install deps
run: |
go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
go install github.com/consensys/gnark-solidity-checker@latest
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.12.0
go install github.com/consensys/gnark-solidity-checker@v0.1.0
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.8
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
Expand Down Expand Up @@ -98,7 +97,7 @@ jobs:
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
Expand All @@ -123,7 +122,7 @@ jobs:
steps:
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
Expand Down
23 changes: 11 additions & 12 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ jobs:
with:
fetch-depth: 0
- name: install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: 1.21.x
go-version: 1.23.x

- name: install deps
run: go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
Expand All @@ -33,35 +33,34 @@ jobs:
find . -type f -name '*.go' -exec sed -i 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
# on macos: find . -type f -name '*.go' -exec sed -i '' -E 's/Code generated by .* DO NOT EDIT/FOO/g' {} \;
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.54
version: v1.60
args: -v --timeout=5m
skip-pkg-cache: true

test:
strategy:
matrix:
go-version: [1.21.x]
os: [ubuntu-22.04-16core, windows-latest, macos-latest]
go-version: [1.23.x]
os: [ubuntu-latest-128, windows-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs:
- staticcheck
steps:
- name: checkout code
uses: actions/checkout@v4
- name: install Go
uses: actions/setup-go@v4
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: install deps
run: |
go install golang.org/x/tools/cmd/goimports@latest && go install github.com/klauspost/asmfmt/cmd/asmfmt@latest
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.12.0
go install github.com/ethereum/go-ethereum/cmd/abigen@v1.14.8
- name: install solc deps
if: startsWith(matrix.os, 'ubuntu') == true
run: |
go install github.com/consensys/gnark-solidity-checker@latest
go install github.com/consensys/gnark-solidity-checker@v0.1.0
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install solc
Expand Down Expand Up @@ -93,7 +92,7 @@ jobs:
steps:
- name: Notify slack -- workflow failed
id: slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
Expand All @@ -118,7 +117,7 @@ jobs:
steps:
- name: Notify slack -- workflow succeeded
id: slack
uses: slackapi/slack-github-action@v1.24.0
uses: slackapi/slack-github-action@v1.26.0
with:
payload: |
{
Expand Down
7 changes: 6 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ linters:
- gosimple
- govet
- ineffassign

- misspell

linters-settings:
gosec:
excludes:
- G115 # Conversions from int -> uint etc.
run:
issues-exit-code: 1
2 changes: 1 addition & 1 deletion backend/groth16/bn254/solidity.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ contract Verifier {
}

/// Square test in Fp.
/// @notice Returns wheter a number x exists such that x * x = a in Fp.
/// @notice Returns whether a number x exists such that x * x = a in Fp.
/// @notice Will revert with InvalidProof() if the input is not a square
/// or not reduced.
/// @param a the square
Expand Down
4 changes: 2 additions & 2 deletions backend/witness/witness.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (w *witness) ToJSON(s *schema.Schema) ([]byte, error) {
if s.NbPublic != int(w.nbPublic) || (w.nbSecret != 0 && w.nbSecret != uint32(s.NbSecret)) {
return nil, errors.New("schema is inconsistent with Witness")
}
typ := reflect.PtrTo(leafType(w.vector))
typ := reflect.PointerTo(leafType(w.vector))
instance := s.Instantiate(typ)

chValues := w.iterate()
Expand Down Expand Up @@ -308,7 +308,7 @@ func (w *witness) ToJSON(s *schema.Schema) ([]byte, error) {
// This is a convenience method and should be avoided in most cases.
func (w *witness) FromJSON(s *schema.Schema, data []byte) error {
typ := leafType(w.vector)
ptrTyp := reflect.PtrTo(typ)
ptrTyp := reflect.PointerTo(typ)

// we instantiate an object matching the schema, with leaf type == field element
// note that we pass a pointer here to have nil for zero values
Expand Down
32 changes: 16 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
module github.com/consensys/gnark

go 1.21
go 1.22

toolchain go1.21.4
toolchain go1.22.6

require (
github.com/bits-and-blooms/bitset v1.8.0
github.com/bits-and-blooms/bitset v1.14.2
github.com/blang/semver/v4 v4.0.0
github.com/consensys/bavard v0.1.13
github.com/consensys/compress v0.2.5
github.com/consensys/gnark-crypto v0.13.1-0.20240802214859-ff4c0ddbe1ef
github.com/fxamacker/cbor/v2 v2.5.0
github.com/google/go-cmp v0.5.9
github.com/google/pprof v0.0.0-20230817174616-7a8ec2ada47b
github.com/fxamacker/cbor/v2 v2.7.0
github.com/google/go-cmp v0.6.0
github.com/google/pprof v0.0.0-20240727154555-813a5fbdbec8
github.com/icza/bitio v1.1.0
github.com/ingonyama-zk/iciclegnark v0.1.0
github.com/leanovate/gopter v0.2.9
github.com/leanovate/gopter v0.2.11
github.com/ronanh/intcomp v1.1.0
github.com/rs/zerolog v1.30.0
github.com/stretchr/testify v1.8.4
golang.org/x/crypto v0.17.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/sync v0.3.0
github.com/rs/zerolog v1.33.0
github.com/stretchr/testify v1.9.0
golang.org/x/crypto v0.26.0
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948
golang.org/x/sync v0.8.0
)

require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/ingonyama-zk/icicle v0.0.0-20230928131117-97f0079e5c71 // indirect
github.com/ingonyama-zk/icicle v1.1.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/x448/float16 v0.8.4 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/sys v0.24.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading
Loading