Skip to content

Commit

Permalink
Merge pull request #136 from relab/meling/dec2024/dependencies-update
Browse files Browse the repository at this point in the history
Upgraded to Go 1.23.4 and dependencies
  • Loading branch information
meling authored Dec 18, 2024
2 parents ecadd95 + dd47473 commit 9961586
Show file tree
Hide file tree
Showing 18 changed files with 589 additions and 1,184 deletions.
6 changes: 0 additions & 6 deletions .github/codecov.yml

This file was deleted.

23 changes: 3 additions & 20 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Go Test and Coverage
name: Go Test
on:
push:
branches:
Expand All @@ -10,7 +10,7 @@ jobs:
test:
strategy:
matrix:
go-version: ["1.22.1"]
go-version: ["1.23.4"]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down Expand Up @@ -38,12 +38,7 @@ jobs:

- name: Run Go tests
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
go test -v -timeout 5m -coverpkg=./... -coverprofile=coverage.tmp.txt -covermode=atomic ./...
grep -v -E ".pb.go|_mock.go" coverage.tmp.txt > coverage.txt
else
go test -v -timeout 2m ./...
fi
go test -v -timeout 5m ./...
shell: bash
env:
HOTSTUFF_LOG: info
Expand All @@ -53,15 +48,3 @@ jobs:
run: |
cd scripts
bash deploy_test.sh
- name: Upload code coverage report to Codecov
if: runner.os == 'Linux'
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./coverage.txt
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
7 changes: 5 additions & 2 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ on:
branches:
- master
permissions:
# Required: allow read access to the content for analysis.
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
pull-requests: read
# Optional: allow write access to checks to allow the action to annotate code in the PR.
checks: write
jobs:
golangci:
name: lint
Expand All @@ -19,10 +22,10 @@ jobs:
- name: Setup Go environment
uses: actions/setup-go@v5
with:
go-version: "1.22.1"
go-version: "1.23.4"
cache: false
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
with:
version: latest
args: --timeout 5m
Expand Down
17 changes: 11 additions & 6 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
linters:
enable:
- revive
- gocyclo
- misspell
- revive
- gocyclo
- misspell

linters-settings:
gocyclo:
Expand All @@ -14,9 +14,14 @@ linters-settings:

revive:
rules:
- name: unexported-return
disabled: true
- name: unused-parameter
- name: unexported-return
disabled: true
- name: unused-parameter

staticcheck:
checks:
- all
- '-SA1019' # temporarily disable the "is deprecated" rule

issues:
exclude-use-default: false
Expand Down
1 change: 1 addition & 0 deletions .vscode/dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ ferr
fgprof
fgprofprofile
gcflags
gcov
gocyclo
golangci
golint
Expand Down
8 changes: 3 additions & 5 deletions cmd/latencygen/latency_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import (
"fmt"
"go/format"
"log"
"maps"
"os"
"sort"
"slices"
"strings"
"time"

"golang.org/x/exp/maps"
)

// Run go generate from this directory to generate the latency matrix.
Expand All @@ -30,8 +29,7 @@ func main() {
if err := json.Unmarshal([]byte(latencyMatrix), &allToAllMatrix); err != nil {
log.Fatal(err)
}
keys := maps.Keys(allToAllMatrix)
sort.Strings(keys)
keys := slices.Sorted(maps.Keys(allToAllMatrix))

s := strings.Builder{}
s.WriteString(`package backend
Expand Down
5 changes: 2 additions & 3 deletions crypto/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package crypto
import (
"container/list"
"crypto/sha256"
"maps"
"slices"
"strings"
"sync"

"github.com/relab/hotstuff"
"github.com/relab/hotstuff/modules"
"golang.org/x/exp/maps"
)

type cache struct {
Expand Down Expand Up @@ -106,8 +106,7 @@ func (cache *cache) Verify(signature hotstuff.QuorumSignature, message []byte) b
// BatchVerify verifies the given quorum signature against the batch of messages.
func (cache *cache) BatchVerify(signature hotstuff.QuorumSignature, batch map[hotstuff.ID][]byte) bool {
// sort the list of ids from the batch map
ids := maps.Keys(batch)
slices.Sort(ids)
ids := slices.Sorted(maps.Keys(batch))
var hash hotstuff.Hash
hasher := sha256.New()
// then hash the messages in sorted order
Expand Down
88 changes: 43 additions & 45 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module github.com/relab/hotstuff

go 1.22.1
go 1.23.4

require (
github.com/felixge/fgprof v0.9.4
github.com/felixge/fgprof v0.9.5
github.com/golang/mock v1.6.0
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/kilic/bls12-381 v0.1.1-0.20210208205449-6045b0235e36
github.com/mattn/go-isatty v0.0.20
Expand All @@ -14,79 +13,78 @@ require (
github.com/relab/gorums v0.7.1-0.20220818130557-8533cb369cd6
github.com/relab/iago v0.0.0-20240309193349-5be211223dec
github.com/relab/wrfs v0.0.0-20220416082020-a641cd350078
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.18.2
go-hep.org/x/hep v0.34.1
github.com/spf13/cobra v1.8.1
github.com/spf13/viper v1.19.0
go-hep.org/x/hep v0.36.0
go.uber.org/zap v1.27.0
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225
golang.org/x/time v0.5.0
gonum.org/v1/plot v0.14.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20240308144416-29370a3891b7
google.golang.org/grpc v1.62.1
google.golang.org/protobuf v1.33.0
golang.org/x/time v0.8.0
gonum.org/v1/plot v0.15.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20241216192217-9240e9c98484
google.golang.org/grpc v1.69.0
google.golang.org/protobuf v1.36.0
)

require (
git.sr.ht/~sbinet/gg v0.5.0 // indirect
git.sr.ht/~sbinet/gg v0.6.0 // indirect
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ajstarks/svgo v0.0.0-20211024235047-1546f124cd8b // indirect
github.com/alexhunt7/ssher v0.0.0-20190216204854-d36569cf7047 // indirect
github.com/campoy/embedmd v1.0.0 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/docker v25.0.5+incompatible // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.4.0+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-fonts/liberation v0.3.2 // indirect
github.com/go-latex/latex v0.0.0-20231108140139-5c1ce85aa4ea // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/go-fonts/liberation v0.3.3 // indirect
github.com/go-latex/latex v0.0.0-20240709081214-31cef3c7570e // indirect
github.com/go-logr/logr v1.4.2 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/go-pdf/fpdf v0.9.0 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/gonuts/binary v0.2.0 // indirect
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/magiconair/properties v1.8.9 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.1 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pkg/sftp v1.13.6 // indirect
github.com/pkg/sftp v1.13.7 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.49.0 // indirect
go.opentelemetry.io/otel v1.24.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 // indirect
go.opentelemetry.io/otel/metric v1.24.0 // indirect
go.opentelemetry.io/otel/sdk v1.24.0 // indirect
go.opentelemetry.io/otel/trace v1.24.0 // indirect
go.opentelemetry.io/auto/sdk v1.1.0 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.58.0 // indirect
go.opentelemetry.io/otel v1.33.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.33.0 // indirect
go.opentelemetry.io/otel/metric v1.33.0 // indirect
go.opentelemetry.io/otel/sdk v1.33.0 // indirect
go.opentelemetry.io/otel/trace v1.33.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/image v0.15.0 // indirect
golang.org/x/mod v0.16.0 // indirect
golang.org/x/net v0.22.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/tools v0.19.0 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.3.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
golang.org/x/crypto v0.31.0 // indirect
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
golang.org/x/image v0.23.0 // indirect
golang.org/x/mod v0.22.0 // indirect
golang.org/x/net v0.32.0 // indirect
golang.org/x/sync v0.10.0 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
golang.org/x/tools v0.28.0 // indirect
gonum.org/v1/gonum v0.15.1 // indirect
google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 9961586

Please sign in to comment.