From 08d27b768c819a9e5005d7ea27340a5502799c51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:24:54 +0000 Subject: [PATCH 01/27] build(deps): Bump github.com/vektra/mockery/v2 from 2.41.0 to 2.46.2 Bumps [github.com/vektra/mockery/v2](https://github.com/vektra/mockery) from 2.41.0 to 2.46.2. - [Release notes](https://github.com/vektra/mockery/releases) - [Changelog](https://github.com/vektra/mockery/blob/master/docs/changelog.md) - [Commits](https://github.com/vektra/mockery/compare/v2.41.0...v2.46.2) --- updated-dependencies: - dependency-name: github.com/vektra/mockery/v2 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 3 ++- go.sum | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index a59367852..74d2bd523 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/dashpay/tenderdash go 1.22 +toolchain go1.23.2 require ( github.com/BurntSushi/toml v1.3.2 @@ -52,7 +53,7 @@ require ( github.com/creachadair/taskgroup v0.3.2 github.com/go-pkgz/jrpc v0.2.0 github.com/google/go-cmp v0.6.0 - github.com/vektra/mockery/v2 v2.41.0 + github.com/vektra/mockery/v2 v2.46.2 ) require ( diff --git a/go.sum b/go.sum index 7a9a021a7..ac7e5195c 100644 --- a/go.sum +++ b/go.sum @@ -942,8 +942,8 @@ github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvni github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= -github.com/vektra/mockery/v2 v2.41.0 h1:miv6vazLja/sknB/Rv1ZyKzxOG24QJgIPNN1renwkrs= -github.com/vektra/mockery/v2 v2.41.0/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= +github.com/vektra/mockery/v2 v2.46.2 h1:bpUncWvkiDzqn+aWwt4dY1aS0F8Ob4k8+WJrWU/Kh4s= +github.com/vektra/mockery/v2 v2.46.2/go.mod h1:dDivqi0ShM8A29mLgZn13yZ14MdXlTM4V360u8JDWCQ= github.com/vishvananda/netlink v1.1.0/go.mod h1:cTgwzPIzzgDAYoQrMm0EdrjRUBkTqKYppBueQtXaqoE= github.com/vishvananda/netns v0.0.0-20191106174202-0a2b9b5464df/go.mod h1:JP3t17pCcGlemwknint6hfoeCVQrEMVwxRLRjXpq+BU= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= From ed05eeaf1aaff0c636f749645cf723ddaca79bcc Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:31:03 +0200 Subject: [PATCH 02/27] chore: update deps --- .github/workflows/check-generated.yml | 2 +- go.mod | 3 ++- scripts/mockery_generate.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 3f555aed1..96e876f8d 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -31,7 +31,7 @@ jobs: run: | set -euo pipefail - readonly MOCKERY=2.41.0 # N.B. no leading "v" + readonly MOCKERY=2.46.2 # N.B. no leading "v" curl -sL "https://github.com/vektra/mockery/releases/download/v${MOCKERY}/mockery_${MOCKERY}_Linux_x86_64.tar.gz" | tar -C /usr/local/bin -xzf - make mockery 2>/dev/null diff --git a/go.mod b/go.mod index 74d2bd523..36ee9dc4b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,7 @@ module github.com/dashpay/tenderdash -go 1.22 +go 1.23 + toolchain go1.23.2 require ( diff --git a/scripts/mockery_generate.sh b/scripts/mockery_generate.sh index 1d00aef13..022f8c136 100755 --- a/scripts/mockery_generate.sh +++ b/scripts/mockery_generate.sh @@ -6,7 +6,7 @@ # runs the published Docker container. This legerdemain is so that the CI build # and a local build can work off the same script. # -VERSION=v2.41.0 +VERSION=v2.46.2 if ! mockery --version 2>/dev/null | grep $VERSION; then echo "Please install mockery $VERSION" From 35627d951c635b0e9786d60414e34f46e0747f30 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:37:22 +0200 Subject: [PATCH 03/27] build(deps): Upgrade go to 1.23 --- .github/actions/bls/action.yml | 2 +- .github/workflows/build.yml | 6 +++--- .github/workflows/check-generated.yml | 4 ++-- .github/workflows/e2e.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/tests.yml | 2 +- DOCKER/Dockerfile | 2 +- README.md | 2 +- docs/tutorials/go-built-in.md | 4 ++-- docs/tutorials/go.md | 2 +- go.mod | 2 +- test/e2e/docker/Dockerfile | 2 +- test/fuzz/README.md | 2 +- 14 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/actions/bls/action.yml b/.github/actions/bls/action.yml index ff0c6c0e6..442dc78b8 100644 --- a/.github/actions/bls/action.yml +++ b/.github/actions/bls/action.yml @@ -15,7 +15,7 @@ runs: steps: - uses: actions/setup-go@v2 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v2 with: submodules: true diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fc64049a8..633e5fd3f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: @@ -54,7 +54,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: @@ -79,7 +79,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: diff --git a/.github/workflows/check-generated.yml b/.github/workflows/check-generated.yml index 3f555aed1..851259d02 100644 --- a/.github/workflows/check-generated.yml +++ b/.github/workflows/check-generated.yml @@ -23,7 +23,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v4 @@ -49,7 +49,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v4 with: diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 132868381..78d73d22c 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -28,7 +28,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3.7.1 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 261056eb4..2aef6d749 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -32,7 +32,7 @@ jobs: submodules: true - uses: actions/setup-go@v5.0.1 with: - go-version: "^1.22" + go-version: "^1.23" - uses: technote-space/get-diff-action@v6 with: PATTERNS: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b982c6c52..972ac0308 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - name: Build uses: goreleaser/goreleaser-action@v6 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b84ea85ac..2bb4cc2ad 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/setup-go@v5.0.1 with: - go-version: "1.22" + go-version: "1.23" - uses: actions/checkout@v4 - uses: technote-space/get-diff-action@v6 with: diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index 6092fa600..cf8f11175 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -5,7 +5,7 @@ # * image - creates final image of minimal size ARG ALIPNE_VERSION=3.19 -ARG GOLANG_VERSION=1.22 +ARG GOLANG_VERSION=1.23 ################################# # STAGE 1: install dependencies # ################################# diff --git a/README.md b/README.md index 11484783d..4f4ee8cfc 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ requirements if installing from source. | Requirement | Notes | |-------------|------------------| -| Go version | Go1.22 or higher | +| Go version | Go1.23 or higher | ## Versioning diff --git a/docs/tutorials/go-built-in.md b/docs/tutorials/go-built-in.md index 3568be773..9048130e1 100644 --- a/docs/tutorials/go-built-in.md +++ b/docs/tutorials/go-built-in.md @@ -43,7 +43,7 @@ Verify that you have the latest version of Go installed: ```sh $ go version -go version go1.22.x darwin/amd64 +go version go1.23.x darwin/amd64 ``` Note that the exact patch number may differ as Go releases come out. @@ -596,7 +596,7 @@ This will populate the `go.mod` with a release number followed by a hash for Ten ```go module github.com//kvstore -go 1.22 +go 1.23 require ( github.com/dgraph-io/badger/v3 v3.2103.2 diff --git a/docs/tutorials/go.md b/docs/tutorials/go.md index 25b4deb6a..8ca6f23a8 100644 --- a/docs/tutorials/go.md +++ b/docs/tutorials/go.md @@ -454,7 +454,7 @@ This will populate the `go.mod` with a release number followed by a hash for Ten ```go module github.com//kvstore -go 1.22 +go 1.23 require ( github.com/dgraph-io/badger/v3 v3.2103.2 diff --git a/go.mod b/go.mod index a59367852..83b35dd87 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/dashpay/tenderdash -go 1.22 +go 1.23 require ( github.com/BurntSushi/toml v1.3.2 diff --git a/test/e2e/docker/Dockerfile b/test/e2e/docker/Dockerfile index db5c852c7..6bc47707f 100644 --- a/test/e2e/docker/Dockerfile +++ b/test/e2e/docker/Dockerfile @@ -1,6 +1,6 @@ ## Stage 1 and 2 is copied from /DOCKER/Dockerfile ARG ALIPNE_VERSION=3.19 -ARG GOLANG_VERSION=1.22 +ARG GOLANG_VERSION=1.23 ################################# # STAGE 1: install dependencies # ################################# diff --git a/test/fuzz/README.md b/test/fuzz/README.md index 2a16020eb..c0d141492 100644 --- a/test/fuzz/README.md +++ b/test/fuzz/README.md @@ -1,7 +1,7 @@ # fuzz Fuzzing for various packages in Tendermint using the fuzzing infrastructure included in -Go 1.22. +Go 1.23. Inputs: From e924ddc7d15e8fd12b6898c85931b7c027c166a9 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:40:38 +0200 Subject: [PATCH 04/27] chore: trigger workflow --- internal/state/mocks/store.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index 006a8b4e0..3dd34f27d 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -1,5 +1,6 @@ // Code generated by mockery. DO NOT EDIT. + package mocks import ( From f7430f287b1539d0bd28c57225f9a08b4dd24d2e Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:06:48 +0200 Subject: [PATCH 05/27] chore: make mockery --- internal/p2p/client/mocks/block_client.go | 4 ++-- internal/p2p/mocks/connection.go | 17 +++++++---------- internal/p2p/mocks/transport.go | 7 ++----- internal/state/mocks/store.go | 1 - libs/store/mocks/store.go | 4 ++-- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/internal/p2p/client/mocks/block_client.go b/internal/p2p/client/mocks/block_client.go index 5d1e5a90c..5afae1d30 100644 --- a/internal/p2p/client/mocks/block_client.go +++ b/internal/p2p/client/mocks/block_client.go @@ -68,7 +68,7 @@ func (_m *BlockClient) GetSyncStatus(ctx context.Context) error { } // Send provides a mock function with given fields: ctx, msg -func (_m *BlockClient) Send(ctx context.Context, msg interface{}) error { +func (_m *BlockClient) Send(ctx context.Context, msg any) error { ret := _m.Called(ctx, msg) if len(ret) == 0 { @@ -76,7 +76,7 @@ func (_m *BlockClient) Send(ctx context.Context, msg interface{}) error { } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, interface{}) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, any) error); ok { r0 = rf(ctx, msg) } else { r0 = ret.Error(0) diff --git a/internal/p2p/mocks/connection.go b/internal/p2p/mocks/connection.go index 879950b6a..8555ef9e3 100644 --- a/internal/p2p/mocks/connection.go +++ b/internal/p2p/mocks/connection.go @@ -5,10 +5,7 @@ package mocks import ( context "context" - conn "github.com/dashpay/tenderdash/internal/p2p/conn" - crypto "github.com/dashpay/tenderdash/crypto" - mock "github.com/stretchr/testify/mock" p2p "github.com/dashpay/tenderdash/internal/p2p" @@ -97,23 +94,23 @@ func (_m *Connection) LocalEndpoint() p2p.Endpoint { } // ReceiveMessage provides a mock function with given fields: _a0 -func (_m *Connection) ReceiveMessage(_a0 context.Context) (conn.ChannelID, []byte, error) { +func (_m *Connection) ReceiveMessage(_a0 context.Context) (p2p.ChannelID, []byte, error) { ret := _m.Called(_a0) if len(ret) == 0 { panic("no return value specified for ReceiveMessage") } - var r0 conn.ChannelID + var r0 p2p.ChannelID var r1 []byte var r2 error - if rf, ok := ret.Get(0).(func(context.Context) (conn.ChannelID, []byte, error)); ok { + if rf, ok := ret.Get(0).(func(context.Context) (p2p.ChannelID, []byte, error)); ok { return rf(_a0) } - if rf, ok := ret.Get(0).(func(context.Context) conn.ChannelID); ok { + if rf, ok := ret.Get(0).(func(context.Context) p2p.ChannelID); ok { r0 = rf(_a0) } else { - r0 = ret.Get(0).(conn.ChannelID) + r0 = ret.Get(0).(p2p.ChannelID) } if rf, ok := ret.Get(1).(func(context.Context) []byte); ok { @@ -152,7 +149,7 @@ func (_m *Connection) RemoteEndpoint() p2p.Endpoint { } // SendMessage provides a mock function with given fields: _a0, _a1, _a2 -func (_m *Connection) SendMessage(_a0 context.Context, _a1 conn.ChannelID, _a2 []byte) error { +func (_m *Connection) SendMessage(_a0 context.Context, _a1 p2p.ChannelID, _a2 []byte) error { ret := _m.Called(_a0, _a1, _a2) if len(ret) == 0 { @@ -160,7 +157,7 @@ func (_m *Connection) SendMessage(_a0 context.Context, _a1 conn.ChannelID, _a2 [ } var r0 error - if rf, ok := ret.Get(0).(func(context.Context, conn.ChannelID, []byte) error); ok { + if rf, ok := ret.Get(0).(func(context.Context, p2p.ChannelID, []byte) error); ok { r0 = rf(_a0, _a1, _a2) } else { r0 = ret.Error(0) diff --git a/internal/p2p/mocks/transport.go b/internal/p2p/mocks/transport.go index 6fbaccaca..5ffc747d2 100644 --- a/internal/p2p/mocks/transport.go +++ b/internal/p2p/mocks/transport.go @@ -5,11 +5,8 @@ package mocks import ( context "context" - conn "github.com/dashpay/tenderdash/internal/p2p/conn" - - mock "github.com/stretchr/testify/mock" - p2p "github.com/dashpay/tenderdash/internal/p2p" + mock "github.com/stretchr/testify/mock" ) // Transport is an autogenerated mock type for the Transport type @@ -48,7 +45,7 @@ func (_m *Transport) Accept(_a0 context.Context) (p2p.Connection, error) { } // AddChannelDescriptors provides a mock function with given fields: _a0 -func (_m *Transport) AddChannelDescriptors(_a0 []*conn.ChannelDescriptor) { +func (_m *Transport) AddChannelDescriptors(_a0 []*p2p.ChannelDescriptor) { _m.Called(_a0) } diff --git a/internal/state/mocks/store.go b/internal/state/mocks/store.go index 3dd34f27d..006a8b4e0 100644 --- a/internal/state/mocks/store.go +++ b/internal/state/mocks/store.go @@ -1,6 +1,5 @@ // Code generated by mockery. DO NOT EDIT. - package mocks import ( diff --git a/libs/store/mocks/store.go b/libs/store/mocks/store.go index f8d1989f6..4a2b232fb 100644 --- a/libs/store/mocks/store.go +++ b/libs/store/mocks/store.go @@ -8,7 +8,7 @@ import ( ) // Store is an autogenerated mock type for the Store type -type Store[K comparable, V interface{}] struct { +type Store[K comparable, V any] struct { mock.Mock } @@ -168,7 +168,7 @@ func (_m *Store[K, V]) Update(key K, updates ...store.UpdateFunc[K, V]) { // NewStore creates a new instance of Store. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. -func NewStore[K comparable, V interface{}](t interface { +func NewStore[K comparable, V any](t interface { mock.TestingT Cleanup(func()) }) *Store[K, V] { From 19ddf576b6237c9cb4e0ad7b36a3bf0f49ae882b Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:09:54 +0200 Subject: [PATCH 06/27] chore: fix typo --- DOCKER/Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DOCKER/Dockerfile b/DOCKER/Dockerfile index cf8f11175..57b3b6b08 100644 --- a/DOCKER/Dockerfile +++ b/DOCKER/Dockerfile @@ -4,12 +4,12 @@ # * compile - builds final binaries # * image - creates final image of minimal size -ARG ALIPNE_VERSION=3.19 +ARG ALPINE_VERSION=3.19 ARG GOLANG_VERSION=1.23 ################################# # STAGE 1: install dependencies # ################################# -FROM golang:${GOLANG_VERSION}-alpine${ALIPNE_VERSION} AS base +FROM golang:${GOLANG_VERSION}-alpine${ALPINE_VERSION} AS base RUN apk update && \ apk upgrade && \ @@ -55,7 +55,7 @@ RUN rm -r /src/tenderdash/third_party && ln -s /src/bls/third_party /src/tenderd ######################## # STAGE 4: FINAL IMAGE # ######################## -FROM alpine:${ALIPNE_VERSION} AS image +FROM alpine:${ALPINE_VERSION} AS image LABEL maintainer="developers@dash.org" From 809073e7ac62dd405c5013f3256d562d910122e3 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:23:40 +0200 Subject: [PATCH 07/27] build(deps): upgrade golangci-lint to 1.61 --- .github/workflows/lint.yml | 2 +- Makefile | 2 +- go.mod | 183 ++++++++------- go.sum | 448 ++++++++++++++++--------------------- 4 files changed, 292 insertions(+), 343 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 2aef6d749..ea36a25b2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -53,7 +53,7 @@ jobs: # Required: the version of golangci-lint is required and # must be specified without patch version: we always use the # latest patch version. - version: v1.55 + version: v1.61 args: --timeout 10m github-token: ${{ secrets.github_token }} if: env.GIT_DIFF diff --git a/Makefile b/Makefile index 288a5741d..9dd5f0384 100644 --- a/Makefile +++ b/Makefile @@ -292,7 +292,7 @@ format: lint: @echo "--> Running linter" - go run github.com/golangci/golangci-lint/cmd/golangci-lint run + go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0 run .PHONY: lint DESTINATION = ./index.html.md diff --git a/go.mod b/go.mod index 0439c383e..0cce90ef6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/dashpay/tenderdash go 1.23 require ( - github.com/BurntSushi/toml v1.3.2 + github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c github.com/adlio/schema v1.3.3 github.com/btcsuite/btcd v0.22.1 github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce @@ -18,7 +18,7 @@ require ( github.com/gogo/protobuf v1.3.2 github.com/golang/protobuf v1.5.4 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect - github.com/golangci/golangci-lint v1.55.2 + github.com/golangci/golangci-lint v1.61.0 github.com/google/btree v1.1.2 // indirect github.com/google/gopacket v1.1.19 github.com/google/orderedcode v0.0.1 @@ -40,9 +40,9 @@ require ( github.com/stretchr/testify v1.9.0 github.com/tendermint/tm-db v0.6.6 golang.org/x/crypto v0.28.0 - golang.org/x/net v0.27.0 + golang.org/x/net v0.28.0 golang.org/x/sync v0.8.0 - google.golang.org/grpc v1.64.1 + google.golang.org/grpc v1.66.0 pgregory.net/rapid v0.4.8 ) @@ -63,14 +63,17 @@ require ( connectrpc.com/connect v1.16.2 // indirect connectrpc.com/otelconnect v0.7.1 // indirect dario.cat/mergo v1.0.0 // indirect - github.com/4meepo/tagalign v1.3.3 // indirect - github.com/Abirdcfly/dupword v0.0.13 // indirect - github.com/Antonboom/testifylint v0.2.3 // indirect - github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 // indirect - github.com/OpenPeeDeeP/depguard/v2 v2.1.0 // indirect - github.com/alecthomas/go-check-sumtype v0.1.3 // indirect - github.com/alexkohler/nakedret/v2 v2.0.2 // indirect + github.com/4meepo/tagalign v1.3.4 // indirect + github.com/Abirdcfly/dupword v0.1.1 // indirect + github.com/Antonboom/testifylint v1.4.3 // indirect + github.com/Crocmagnon/fatcontext v0.5.2 // indirect + github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect + github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect + github.com/alecthomas/go-check-sumtype v0.1.4 // indirect + github.com/alexkohler/nakedret/v2 v2.0.4 // indirect github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/bombsimon/wsl/v4 v4.4.1 // indirect github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd // indirect github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792 // indirect @@ -78,10 +81,11 @@ require ( github.com/bufbuild/protoplugin v0.0.0-20240323223605-e2735f6c31ee // indirect github.com/bufbuild/protovalidate-go v0.6.3 // indirect github.com/bufbuild/protoyaml-go v0.1.9 // indirect - github.com/butuzov/mirror v1.1.0 // indirect - github.com/catenacyber/perfsprint v0.2.0 // indirect - github.com/ccojocar/zxcvbn-go v1.0.1 // indirect + github.com/butuzov/mirror v1.2.0 // indirect + github.com/catenacyber/perfsprint v0.7.1 // indirect + github.com/ccojocar/zxcvbn-go v1.0.2 // indirect github.com/chigopher/pathlib v0.19.1 // indirect + github.com/ckaznocha/intrange v0.2.0 // indirect github.com/containerd/stargz-snapshotter/estargz v0.15.1 // indirect github.com/curioswitch/go-reassign v0.2.0 // indirect github.com/dashpay/dashd-go/btcutil v1.2.0 // indirect @@ -95,65 +99,71 @@ require ( github.com/docker/docker-credential-helpers v0.8.2 // indirect github.com/felixge/fgprof v0.9.4 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect - github.com/ghostiam/protogetter v0.2.3 // indirect + github.com/ghostiam/protogetter v0.3.6 // indirect github.com/go-chi/chi/v5 v5.1.0 // indirect github.com/go-chi/render v1.0.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-pkgz/expirable-cache v0.0.3 // indirect github.com/go-pkgz/rest v1.5.0 // indirect - github.com/go-viper/mapstructure/v2 v2.0.0 // indirect + github.com/go-viper/mapstructure/v2 v2.1.0 // indirect github.com/gofrs/uuid/v5 v5.2.0 // indirect - github.com/golang/glog v1.2.0 // indirect + github.com/golang/glog v1.2.1 // indirect + github.com/golangci/modinfo v0.3.4 // indirect + github.com/golangci/plugin-module-register v0.1.1 // indirect github.com/google/cel-go v0.20.1 // indirect github.com/google/go-containerregistry v0.20.1 // indirect github.com/google/gofuzz v1.2.0 // indirect - github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8 // indirect + github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.20.0 // indirect github.com/huandu/xstrings v1.4.0 // indirect github.com/iancoleman/strcase v0.2.0 // indirect github.com/jdx/go-netrc v1.0.0 // indirect github.com/jinzhu/copier v0.3.5 // indirect - github.com/kkHAIKE/contextcheck v1.1.4 // indirect - github.com/macabu/inamedparam v0.1.2 // indirect + github.com/jjti/go-spancheck v0.6.2 // indirect + github.com/karamaru-alpha/copyloopvar v1.1.0 // indirect + github.com/kkHAIKE/contextcheck v1.1.5 // indirect + github.com/lasiar/canonicalheader v1.1.1 // indirect + github.com/macabu/inamedparam v0.1.3 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/moby/docker-image-spec v1.3.1 // indirect github.com/moby/term v0.5.0 // indirect github.com/morikuni/aec v1.0.0 // indirect - github.com/nunnatsa/ginkgolinter v0.14.1 // indirect - github.com/pelletier/go-toml/v2 v2.0.6 // indirect + github.com/nunnatsa/ginkgolinter v0.16.2 // indirect + github.com/pelletier/go-toml/v2 v2.2.3 // indirect github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 // indirect + github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/rivo/uniseg v0.2.0 // indirect + github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 // indirect github.com/sashamelentyev/interfacebloat v1.1.0 // indirect - github.com/sashamelentyev/usestdlibvars v1.24.0 // indirect + github.com/sashamelentyev/usestdlibvars v1.27.0 // indirect github.com/stoewer/go-strcase v1.3.0 // indirect - github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c // indirect github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c // indirect github.com/tendermint/tendermint v0.34.21 // indirect github.com/timonwong/loggercheck v0.9.4 // indirect github.com/vbatts/tar-split v0.11.5 // indirect github.com/xen0n/gosmopolitan v1.2.2 // indirect - github.com/ykadowak/zerologlint v0.1.3 // indirect - go-simpler.org/sloglint v0.1.2 // indirect - go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 // indirect - go.opentelemetry.io/otel v1.28.0 // indirect + github.com/ykadowak/zerologlint v0.1.5 // indirect + go-simpler.org/musttag v0.12.2 // indirect + go-simpler.org/sloglint v0.7.2 // indirect + go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 // indirect + go.opentelemetry.io/otel v1.29.0 // indirect go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 // indirect - go.opentelemetry.io/otel/metric v1.28.0 // indirect + go.opentelemetry.io/otel/metric v1.29.0 // indirect go.opentelemetry.io/otel/sdk v1.28.0 // indirect - go.opentelemetry.io/otel/trace v1.28.0 // indirect - go.tmz.dev/musttag v0.7.2 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a // indirect + go.opentelemetry.io/otel/trace v1.29.0 // indirect + go.uber.org/automaxprocs v1.5.3 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect ) require ( 4d63.com/gochecknoglobals v0.2.1 // indirect - github.com/Antonboom/errname v0.1.12 // indirect - github.com/Antonboom/nilnil v0.1.7 // indirect + github.com/Antonboom/errname v0.1.13 // indirect + github.com/Antonboom/nilnil v0.1.9 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect github.com/DataDog/zstd v1.4.5 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect - github.com/Masterminds/semver v1.5.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 // indirect github.com/alexkohler/prealloc v1.0.0 // indirect @@ -163,93 +173,85 @@ require ( github.com/beorn7/perks v1.0.1 // indirect github.com/bkielbasa/cyclop v1.2.1 // indirect github.com/blizzy78/varnamelen v0.8.0 // indirect - github.com/bombsimon/wsl/v3 v3.4.0 // indirect github.com/breml/bidichk v0.2.7 // indirect github.com/breml/errchkjson v0.3.6 // indirect - github.com/butuzov/ireturn v0.2.2 // indirect + github.com/butuzov/ireturn v0.3.0 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect - github.com/daixiang0/gci v0.11.2 // indirect + github.com/daixiang0/gci v0.13.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/denis-tingaikin/go-header v0.4.3 // indirect + github.com/denis-tingaikin/go-header v0.5.0 // indirect github.com/dgraph-io/badger/v2 v2.2007.2 // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 // indirect github.com/docker/go-connections v0.5.0 // indirect github.com/docker/go-units v0.5.0 // indirect github.com/dustin/go-humanize v1.0.0 // indirect - github.com/esimonov/ifshort v1.0.4 // indirect - github.com/ettle/strcase v0.1.1 // indirect - github.com/fatih/color v1.15.0 // indirect + github.com/ettle/strcase v0.2.0 // indirect + github.com/fatih/color v1.17.0 // indirect github.com/fatih/structtag v1.2.0 // indirect - github.com/firefart/nonamedreturns v1.0.4 // indirect + github.com/firefart/nonamedreturns v1.0.5 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect - github.com/go-critic/go-critic v0.9.0 // indirect + github.com/go-critic/go-critic v0.11.4 // indirect github.com/go-toolsmith/astcast v1.1.0 // indirect github.com/go-toolsmith/astcopy v1.1.0 // indirect - github.com/go-toolsmith/astequal v1.1.0 // indirect + github.com/go-toolsmith/astequal v1.2.0 // indirect github.com/go-toolsmith/astfmt v1.1.0 // indirect github.com/go-toolsmith/astp v1.1.0 // indirect github.com/go-toolsmith/strparse v1.1.0 // indirect github.com/go-toolsmith/typep v1.1.0 // indirect github.com/go-xmlfmt/xmlfmt v1.1.2 // indirect github.com/gobwas/glob v0.2.3 // indirect - github.com/gofrs/flock v0.8.1 // indirect - github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 // indirect + github.com/gofrs/flock v0.12.1 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect - github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe // indirect - github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e // indirect - github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 // indirect - github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca // indirect - github.com/golangci/misspell v0.4.1 // indirect - github.com/golangci/revgrep v0.5.2 // indirect - github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 // indirect - github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 // indirect + github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 // indirect + github.com/golangci/misspell v0.6.0 // indirect + github.com/golangci/revgrep v0.5.3 // indirect + github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed // indirect + github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.1.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 - github.com/hashicorp/go-version v1.6.0 // indirect + github.com/hashicorp/go-version v1.7.0 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect - github.com/jgautheron/goconst v1.6.0 // indirect + github.com/jgautheron/goconst v1.7.1 // indirect github.com/jingyugao/rowserrcheck v1.1.1 // indirect github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af // indirect github.com/jmhodges/levigo v1.0.0 // indirect github.com/julz/importas v0.1.0 // indirect - github.com/kisielk/errcheck v1.6.3 // indirect - github.com/kisielk/gotool v1.0.0 // indirect + github.com/kisielk/errcheck v1.7.0 // indirect github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/pgzip v1.2.6 // indirect github.com/kulti/thelper v0.6.3 // indirect - github.com/kunwardeep/paralleltest v1.0.8 // indirect + github.com/kunwardeep/paralleltest v1.0.10 // indirect github.com/kyoh86/exportloopref v0.1.11 // indirect - github.com/ldez/gomoddirectives v0.2.3 // indirect + github.com/ldez/gomoddirectives v0.2.4 // indirect github.com/ldez/tagliatelle v0.5.0 // indirect - github.com/leonklingele/grouper v1.1.1 // indirect + github.com/leonklingele/grouper v1.1.2 // indirect github.com/lufeee/execinquery v1.2.1 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/maratori/testpackage v1.1.1 // indirect github.com/matoous/godox v0.0.0-20230222163458-006bad1f9d26 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.13 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect - github.com/mbilski/exhaustivestruct v1.2.0 // indirect - github.com/mgechev/revive v1.3.4 // indirect + github.com/mgechev/revive v1.3.9 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect - github.com/moricho/tparallel v0.3.1 // indirect + github.com/moricho/tparallel v0.3.2 // indirect github.com/nakabonne/nestif v0.3.1 // indirect - github.com/nishanths/exhaustive v0.11.0 // indirect + github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect @@ -259,27 +261,26 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pkg/profile v1.7.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/polyfloyd/go-errorlint v1.4.5 // indirect + github.com/polyfloyd/go-errorlint v1.6.0 // indirect github.com/prometheus/client_model v0.2.1-0.20210607210712-147c58e9608a github.com/prometheus/common v0.37.0 github.com/prometheus/procfs v0.8.0 // indirect - github.com/quasilyte/go-ruleguard v0.4.0 // indirect + github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 // indirect github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/russross/blackfriday/v2 v2.1.0 // indirect - github.com/ryancurrah/gomodguard v1.3.0 // indirect + github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect github.com/sanposhiho/wastedassign/v2 v2.0.7 // indirect - github.com/securego/gosec/v2 v2.18.2 // indirect + github.com/securego/gosec/v2 v2.21.2 // indirect github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/sivchari/containedctx v1.0.3 // indirect - github.com/sivchari/nosnakecase v1.7.0 // indirect - github.com/sivchari/tenv v1.7.1 // indirect + github.com/sivchari/tenv v1.10.0 // indirect github.com/sonatard/noctx v0.0.2 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect - github.com/spf13/afero v1.9.3 // indirect + github.com/spf13/afero v1.11.0 // indirect github.com/spf13/cast v1.5.0 // indirect github.com/spf13/jwalterweatherman v1.1.0 // indirect github.com/spf13/pflag v1.0.5 // indirect @@ -288,36 +289,34 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/subosito/gotenv v1.4.2 // indirect github.com/tdakkota/asciicheck v0.2.0 // indirect - github.com/tetafro/godot v1.4.15 // indirect + github.com/tetafro/godot v1.4.17 // indirect github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 // indirect - github.com/tomarrell/wrapcheck/v2 v2.8.1 // indirect + github.com/tomarrell/wrapcheck/v2 v2.9.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect github.com/ultraware/funlen v0.1.0 // indirect - github.com/ultraware/whitespace v0.0.5 // indirect - github.com/uudashr/gocognit v1.1.2 // indirect + github.com/ultraware/whitespace v0.1.1 // indirect + github.com/uudashr/gocognit v1.1.3 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/yagipy/maintidx v1.0.0 // indirect - github.com/yeya24/promlinter v0.2.0 // indirect - gitlab.com/bosi/decorder v0.4.1 // indirect + github.com/yeya24/promlinter v0.3.0 // indirect + gitlab.com/bosi/decorder v0.4.2 // indirect go.etcd.io/bbolt v1.3.6 // indirect go.uber.org/atomic v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect - golang.org/x/mod v0.19.0 // indirect + golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f // indirect + golang.org/x/mod v0.21.0 // indirect golang.org/x/sys v0.26.0 // indirect golang.org/x/term v0.25.0 golang.org/x/text v0.19.0 // indirect - golang.org/x/tools v0.23.0 // indirect + golang.org/x/tools v0.24.0 // indirect google.golang.org/protobuf v1.34.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect - honnef.co/go/tools v0.4.6 // indirect - mvdan.cc/gofumpt v0.5.0 // indirect - mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed // indirect - mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b // indirect - mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d // indirect + honnef.co/go/tools v0.5.1 // indirect + mvdan.cc/gofumpt v0.7.0 // indirect + mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect ) require ( @@ -328,6 +327,6 @@ require ( github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 github.com/tendermint/go-amino v0.16.0 github.com/tyler-smith/go-bip39 v1.1.0 - golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 - golang.org/x/time v0.5.0 + golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e + golang.org/x/time v0.6.0 ) diff --git a/go.sum b/go.sum index ac7e5195c..0c13d9170 100644 --- a/go.sum +++ b/go.sum @@ -13,7 +13,6 @@ cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMT cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= -cloud.google.com/go v0.44.3/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= @@ -24,9 +23,6 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= -cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= -cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= -cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -44,7 +40,6 @@ cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0Zeo cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= -cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= connectrpc.com/connect v1.16.2 h1:ybd6y+ls7GOlb7Bh5C8+ghA6SvCBajHwxssO2CGFjqE= connectrpc.com/connect v1.16.2/go.mod h1:n2kgwskMHXC+lVqb18wngEpF95ldBHXjZYJussz5FRc= connectrpc.com/otelconnect v0.7.1 h1:scO5pOb0i4yUE66CnNrHeK1x51yq0bE0ehPg6WvzXJY= @@ -52,22 +47,24 @@ connectrpc.com/otelconnect v0.7.1/go.mod h1:dh3bFgHBTb2bkqGCeVVOtHJreSns7uu9wwL2 dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -github.com/4meepo/tagalign v1.3.3 h1:ZsOxcwGD/jP4U/aw7qeWu58i7dwYemfy5Y+IF1ACoNw= -github.com/4meepo/tagalign v1.3.3/go.mod h1:Q9c1rYMZJc9dPRkbQPpcBNCLEmY2njbAsXhQOZFE2dE= -github.com/Abirdcfly/dupword v0.0.13 h1:SMS17YXypwP000fA7Lr+kfyBQyW14tTT+nRv9ASwUUo= -github.com/Abirdcfly/dupword v0.0.13/go.mod h1:Ut6Ue2KgF/kCOawpW4LnExT+xZLQviJPE4klBPMK/5Y= -github.com/Antonboom/errname v0.1.12 h1:oh9ak2zUtsLp5oaEd/erjB4GPu9w19NyoIskZClDcQY= -github.com/Antonboom/errname v0.1.12/go.mod h1:bK7todrzvlaZoQagP1orKzWXv59X/x0W0Io2XT1Ssro= -github.com/Antonboom/nilnil v0.1.7 h1:ofgL+BA7vlA1K2wNQOsHzLJ2Pw5B5DpWRLdDAVvvTow= -github.com/Antonboom/nilnil v0.1.7/go.mod h1:TP+ScQWVEq0eSIxqU8CbdT5DFWoHp0MbP+KMUO1BKYQ= -github.com/Antonboom/testifylint v0.2.3 h1:MFq9zyL+rIVpsvLX4vDPLojgN7qODzWsrnftNX2Qh60= -github.com/Antonboom/testifylint v0.2.3/go.mod h1:IYaXaOX9NbfAyO+Y04nfjGI8wDemC1rUyM/cYolz018= +github.com/4meepo/tagalign v1.3.4 h1:P51VcvBnf04YkHzjfclN6BbsopfJR5rxs1n+5zHt+w8= +github.com/4meepo/tagalign v1.3.4/go.mod h1:M+pnkHH2vG8+qhE5bVc/zeP7HS/j910Fwa9TUSyZVI0= +github.com/Abirdcfly/dupword v0.1.1 h1:Bsxe0fIw6OwBtXMIncaTxCLHYO5BB+3mcsR5E8VXloY= +github.com/Abirdcfly/dupword v0.1.1/go.mod h1:B49AcJdTYYkpd4HjgAcutNGG9HZ2JWwKunH9Y2BA6sM= +github.com/Antonboom/errname v0.1.13 h1:JHICqsewj/fNckzrfVSe+T33svwQxmjC+1ntDsHOVvM= +github.com/Antonboom/errname v0.1.13/go.mod h1:uWyefRYRN54lBg6HseYCFhs6Qjcy41Y3Jl/dVhA87Ns= +github.com/Antonboom/nilnil v0.1.9 h1:eKFMejSxPSA9eLSensFmjW2XTgTwJMjZ8hUHtV4s/SQ= +github.com/Antonboom/nilnil v0.1.9/go.mod h1:iGe2rYwCq5/Me1khrysB4nwI7swQvjclR8/YRPl5ihQ= +github.com/Antonboom/testifylint v1.4.3 h1:ohMt6AHuHgttaQ1xb6SSnxCeK4/rnK7KKzbvs7DmEck= +github.com/Antonboom/testifylint v1.4.3/go.mod h1:+8Q9+AOLsz5ZiQiiYujJKs9mNz398+M6UgslP4qgJLA= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8= -github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= +github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/Crocmagnon/fatcontext v0.5.2 h1:vhSEg8Gqng8awhPju2w7MKHqMlg4/NI+gSDHtR3xgwA= +github.com/Crocmagnon/fatcontext v0.5.2/go.mod h1:87XhRMaInHP44Q7Tlc7jkgKKB7kZAOPiDkFMdKCC+74= github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= @@ -75,18 +72,18 @@ github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0 h1:3ZBs7LAezy8gh0uECsA6CGU43FF3zsx5f4eah5FxTMA= -github.com/GaijinEntertainment/go-exhaustruct/v3 v3.1.0/go.mod h1:rZLTje5A9kFBe0pzhpe2TdhRniBF++PRHQuRpR8esVc= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= -github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= +github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/Microsoft/go-winio v0.6.2 h1:F2VQgta7ecxGYO8k3ZZz3RS8fVIXVxONVUPlNERoyfY= github.com/Microsoft/go-winio v0.6.2/go.mod h1:yd8OoFMLzJbo9gZq8j5qaps8bJ9aShtEA8Ipt1oGCvU= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/OpenPeeDeeP/depguard/v2 v2.1.0 h1:aQl70G173h/GZYhWf36aE5H0KaujXfVMnn/f1kSDVYY= -github.com/OpenPeeDeeP/depguard/v2 v2.1.0/go.mod h1:PUBgk35fX4i7JDmwzlJwJ+GMe6NfO1723wmJMgPThNQ= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= +github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= @@ -94,8 +91,8 @@ github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/alecthomas/assert/v2 v2.2.2 h1:Z/iVC0xZfWTaFNE6bA3z07T86hd45Xe2eLt6WVy2bbk= github.com/alecthomas/assert/v2 v2.2.2/go.mod h1:pXcQ2Asjp247dahGEmsZ6ru0UVwnkhktn7S0bBDLxvQ= -github.com/alecthomas/go-check-sumtype v0.1.3 h1:M+tqMxB68hcgccRXBMVCPI4UJ+QUfdSx0xdbypKCqA8= -github.com/alecthomas/go-check-sumtype v0.1.3/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= +github.com/alecthomas/go-check-sumtype v0.1.4 h1:WCvlB3l5Vq5dZQTFmodqL2g68uHiSwwlWcT5a2FGK0c= +github.com/alecthomas/go-check-sumtype v0.1.4/go.mod h1:WyYPfhfkdhyrdaligV6svFopZV8Lqdzn5pyVBaV6jhQ= github.com/alecthomas/repr v0.2.0 h1:HAzS41CIzNW5syS8Mf9UwXhNH1J9aix/BvDRf1Ml2Yk= github.com/alecthomas/repr v0.2.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= @@ -103,8 +100,8 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= -github.com/alexkohler/nakedret/v2 v2.0.2 h1:qnXuZNvv3/AxkAb22q/sEsEpcA99YxLFACDtEw9TPxE= -github.com/alexkohler/nakedret/v2 v2.0.2/go.mod h1:2b8Gkk0GsOrqQv/gPWjNLDSKwG8I5moSXG1K4VIBcTQ= +github.com/alexkohler/nakedret/v2 v2.0.4 h1:yZuKmjqGi0pSmjGpOC016LtPJysIL0WEUiaXW5SUnNg= +github.com/alexkohler/nakedret/v2 v2.0.4/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/alingse/asasalint v0.0.11 h1:SFwnQXJ49Kx/1GghOFz1XGqHYKp21Kq1nHad/0WQRnw= @@ -125,8 +122,8 @@ github.com/bkielbasa/cyclop v1.2.1 h1:AeF71HZDob1P2/pRm1so9cd1alZnrpyc4q2uP2l0gJ github.com/bkielbasa/cyclop v1.2.1/go.mod h1:K/dT/M0FPAiYjBgQGau7tz+3TMh4FWAEqlMhzFWCrgM= github.com/blizzy78/varnamelen v0.8.0 h1:oqSblyuQvFsW1hbBHh1zfwrKe3kcSj0rnXkKzsQ089M= github.com/blizzy78/varnamelen v0.8.0/go.mod h1:V9TzQZ4fLJ1DSrjVDfl89H7aMnTvKkApdHeyESmyR7k= -github.com/bombsimon/wsl/v3 v3.4.0 h1:RkSxjT3tmlptwfgEgTgU+KYKLI35p/tviNXNXiL2aNU= -github.com/bombsimon/wsl/v3 v3.4.0/go.mod h1:KkIB+TXkqy6MvK9BDZVbZxKNYsE1/oLRJbIFtf14qqo= +github.com/bombsimon/wsl/v4 v4.4.1 h1:jfUaCkN+aUpobrMO24zwyAMwMAV5eSziCkOKEauOLdw= +github.com/bombsimon/wsl/v4 v4.4.1/go.mod h1:Xu/kDxGZTofQcDGCtQe9KCzhHphIe0fDuyWTxER9Feo= github.com/breml/bidichk v0.2.7 h1:dAkKQPLl/Qrk7hnP6P+E0xOodrq8Us7+U0o4UBOAlQY= github.com/breml/bidichk v0.2.7/go.mod h1:YodjipAGI9fGcYM7II6wFvGhdMYsC5pHDlGzqvEW3tQ= github.com/breml/errchkjson v0.3.6 h1:VLhVkqSBH96AvXEyclMR37rZslRrY2kcyq+31HCsVrA= @@ -158,14 +155,14 @@ github.com/bufbuild/protovalidate-go v0.6.3 h1:wxQyzW035zM16Binbaz/nWAzS12dRIXhZ github.com/bufbuild/protovalidate-go v0.6.3/go.mod h1:J4PtwP9Z2YAGgB0+o+tTWEDtLtXvz/gfhFZD8pbzM/U= github.com/bufbuild/protoyaml-go v0.1.9 h1:anV5UtF1Mlvkkgp4NWA6U/zOnJFng8Orq4Vf3ZUQHBU= github.com/bufbuild/protoyaml-go v0.1.9/go.mod h1:KCBItkvZOK/zwGueLdH1Wx1RLyFn5rCH7YjQrdty2Wc= -github.com/butuzov/ireturn v0.2.2 h1:jWI36dxXwVrI+RnXDwux2IZOewpmfv930OuIRfaBUJ0= -github.com/butuzov/ireturn v0.2.2/go.mod h1:RfGHUvvAuFFxoHKf4Z8Yxuh6OjlCw1KvR2zM1NFHeBk= -github.com/butuzov/mirror v1.1.0 h1:ZqX54gBVMXu78QLoiqdwpl2mgmoOJTk7s4p4o+0avZI= -github.com/butuzov/mirror v1.1.0/go.mod h1:8Q0BdQU6rC6WILDiBM60DBfvV78OLJmMmixe7GF45AE= -github.com/catenacyber/perfsprint v0.2.0 h1:azOocHLscPjqXVJ7Mf14Zjlkn4uNua0+Hcg1wTR6vUo= -github.com/catenacyber/perfsprint v0.2.0/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= -github.com/ccojocar/zxcvbn-go v1.0.1 h1:+sxrANSCj6CdadkcMnvde/GWU1vZiiXRbqYSCalV4/4= -github.com/ccojocar/zxcvbn-go v1.0.1/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= +github.com/butuzov/ireturn v0.3.0 h1:hTjMqWw3y5JC3kpnC5vXmFJAWI/m31jaCYQqzkS6PL0= +github.com/butuzov/ireturn v0.3.0/go.mod h1:A09nIiwiqzN/IoVo9ogpa0Hzi9fex1kd9PSD6edP5ZA= +github.com/butuzov/mirror v1.2.0 h1:9YVK1qIjNspaqWutSv8gsge2e/Xpq1eqEkslEUHy5cs= +github.com/butuzov/mirror v1.2.0/go.mod h1:DqZZDtzm42wIAIyHXeN8W/qb1EPlb9Qn/if9icBOpdQ= +github.com/catenacyber/perfsprint v0.7.1 h1:PGW5G/Kxn+YrN04cRAZKC+ZuvlVwolYMrIyyTJ/rMmc= +github.com/catenacyber/perfsprint v0.7.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= +github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= +github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= github.com/cenkalti/backoff v2.2.1+incompatible h1:tNowT99t7UNflLxfYYSlKYsBpXdEet03Pg2g16Swow4= github.com/cenkalti/backoff v2.2.1+incompatible/go.mod h1:90ReRw6GdpyfrHakVjL/QHaoyV4aDUVVkXQJJJ3NXXM= github.com/cenkalti/backoff/v4 v4.1.2/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= @@ -176,8 +173,8 @@ github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= @@ -195,9 +192,10 @@ github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObk github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/cilium/ebpf v0.7.0/go.mod h1:/oI2+1shJiTGAMgl6/RgJr36Eo1jzrRcAWbcXO2usCA= +github.com/ckaznocha/intrange v0.2.0 h1:FykcZuJ8BD7oX93YbO1UY9oZtkRbp+1/kJcDjkefYLs= +github.com/ckaznocha/intrange v0.2.0/go.mod h1:r5I7nUlAAG56xmkOpw4XVr16BXhwYTUdcuRFeevn1oE= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= @@ -230,8 +228,8 @@ github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr github.com/curioswitch/go-reassign v0.2.0 h1:G9UZyOcpk/d7Gd6mqYgd8XYWFMw/znxwGDUstnC9DIo= github.com/curioswitch/go-reassign v0.2.0/go.mod h1:x6OpXuWvgfQaMGks2BZybTngWjT84hqJfKoO8Tt/Roc= github.com/cyphar/filepath-securejoin v0.2.3/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= -github.com/daixiang0/gci v0.11.2 h1:Oji+oPsp3bQ6bNNgX30NBAVT18P4uBH4sRZnlOlTj7Y= -github.com/daixiang0/gci v0.11.2/go.mod h1:xtHP9N7AHdNvtRNfcx9gwTDfw7FRJx4bZUsiEfiNNAI= +github.com/daixiang0/gci v0.13.5 h1:kThgmH1yBmZSBCh1EJVxQ7JsHpm5Oms0AMed/0LaH4c= +github.com/daixiang0/gci v0.13.5/go.mod h1:12etP2OniiIdP4q+kjUGrC/rUagga7ODbqsom5Eo5Yk= github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8 h1:v4K3CiDoFY1gjcWL/scRcwzyjBwh8TVG3ek8cWolK1g= github.com/dashpay/bls-signatures/go-bindings v0.0.0-20230207105415-06df92693ac8/go.mod h1:auvGS60NBZ+a21aCCQh366PdsjDvHinsCvl28VrYPu4= github.com/dashpay/dashd-go v0.25.0 h1:tswVRmM2fLHC/JhpuAZ5Oa0TpOO6L+tqiE+QLTCvIQc= @@ -248,8 +246,8 @@ github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0 h1:HbphB4TFFXpv7MNrT52FGrrgVXF1owhMVTHFZIlnvd4= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.1.0/go.mod h1:DZGJHZMqrU4JJqFAWUS2UO1+lbSKsdiOoYi9Zzey7Fc= -github.com/denis-tingaikin/go-header v0.4.3 h1:tEaZKAlqql6SKCY++utLmkPLd6K8IBM20Ha7UVm+mtU= -github.com/denis-tingaikin/go-header v0.4.3/go.mod h1:0wOCWuN71D5qIgE2nz9KrKmuYBAC2Mra5RassOIQ2/c= +github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42t4429eC9k8= +github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/denisenkom/go-mssqldb v0.12.0 h1:VtrkII767ttSPNRfFekePK3sctr+joXgO58stqQbtUA= github.com/denisenkom/go-mssqldb v0.12.0/go.mod h1:iiK0YP1ZeepvmBQk/QpLEhhTNJgfzrpArPY/aFvc9yU= github.com/dgraph-io/badger/v2 v2.2007.2 h1:EjjK0KqwaFMlPin1ajhP943VPENHJdEz1KLIegjaI3k= @@ -283,24 +281,21 @@ github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25Kn github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= -github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v1.0.4 h1:gVPz/FMfvh57HdSJQyvBtF00j8JU4zdyUgIUNhlgg0A= github.com/envoyproxy/protoc-gen-validate v1.0.4/go.mod h1:qys6tmnRsYrQqIhm2bvKZH4Blx/1gTIZ2UKVY1M+Yew= -github.com/esimonov/ifshort v1.0.4 h1:6SID4yGWfRae/M7hkVDVVyppy8q/v9OuxNdmjLQStBA= -github.com/esimonov/ifshort v1.0.4/go.mod h1:Pe8zjlRrJ80+q2CxHLfEOfTwxCZ4O+MuhcHcfgNWTk0= -github.com/ettle/strcase v0.1.1 h1:htFueZyVeE1XNnMEfbqp5r67qAN/4r6ya1ysq8Q+Zcw= -github.com/ettle/strcase v0.1.1/go.mod h1:hzDLsPC7/lwKyBOywSHEP89nt2pDgdy+No1NBA9o9VY= +github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c h1:8ISkoahWXwZR41ois5lSJBSVw4D0OV19Ht/JSTzvSv0= github.com/facebookgo/ensure v0.0.0-20200202191622-63f1cf65ac4c/go.mod h1:Yg+htXGokKKdzcwhuNDwVvN+uBxDGXJ7G/VN1d8fa64= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A= github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4 h1:7HZCaLC5+BZpmbhCOZJ293Lz68O7PYrF2EzeiFMwCLk= github.com/facebookgo/subset v0.0.0-20200203212716-c811ad88dec4/go.mod h1:5tD+neXqOorC30/tWg0LCSkrqj/AR6gu8yY8/fpw1q0= -github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= -github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4= github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94= github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= @@ -308,8 +303,8 @@ github.com/felixge/fgprof v0.9.4 h1:ocDNwMFlnA0NU0zSB3I52xkO4sFXk80VK9lXjLClu88= github.com/felixge/fgprof v0.9.4/go.mod h1:yKl+ERSa++RYOs32d8K6WEXCB4uXdLls4ZaZPpayhMM= github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg= github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= -github.com/firefart/nonamedreturns v1.0.4 h1:abzI1p7mAEPYuR4A+VLKn4eNDOycjYo2phmY9sfv40Y= -github.com/firefart/nonamedreturns v1.0.4/go.mod h1:TDhe/tjI1BXo48CmYbUduTV7BdIga8MAO/xbKdcVsGI= +github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6tUTYIdRA= +github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= @@ -324,8 +319,8 @@ github.com/fxamacker/cbor/v2 v2.4.0/go.mod h1:TA1xS00nchWmaBnEIxPSE5oHLuJBAVvqrt github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghostiam/protogetter v0.2.3 h1:qdv2pzo3BpLqezwqfGDLZ+nHEYmc5bUpIdsMbBVwMjw= -github.com/ghostiam/protogetter v0.2.3/go.mod h1:KmNLOsy1v04hKbvZs8EfGI1fk39AgTdRDxWNYPfXVc4= +github.com/ghostiam/protogetter v0.3.6 h1:R7qEWaSgFCsy20yYHNIJsU9ZOb8TziSRRxuAOTVKeOk= +github.com/ghostiam/protogetter v0.3.6/go.mod h1:7lpeDnEJ1ZjL/YtyoN99ljO4z0pd3H0d18/t2dPBxHw= github.com/go-chi/chi v4.1.1+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-chi/chi v4.1.2+incompatible h1:fGFk2Gmi/YKXk0OmGfBh0WgmN3XB8lVnEyNz34tQRec= github.com/go-chi/chi v4.1.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= @@ -333,8 +328,8 @@ github.com/go-chi/chi/v5 v5.1.0 h1:acVI1TYaD+hhedDJ3r54HyA6sExp3HfXq7QWEEY/xMw= github.com/go-chi/chi/v5 v5.1.0/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8= github.com/go-chi/render v1.0.1 h1:4/5tis2cKaNdnv9zFLfXzcquC9HbeZgCnxGnKrltBS8= github.com/go-chi/render v1.0.1/go.mod h1:pq4Rr7HbnsdaeHagklXub+p6Wd16Af5l9koip1OvJns= -github.com/go-critic/go-critic v0.9.0 h1:Pmys9qvU3pSML/3GEQ2Xd9RZ/ip+aXHKILuxczKGV/U= -github.com/go-critic/go-critic v0.9.0/go.mod h1:5P8tdXL7m/6qnyG6oRAlYLORvoXH0WDypYgAEmagT40= +github.com/go-critic/go-critic v0.11.4 h1:O7kGOCx0NDIni4czrkRIXTnit0mkyKOCePh3My6OyEU= +github.com/go-critic/go-critic v0.11.4/go.mod h1:2QAdo4iuLik5S9YG0rT4wcZ8QxwHYkrr6/2MWAiv/vc= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -359,18 +354,22 @@ github.com/go-pkgz/jrpc v0.2.0 h1:CLy/eZyekjraVrxZV18N2R1mYLMJ/nWrgdfyIOGPY/E= github.com/go-pkgz/jrpc v0.2.0/go.mod h1:wd8vtQ4CgtCnuqua6x2b1SKIgv0VSOh5Dn0uUITbiUE= github.com/go-pkgz/rest v1.5.0 h1:C8SxXcXza4GiUUAn/95iCkvoIrGbS30qpwK19iqlrWQ= github.com/go-pkgz/rest v1.5.0/go.mod h1:nQaM3RhSTUAmbBZWY4hfe4buyeC9VckvhoCktiQXJxI= +github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= +github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= -github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 h1:p104kn46Q8WdvHunIJ9dAyjPVtrBPhSr3KT2yUst43I= +github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= +github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= github.com/go-toolsmith/astcast v1.1.0/go.mod h1:qdcuFWeGGS2xX5bLM/c3U9lewg7+Zu4mr+xPwZIB4ZU= github.com/go-toolsmith/astcopy v1.1.0 h1:YGwBN0WM+ekI/6SS6+52zLDEf8Yvp3n2seZITCUBt5s= github.com/go-toolsmith/astcopy v1.1.0/go.mod h1:hXM6gan18VA1T/daUEHCFcYiW8Ai1tIwIzHY6srfEAw= github.com/go-toolsmith/astequal v1.0.3/go.mod h1:9Ai4UglvtR+4up+bAD4+hCj7iTo4m/OXVTSLnCyTAx4= -github.com/go-toolsmith/astequal v1.1.0 h1:kHKm1AWqClYn15R0K1KKE4RG614D46n+nqUQ06E1dTw= github.com/go-toolsmith/astequal v1.1.0/go.mod h1:sedf7VIdCL22LD8qIvv7Nn9MuWJruQA/ysswh64lffQ= +github.com/go-toolsmith/astequal v1.2.0 h1:3Fs3CYZ1k9Vo4FzFhwwewC3CHISHDnVUPC4x0bI2+Cw= +github.com/go-toolsmith/astequal v1.2.0/go.mod h1:c8NZ3+kSFtFY/8lPso4v8LuJjdJiUFVnSuU3s0qrrDY= github.com/go-toolsmith/astfmt v1.1.0 h1:iJVPDPp6/7AaeLJEruMsBUlOYCmvg0MoCfJprsOmcco= github.com/go-toolsmith/astfmt v1.1.0/go.mod h1:OrcLlRwu0CuiIBp/8b5PYF9ktGVZUjlNMV634mhwuQ4= github.com/go-toolsmith/astp v1.1.0 h1:dXPuCl6u2llURjdPLLDxJeZInAeZ0/eZwFJmqZMnpQA= @@ -382,8 +381,8 @@ github.com/go-toolsmith/strparse v1.1.0 h1:GAioeZUK9TGxnLS+qfdqNbA4z0SSm5zVNtCQi github.com/go-toolsmith/strparse v1.1.0/go.mod h1:7ksGy58fsaQkGQlY8WVoBFNyEPMGuJin1rfoPS4lBSQ= github.com/go-toolsmith/typep v1.1.0 h1:fIRYDyF+JywLfqzyhdiHzRop/GQDxxNhLGQ6gFUNHus= github.com/go-toolsmith/typep v1.1.0/go.mod h1:fVIw+7zjdsMxDA3ITWnH1yOiw1rnTQKCsF/sk2H/qig= -github.com/go-viper/mapstructure/v2 v2.0.0 h1:dhn8MZ1gZ0mzeodTG3jt5Vj/o87xZKuNAprG2mQfMfc= -github.com/go-viper/mapstructure/v2 v2.0.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= +github.com/go-viper/mapstructure/v2 v2.1.0 h1:gHnMa2Y/pIxElCH2GlZZ1lZSsn6XMtufpGyP1XxdC/w= +github.com/go-viper/mapstructure/v2 v2.1.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/go-xmlfmt/xmlfmt v1.1.2 h1:Nea7b4icn8s57fTx1M5AI4qQT5HEM3rVUO8MuE6g80U= github.com/go-xmlfmt/xmlfmt v1.1.2/go.mod h1:aUCEOzzezBEjDBbFBoSiya/gduyIiWYRP6CnSFIV8AM= github.com/gobwas/glob v0.2.3 h1:A4xDbljILXROh+kObIiy5kIaPYD8e96x1tgBhUI5J+Y= @@ -393,8 +392,8 @@ github.com/gobwas/pool v0.2.1/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6Wezm github.com/gobwas/ws v1.2.1/go.mod h1:hRKAFb8wOxFROYNsT1bqfWnhX+b5MFeJM9r2ZSwg/KY= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/godbus/dbus/v5 v5.0.6/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= -github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw= -github.com/gofrs/flock v0.8.1/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14jxHU= +github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= +github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= github.com/gofrs/uuid/v5 v5.2.0 h1:qw1GMx6/y8vhVsx626ImfKMuS5CvJmhIKKtuyvfajMM= github.com/gofrs/uuid/v5 v5.2.0/go.mod h1:CDOjlDMVAtN56jqyRUZh58JT31Tiw7/oQyEXZV+9bD8= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= @@ -405,8 +404,8 @@ github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2V github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188 h1:+eHOFJl1BaXrQxKX+T06f78590z4qA2ZzBTqahsKSE4= github.com/golang-sql/sqlexp v0.0.0-20170517235910-f1bb20e5a188/go.mod h1:vXjM/+wXQnTPR4KqTKDgJukSZ6amVRtWMPEjE6sQoK8= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= +github.com/golang/glog v1.2.1 h1:OptwRhECazUx5ix5TTWC3EZhsZEHWcYWY4FQHTIubm4= +github.com/golang/glog v1.2.1/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -440,26 +439,22 @@ github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEW github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb h1:PBC98N2aIaM3XXiurYmW7fx4GZkL8feAMVq7nEjURHk= github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2 h1:23T5iq8rbUYlhpt5DB4XJkc6BU31uODLD1o1gKvZmD0= -github.com/golangci/check v0.0.0-20180506172741-cfe4005ccda2/go.mod h1:k9Qvh+8juN+UKMCS/3jFtGICgW8O96FVaZsaxdzDkR4= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe h1:6RGUuS7EGotKx6J5HIP8ZtyMdiDscjMLfRBSPuzVVeo= -github.com/golangci/go-misc v0.0.0-20220329215616-d24fe342adfe/go.mod h1:gjqyPShc/m8pEMpk0a3SeagVb0kaqvhscv+i9jI5ZhQ= -github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e h1:ULcKCDV1LOZPFxGZaA6TlQbiM3J2GCPnkx/bGF6sX/g= -github.com/golangci/gofmt v0.0.0-20231018234816-f50ced29576e/go.mod h1:Pm5KhLPA8gSnQwrQ6ukebRcapGb/BG9iUkdaiCcGHJM= -github.com/golangci/golangci-lint v1.55.2 h1:yllEIsSJ7MtlDBwDJ9IMBkyEUz2fYE0b5B8IUgO1oP8= -github.com/golangci/golangci-lint v1.55.2/go.mod h1:H60CZ0fuqoTwlTvnbyjhpZPWp7KmsjwV2yupIMiMXbM= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= -github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= -github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca/go.mod h1:tvlJhZqDe4LMs4ZHD0oMUlt9G2LWuDGoisJTBzLMV9o= -github.com/golangci/misspell v0.4.1 h1:+y73iSicVy2PqyX7kmUefHusENlrP9YwuHZHPLGQj/g= -github.com/golangci/misspell v0.4.1/go.mod h1:9mAN1quEo3DlpbaIKKyEvRxK1pwqR9s/Sea1bJCtlNI= -github.com/golangci/revgrep v0.5.2 h1:EndcWoRhcnfj2NHQ+28hyuXpLMF+dQmCN+YaeeIl4FU= -github.com/golangci/revgrep v0.5.2/go.mod h1:bjAMA+Sh/QUfTDcHzxfyHxr4xKvllVr/0sCv2e7jJHA= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4 h1:zwtduBRr5SSWhqsYNgcuWO2kFlpdOZbP0+yRjmvPGys= -github.com/golangci/unconvert v0.0.0-20180507085042-28b1c447d1f4/go.mod h1:Izgrg8RkN3rCIMLGE9CyYmU9pY2Jer6DgANEnZ/L/cQ= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9 h1:/1322Qns6BtQxUZDTAT4SdcoxknUki7IAoK4SAXr8ME= +github.com/golangci/gofmt v0.0.0-20240816233607-d8596aa466a9/go.mod h1:Oesb/0uFAyWoaw1U1qS5zyjCg5NP9C9iwjnI4tIsXEE= +github.com/golangci/golangci-lint v1.61.0 h1:VvbOLaRVWmyxCnUIMTbf1kDsaJbTzH20FAMXTAlQGu8= +github.com/golangci/golangci-lint v1.61.0/go.mod h1:e4lztIrJJgLPhWvFPDkhiMwEFRrWlmFbrZea3FsJyN8= +github.com/golangci/misspell v0.6.0 h1:JCle2HUTNWirNlDIAUO44hUsKhOFqGPoC4LZxlaSXDs= +github.com/golangci/misspell v0.6.0/go.mod h1:keMNyY6R9isGaSAu+4Q8NMBwMPkh15Gtc8UCVoDtAWo= +github.com/golangci/modinfo v0.3.4 h1:oU5huX3fbxqQXdfspamej74DFX0kyGLkw1ppvXoJ8GA= +github.com/golangci/modinfo v0.3.4/go.mod h1:wytF1M5xl9u0ij8YSvhkEVPP3M5Mc7XLl1pxH3B2aUM= +github.com/golangci/plugin-module-register v0.1.1 h1:TCmesur25LnyJkpsVrupv1Cdzo+2f7zX0H6Jkw1Ol6c= +github.com/golangci/plugin-module-register v0.1.1/go.mod h1:TTpqoB6KkwOJMV8u7+NyXMrkwwESJLOkfl9TxR1DGFc= +github.com/golangci/revgrep v0.5.3 h1:3tL7c1XBMtWHHqVpS5ChmiAAoe4PF/d5+ULzV9sLAzs= +github.com/golangci/revgrep v0.5.3/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= +github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= @@ -491,7 +486,6 @@ github.com/google/gopacket v1.1.19 h1:ves8RnFZPGiFnTS0uPQStjwru6uO6h+nlr9j6fL7kF github.com/google/gopacket v1.1.19/go.mod h1:iJ8V8n6KS+z2U1A8pUwu8bW5SyEMkXJB8Yo/Vo+TKTo= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= -github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/orderedcode v0.0.1 h1:UzfcAexk9Vhv8+9pNOgRu41f16lHq725vPwnSeiG/Us= github.com/google/orderedcode v0.0.1/go.mod h1:iVyU4/qPKHY5h/wSd6rZZCDcLJNxiWO6dvsYES2Sb20= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -501,13 +495,10 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7/go.mod h1:czg5+yv1E0ZGTi6S6vVK1mke0fV+FaUhNGcd6VRS9Ik= -github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8 h1:ssNFCCVmib/GQSzx3uCWyfMgOamLGWuGqlMS77Y1m3Y= -github.com/google/pprof v0.0.0-20240722153945-304e4f0156b8/go.mod h1:K1liHPHnj73Fdn/EKuT8nrFqBihUSKXoLYU0BuatOYo= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA= +github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4= github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ= @@ -516,9 +507,8 @@ github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= -github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601 h1:mrEEilTAUmaAORhssPPkxj84TsHrPMLBGW2Z4SoTxm8= -github.com/gordonklaus/ineffassign v0.0.0-20230610083614-0e73809eb601/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= +github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= +github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= @@ -548,8 +538,8 @@ github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brv github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo= github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM= github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= -github.com/hashicorp/go-version v1.6.0 h1:feTTfFNnjP967rlCxM/I9g701jU+RN74YKx2mOkIeek= -github.com/hashicorp/go-version v1.6.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= +github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= @@ -562,7 +552,6 @@ github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab/go.mod h1:gx7rwoVhcfuVKG5uya9Hs3Sxj7EIvldVofAWIUtGouw= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= @@ -571,8 +560,8 @@ github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLf github.com/jdx/go-netrc v1.0.0 h1:QbLMLyCZGj0NA8glAhxUpf1zDg6cxnWgMBbjq40W0gQ= github.com/jdx/go-netrc v1.0.0/go.mod h1:Gh9eFQJnoTNIRHXl2j5bJXA1u84hQWJWgGh569zF3v8= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= -github.com/jgautheron/goconst v1.6.0 h1:gbMLWKRMkzAc6kYsQL6/TxaoBUg3Jm9LSF/Ih1ADWGA= -github.com/jgautheron/goconst v1.6.0/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= +github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= +github.com/jgautheron/goconst v1.7.1/go.mod h1:aAosetZ5zaeC/2EfMeRswtxUFBpe2Hr7HzkgX4fanO4= github.com/jhump/protoreflect v1.16.0 h1:54fZg+49widqXYQ0b+usAFHbMkBGR4PpXrsHc8+TBDg= github.com/jhump/protoreflect v1.16.0/go.mod h1:oYPd7nPvcBw/5wlDfm/AVmU9zH9BgqGCI469pGxfj/8= github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjzq7gFzUs= @@ -581,6 +570,8 @@ github.com/jinzhu/copier v0.3.5 h1:GlvfUwHk62RokgqVNvYsku0TATCF7bAHVwEXoBh3iJg= github.com/jinzhu/copier v0.3.5/go.mod h1:DfbEm0FYsaqBcKcFuvmOZb218JkPGtvSHsKg8S8hyyg= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af h1:KA9BjwUk7KlCh6S9EAGWBt1oExIUv9WyNCiRz5amv48= github.com/jirfag/go-printf-func-name v0.0.0-20200119135958-7558a9eaa5af/go.mod h1:HEWGJkRDzjJY2sqdDwxccsGicWEf9BQOZsq2tV+xzM0= +github.com/jjti/go-spancheck v0.6.2 h1:iYtoxqPMzHUPp7St+5yA8+cONdyXD3ug6KK15n7Pklk= +github.com/jjti/go-spancheck v0.6.2/go.mod h1:+X7lvIrR5ZdUTkxFYqzJ0abr8Sb5LOo80uOhWNqIrYA= github.com/jmhodges/levigo v1.0.0 h1:q5EC36kV79HWeTBWsod3mG11EgStG3qArTKcvlksN1U= github.com/jmhodges/levigo v1.0.0/go.mod h1:Q6Qx+uH3RAqyK4rFQroq9RL7mdkABMcfhEI+nNuzMJQ= github.com/jonboulle/clockwork v0.3.0 h1:9BSCMi8C+0qdApAp4auwX0RkLGUjs956h0EkuQymUhg= @@ -598,13 +589,14 @@ github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7V github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.1.0 h1:F78HnrsjY3cR7j0etXy5+TU1Zuy7Xt08X/1aJnH5xXY= github.com/julz/importas v0.1.0/go.mod h1:oSFU2R4XK/P7kNBrnL/FEQlDGN1/6WoxXEjSSXO0DV0= +github.com/karamaru-alpha/copyloopvar v1.1.0 h1:x7gNyKcC2vRBO1H2Mks5u1VxQtYvFiym7fCjIP8RPos= +github.com/karamaru-alpha/copyloopvar v1.1.0/go.mod h1:u7CIfztblY0jZLOQZgH3oYsJzpC2A7S6u/lfgSXHy0k= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/errcheck v1.6.3 h1:dEKh+GLHcWm2oN34nMvDzn1sqI0i0WxPvrgiJA5JuM8= -github.com/kisielk/errcheck v1.6.3/go.mod h1:nXw/i/MfnvRHqXa7XXmQMUB0oNFGuBrNI8d8NLy0LPw= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= +github.com/kisielk/errcheck v1.7.0 h1:+SbscKmWJ5mOK/bO1zS60F5I9WwZDWOfRsC4RwfwRV0= +github.com/kisielk/errcheck v1.7.0/go.mod h1:1kLL+jV4e+CFfueBmI1dSK2ADDyQnlrnrY/FqKluHJQ= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/kkHAIKE/contextcheck v1.1.4 h1:B6zAaLhOEEcjvUgIYEqystmnFk1Oemn8bvJhbt0GMb8= -github.com/kkHAIKE/contextcheck v1.1.4/go.mod h1:1+i/gWqokIa+dm31mqGLZhZJ7Uh44DJGZVmr6QRBNJg= +github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= +github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= @@ -612,7 +604,6 @@ github.com/klauspost/pgzip v1.2.6 h1:8RXeL5crjEUFnR2/Sn6GJNWtSQ3Dk8pq4CL3jvdDyjU github.com/klauspost/pgzip v1.2.6/go.mod h1:Ch1tH69qFZu15pkjo5kYi6mth2Zzwzt50oCQKQE9RUs= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -624,25 +615,27 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= github.com/kulti/thelper v0.6.3/go.mod h1:DsqKShOvP40epevkFrvIwkCMNYxMeTNjdWL4dqWHZ6I= -github.com/kunwardeep/paralleltest v1.0.8 h1:Ul2KsqtzFxTlSU7IP0JusWlLiNqQaloB9vguyjbE558= -github.com/kunwardeep/paralleltest v1.0.8/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= +github.com/kunwardeep/paralleltest v1.0.10 h1:wrodoaKYzS2mdNVnc4/w31YaXFtsc21PCTdvWJ/lDDs= +github.com/kunwardeep/paralleltest v1.0.10/go.mod h1:2C7s65hONVqY7Q5Efj5aLzRCNLjw2h4eMc9EcypGjcY= github.com/kyoh86/exportloopref v0.1.11 h1:1Z0bcmTypkL3Q4k+IDHMWTcnCliEZcaPiIe0/ymEyhQ= github.com/kyoh86/exportloopref v0.1.11/go.mod h1:qkV4UF1zGl6EkF1ox8L5t9SwyeBAZ3qLMd6up458uqA= -github.com/ldez/gomoddirectives v0.2.3 h1:y7MBaisZVDYmKvt9/l1mjNCiSA1BVn34U0ObUcJwlhA= -github.com/ldez/gomoddirectives v0.2.3/go.mod h1:cpgBogWITnCfRq2qGoDkKMEVSaarhdBr6g8G04uz6d0= +github.com/lasiar/canonicalheader v1.1.1 h1:wC+dY9ZfiqiPwAexUApFush/csSPXeIi4QqyxXmng8I= +github.com/lasiar/canonicalheader v1.1.1/go.mod h1:cXkb3Dlk6XXy+8MVQnF23CYKWlyA7kfQhSw2CcZtZb0= +github.com/ldez/gomoddirectives v0.2.4 h1:j3YjBIjEBbqZ0NKtBNzr8rtMHTOrLPeiwTkfUJZ3alg= +github.com/ldez/gomoddirectives v0.2.4/go.mod h1:oWu9i62VcQDYp9EQ0ONTfqLNh+mDLWWDO+SO0qSQw5g= github.com/ldez/tagliatelle v0.5.0 h1:epgfuYt9v0CG3fms0pEgIMNPuFf/LpPIfjk4kyqSioo= github.com/ldez/tagliatelle v0.5.0/go.mod h1:rj1HmWiL1MiKQuOONhd09iySTEkUuE/8+5jtPYz9xa4= github.com/ledongthuc/pdf v0.0.0-20220302134840-0c2507a12d80/go.mod h1:imJHygn/1yfhB7XSJJKlFZKl/J+dCPAknuiaGOshXAs= -github.com/leonklingele/grouper v1.1.1 h1:suWXRU57D4/Enn6pXR0QVqqWWrnJ9Osrz+5rjt8ivzU= -github.com/leonklingele/grouper v1.1.1/go.mod h1:uk3I3uDfi9B6PeUjsCKi6ndcf63Uy7snXgR4yDYQVDY= +github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84YrjT3mIY= +github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw= github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lufeee/execinquery v1.2.1 h1:hf0Ems4SHcUGBxpGN7Jz78z1ppVkP/837ZlETPCEtOM= github.com/lufeee/execinquery v1.2.1/go.mod h1:EC7DrEKView09ocscGHC+apXMIaorh4xqSxS/dy8SbM= -github.com/macabu/inamedparam v0.1.2 h1:RR5cnayM6Q7cDhQol32DE2BGAPGMnffJ31LFE+UklaU= -github.com/macabu/inamedparam v0.1.2/go.mod h1:Xg25QvY7IBRl1KLPV9Rbml8JOMZtF/iAkNkmV7eQgjw= +github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= +github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= @@ -660,8 +653,8 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.13 h1:lTGmDsbAYt5DmK6OnoV7EuIF1wEIFAcxld6ypU4OSgU= github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= @@ -670,10 +663,8 @@ github.com/mattn/go-sqlite3 v1.14.9/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= -github.com/mbilski/exhaustivestruct v1.2.0 h1:wCBmUnSYufAHO6J4AVWY6ff+oxWxsVFrwgOdMUQePUo= -github.com/mbilski/exhaustivestruct v1.2.0/go.mod h1:OeTBVxQWoEmB2J2JCHmXWPJ0aksxSUOUy+nvtVEfzXc= -github.com/mgechev/revive v1.3.4 h1:k/tO3XTaWY4DEHal9tWBkkUMJYO/dLDVyMmAQxmIMDc= -github.com/mgechev/revive v1.3.4/go.mod h1:W+pZCMu9qj8Uhfs1iJMQsEFLRozUfvwFwqVvRbSNLVw= +github.com/mgechev/revive v1.3.9 h1:18Y3R4a2USSBF+QZKFQwVkBROUda7uoBlkEuBD+YD1A= +github.com/mgechev/revive v1.3.9/go.mod h1:+uxEIr5UH0TjXWHTno3xh4u7eg6jDpXKzQccA9UGhHU= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= @@ -689,8 +680,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= -github.com/moricho/tparallel v0.3.1 h1:fQKD4U1wRMAYNngDonW5XupoB/ZGJHdpzrWqgyg9krA= -github.com/moricho/tparallel v0.3.1/go.mod h1:leENX2cUv7Sv2qDgdi0D0fCftN8fRC67Bcn8pqzeYNI= +github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= +github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A= github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc= github.com/mroth/weightedrand v0.4.1 h1:rHcbUBopmi/3x4nnrvwGJBhX9d0vk+KgoLUZeDP6YyI= @@ -700,12 +691,12 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= -github.com/nishanths/exhaustive v0.11.0 h1:T3I8nUGhl/Cwu5Z2hfc92l0e04D2GEW6e0l8pzda2l0= -github.com/nishanths/exhaustive v0.11.0/go.mod h1:RqwDsZ1xY0dNdqHho2z6X+bgzizwbLYOWnZbbl2wLB4= +github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= +github.com/nishanths/exhaustive v0.12.0/go.mod h1:mEZ95wPIZW+x8kC4TgC+9YCUgiST7ecevsVDTgc2obs= github.com/nishanths/predeclared v0.2.2 h1:V2EPdZPliZymNAn79T8RkNApBjMmVKh5XRpLm/w98Vk= github.com/nishanths/predeclared v0.2.2/go.mod h1:RROzoN6TnGQupbC+lqggsOlcgysk3LMK/HI84Mp280c= -github.com/nunnatsa/ginkgolinter v0.14.1 h1:khx0CqR5U4ghsscjJ+lZVthp3zjIFytRXPTaQ/TMiyA= -github.com/nunnatsa/ginkgolinter v0.14.1/go.mod h1:nY0pafUSst7v7F637e7fymaMlQqI9c0Wka2fGsDkzWg= +github.com/nunnatsa/ginkgolinter v0.16.2 h1:8iLqHIZvN4fTLDC0Ke9tbSZVcyVHoBs0HIbnVSxfHJk= +github.com/nunnatsa/ginkgolinter v0.16.2/go.mod h1:4tWRinDN1FeJgU+iJANW/kz7xKN5nYRAOfJDQUS9dOQ= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= @@ -721,13 +712,13 @@ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108 github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.13.0 h1:0jY9lJquiL8fcf3M4LAXN5aMlS/b2BV86HFFPCPMgE4= -github.com/onsi/ginkgo/v2 v2.13.0/go.mod h1:TE309ZR8s5FsKKpuB1YAQYBzCaAfUgatB/xlT/ETL/o= +github.com/onsi/ginkgo/v2 v2.20.2 h1:7NVCeyIWROIAheY21RLS+3j2bb52W0W82tkberYytp4= +github.com/onsi/ginkgo/v2 v2.20.2/go.mod h1:K9gyxPIlb+aIvnZ8bd9Ak+YP18w3APlR+5coaZoE2ag= github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= -github.com/onsi/gomega v1.28.1 h1:MijcGUbfYuznzK/5R4CPNoUP/9Xvuo20sXfEm6XxoTA= -github.com/onsi/gomega v1.28.1/go.mod h1:9sxs+SwGrKI0+PWe4Fxa9tFQQBG5xSsSbMXOI8PPpoQ= +github.com/onsi/gomega v1.34.2 h1:pNCwDkzrsv7MS9kpaQvVb1aVLahQXyJ/Tv5oAZMI3i8= +github.com/onsi/gomega v1.34.2/go.mod h1:v1xfxRgk0KIsG+QOdm7p8UosrOzPYRo60fd3B/1Dukc= github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U= github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM= github.com/opencontainers/image-spec v1.1.0 h1:8SG7/vwALn54lVB/0yZ/MMwhFrPYtpEHQb2IpWsCzug= @@ -743,15 +734,15 @@ github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnh github.com/ory/dockertest/v3 v3.9.1 h1:v4dkG+dlu76goxMiTT2j8zV7s4oPPEppKT8K8p2f1kY= github.com/ory/dockertest/v3 v3.9.1/go.mod h1:42Ir9hmvaAPm0Mgibk6mBPi7SFvTXxEcnztDYOJ//uM= github.com/otiai10/copy v1.2.0/go.mod h1:rrF5dJ5F0t/EWSYODDu4j9/vEeYHMkc8jt0zJChqQWw= -github.com/otiai10/copy v1.11.0 h1:OKBD80J/mLBrwnzXqGtFCzprFSGioo30JcmR4APsNwc= -github.com/otiai10/copy v1.11.0/go.mod h1:rSaLseMUsZFFbsFGc7wCJnnkTAvdc5L6VWxPE4308Ww= +github.com/otiai10/copy v1.14.0 h1:dCI/t1iTdYGtkvCuBG2BgR6KZa83PTclw4U5n2wAllU= +github.com/otiai10/copy v1.14.0/go.mod h1:ECfuL02W+/FkTWZWgQqXPWZgW9oeKCSQ5qVfSc4qc4w= github.com/otiai10/curr v0.0.0-20150429015615-9b4961190c95/go.mod h1:9qAhocn7zKJG+0mI8eUu6xqkFDYS2kb2saOteoSB3cE= github.com/otiai10/curr v1.0.0/go.mod h1:LskTG5wDwr8Rs+nNQ+1LlxRjAtTZZjtJW4rMXl6j4vs= github.com/otiai10/mint v1.3.0/go.mod h1:F5AjcsTsWUqX+Na9fpHb52P8pcRX2CI6A3ctIT91xUo= github.com/otiai10/mint v1.3.1/go.mod h1:/yxELlJQ0ufhjUwhshSj+wFjZ78CnZ48/1wtmBH1OTc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= -github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= -github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M= +github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7 h1:Dx7Ovyv/SFnMFw3fD4oEoeorXc6saIiQ23LrGLth0Gw= github.com/petermattis/goid v0.0.0-20240813172612-4fcff4a6cae7/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pkg/browser v0.0.0-20240102092130-5ac0b6a4141c h1:+mdjkGKdHQG3305AYmdv1U2eRNDiU2ErMBj1gwrq8eQ= @@ -762,11 +753,12 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/profile v1.7.0 h1:hnbDkaNWPCLMO9wGLdBFTIZvzDrDfBM2072E1S9gJkA= github.com/pkg/profile v1.7.0/go.mod h1:8Uer0jas47ZQMJ7VD+OHknK4YDY07LPUC6dEvqDjvNo= -github.com/pkg/sftp v1.13.1/go.mod h1:3HaPG6Dq1ILlpPZRO0HVMrsydcdLt6HRDccSgb87qRg= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/polyfloyd/go-errorlint v1.4.5 h1:70YWmMy4FgRHehGNOUask3HtSFSOLKgmDn7ryNe7LqI= -github.com/polyfloyd/go-errorlint v1.4.5/go.mod h1:sIZEbFoDOCnTYYZoVkjc4hTnM459tuWA9H/EkdXwsKk= +github.com/polyfloyd/go-errorlint v1.6.0 h1:tftWV9DE7txiFzPpztTAwyoRLKNj9gpVm2cg8/OwcYY= +github.com/polyfloyd/go-errorlint v1.6.0/go.mod h1:HR7u8wuP1kb1NeN1zqTd1ZMlqUKPPHF+Id4vIPvDqVw= +github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= +github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= @@ -793,8 +785,10 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/prometheus/procfs v0.8.0 h1:ODq8ZFEaYeCaZOJlZZdJA2AbQR98dSHSM1KW/You5mo= github.com/prometheus/procfs v0.8.0/go.mod h1:z7EfXMXOkbkqb9IINtpCn86r/to3BnA0uaxHdg830/4= -github.com/quasilyte/go-ruleguard v0.4.0 h1:DyM6r+TKL+xbKB4Nm7Afd1IQh9kEUKQs2pboWGKtvQo= -github.com/quasilyte/go-ruleguard v0.4.0/go.mod h1:Eu76Z/R8IXtViWUIHkE3p8gdH3/PKk1eh3YGfaEof10= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= +github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= +github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= +github.com/quasilyte/go-ruleguard/dsl v0.3.22/go.mod h1:KeCP03KrjuSO0H1kTuZQCWlQPulDV6YMIXmpQss17rU= github.com/quasilyte/gogrep v0.5.0 h1:eTKODPXbI8ffJMN+W2aE0+oL0z/nh8/5eNdiO34SOAo= github.com/quasilyte/gogrep v0.5.0/go.mod h1:Cm9lpz9NZjEoL1tgZ2OgeUKPIxL1meE7eo60Z6Sk+Ng= github.com/quasilyte/regex/syntax v0.0.0-20210819130434-b3f0c404a727 h1:TCg2WBOl980XxGFEZSS6KlBGIV0diGdySzxATTWoqaU= @@ -805,8 +799,8 @@ github.com/rivo/uniseg v0.2.0 h1:S1pD9weZBuJdFmowNwbpi7BJ8TNftyUImj/0WQi72jY= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/rs/cors v1.11.0 h1:0B9GE/r9Bc2UxRMMtymBkHTenPkHDv0CW4Y98GBY+po= github.com/rs/cors v1.11.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= @@ -816,21 +810,23 @@ github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/ryancurrah/gomodguard v1.3.0 h1:q15RT/pd6UggBXVBuLps8BXRvl5GPBcwVA7BJHMLuTw= -github.com/ryancurrah/gomodguard v1.3.0/go.mod h1:ggBxb3luypPEzqVtq33ee7YSN35V28XeGnid8dnni50= +github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV3oJmPU= +github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= github.com/sanposhiho/wastedassign/v2 v2.0.7 h1:J+6nrY4VW+gC9xFzUc+XjPD3g3wF3je/NsJFwFK7Uxc= github.com/sanposhiho/wastedassign/v2 v2.0.7/go.mod h1:KyZ0MWTwxxBmfwn33zh3k1dmsbF2ud9pAAGfoLfjhtI= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1 h1:lZUw3E0/J3roVtGQ+SCrUrg3ON6NgVqpn3+iol9aGu4= +github.com/santhosh-tekuri/jsonschema/v5 v5.3.1/go.mod h1:uToXkOrWAZ6/Oc07xWQrPOhJotwFIyu2bBVN41fcDUY= github.com/sasha-s/go-deadlock v0.3.5 h1:tNCOEEDG6tBqrNDOX35j/7hL5FcFViG6awUGROb2NsU= github.com/sasha-s/go-deadlock v0.3.5/go.mod h1:bugP6EGbdGYObIlx7pUZtWqlvo8k9H6vCBBsiChJQ5U= github.com/sashamelentyev/interfacebloat v1.1.0 h1:xdRdJp0irL086OyW1H/RTZTr1h/tMEOsumirXcOJqAw= github.com/sashamelentyev/interfacebloat v1.1.0/go.mod h1:+Y9yU5YdTkrNvoX0xHc84dxiN1iBi9+G8zZIhPVoNjQ= -github.com/sashamelentyev/usestdlibvars v1.24.0 h1:MKNzmXtGh5N0y74Z/CIaJh4GlB364l0K1RUT08WSWAc= -github.com/sashamelentyev/usestdlibvars v1.24.0/go.mod h1:9cYkq+gYJ+a5W2RPdhfaSCnTVUC1OQP/bSiiBhq3OZE= +github.com/sashamelentyev/usestdlibvars v1.27.0 h1:t/3jZpSXtRPRf2xr0m63i32ZrusyurIGT9E5wAvXQnI= +github.com/sashamelentyev/usestdlibvars v1.27.0/go.mod h1:9nl0jgOfHKWNFS43Ojw0i7aRoS4j6EBye3YBhmAIRF8= github.com/seccomp/libseccomp-golang v0.9.2-0.20220502022130-f33da4d89646/go.mod h1:JA8cRccbGaA1s33RQf7Y1+q9gHmZX1yB/z9WDN1C6fg= -github.com/securego/gosec/v2 v2.18.2 h1:DkDt3wCiOtAHf1XkiXZBhQ6m6mK/b9T/wD257R3/c+I= -github.com/securego/gosec/v2 v2.18.2/go.mod h1:xUuqSF6i0So56Y2wwohWAmB07EdBkUN6crbLlHwbyJs= +github.com/securego/gosec/v2 v2.21.2 h1:deZp5zmYf3TWwU7A7cR2+SolbTpZ3HQiwFqnzQyEl3M= +github.com/securego/gosec/v2 v2.21.2/go.mod h1:au33kg78rNseF5PwPnTWhuYBFf534bvJRvOrgZ/bFzU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c h1:W65qqJCIOVP4jpqPQ0YvHYKwcMEMVWIzWC5iNQQfBTU= github.com/shazow/go-diff v0.0.0-20160112020656-b6b7b6733b8c/go.mod h1:/PevMnwAxekIXwN8qQyfc5gl2NlkB3CQlkizAbOkeBs= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= @@ -844,10 +840,8 @@ github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= github.com/sivchari/containedctx v1.0.3/go.mod h1:c1RDvCbnJLtH4lLcYD/GqwiBSSf4F5Qk0xld2rBqzJ4= -github.com/sivchari/nosnakecase v1.7.0 h1:7QkpWIRMe8x25gckkFd2A5Pi6Ymo0qgr4JrhGt95do8= -github.com/sivchari/nosnakecase v1.7.0/go.mod h1:CwDzrzPea40/GB6uynrNLiorAlgFRvRbFSgJx2Gs+QY= -github.com/sivchari/tenv v1.7.1 h1:PSpuD4bu6fSmtWMxSGWcvqUUgIn7k3yOJhOIzVWn8Ak= -github.com/sivchari/tenv v1.7.1/go.mod h1:64yStXKSOxDfX47NlhVwND4dHwfZDdbp2Lyl018Icvg= +github.com/sivchari/tenv v1.10.0 h1:g/hzMA+dBCKqGXgW8AV/1xIWhAvDrx0zFKNR48NFMg0= +github.com/sivchari/tenv v1.10.0/go.mod h1:tdY24masnVoZFxYrHv/nD6Tc8FbkEtAQEEziXpyMgqY= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa h1:YJfZp12Z3AFhSBeXOlv4BO55RMwPn2NoQeDsrdWnBtY= github.com/snikch/goodman v0.0.0-20171125024755-10e37e294daa/go.mod h1:oJyF+mSPHbB5mVY2iO9KV3pTt/QbIkGaO8gQ2WrDbP4= github.com/sonatard/noctx v0.0.2 h1:L7Dz4De2zDQhW8S0t+KUjY0MAQJd6SgVwhzNIc4ok00= @@ -858,8 +852,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= -github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk= -github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y= +github.com/spf13/afero v1.11.0 h1:WJQKhtpdm3v2IzqG8VMqrr6Rf3UYpEF239Jy9wNepM8= +github.com/spf13/afero v1.11.0/go.mod h1:GH9Y3pIexgf1MTIWtNGyogA5MwRIDXGUr+hbWNoBjkY= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= @@ -904,8 +898,6 @@ github.com/syndtr/gocapability v0.0.0-20200815063812-42c35b437635/go.mod h1:hkRG github.com/syndtr/goleveldb v1.0.1-0.20200815110645-5c35d600f0ca/go.mod h1:u2MKkTVTVJWe5D1rCvame8WqhBd88EuIwODJZ1VHCPM= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c h1:+aPplBwWcHBo6q9xrfWdMrT9o4kltkmmvpemgIjep/8= -github.com/t-yuki/gocover-cobertura v0.0.0-20180217150009-aaee18c8195c/go.mod h1:SbErYREK7xXdsRiigaQiQkI9McGRzYMvlKYaP3Nimdk= github.com/tdakkota/asciicheck v0.2.0 h1:o8jvnUANo0qXtnslk2d3nMKTFNlOnJjRrNcj0j9qkHM= github.com/tdakkota/asciicheck v0.2.0/go.mod h1:Qb7Y9EgjCLJGup51gDHFzbI08/gbGhL/UVhYIPWG2rg= github.com/tecbot/gorocksdb v0.0.0-20191217155057-f0fad39f321c h1:g+WoO5jjkqGAzHWCjJB1zZfXPIAaDpzXIEJ0eS6B5Ok= @@ -920,14 +912,14 @@ github.com/tenntenn/modver v1.0.1 h1:2klLppGhDgzJrScMpkj9Ujy3rXPUspSjAcev9tSEBgA github.com/tenntenn/modver v1.0.1/go.mod h1:bePIyQPb7UeioSRkw3Q0XeMhYZSMx9B8ePqg6SAMGH0= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpRQGxTSkNYKJ51yaw6ChIqO+Je8UqsTKN/cDag= github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= -github.com/tetafro/godot v1.4.15 h1:QzdIs+XB8q+U1WmQEWKHQbKmCw06QuQM7gLx/dky2RM= -github.com/tetafro/godot v1.4.15/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= +github.com/tetafro/godot v1.4.17 h1:pGzu+Ye7ZUEFx7LHU0dAKmCOXWsPjl7qA6iMGndsjPs= +github.com/tetafro/godot v1.4.17/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966 h1:quvGphlmUVU+nhpFa4gg4yJyTRJ13reZMDHrKwYw53M= github.com/timakin/bodyclose v0.0.0-20230421092635-574207250966/go.mod h1:27bSVNWSBOHm+qRp1T9qzaIpsWEP6TbUnei/43HK+PQ= github.com/timonwong/loggercheck v0.9.4 h1:HKKhqrjcVj8sxL7K77beXh0adEm6DLjV/QOGeMXEVi4= github.com/timonwong/loggercheck v0.9.4/go.mod h1:caz4zlPcgvpEkXgVnAJGowHAMW2NwHaNlpS8xDbVhTg= -github.com/tomarrell/wrapcheck/v2 v2.8.1 h1:HxSqDSN0sAt0yJYsrcYVoEeyM4aI9yAm3KQpIXDJRhQ= -github.com/tomarrell/wrapcheck/v2 v2.8.1/go.mod h1:/n2Q3NZ4XFT50ho6Hbxg+RV1uyo2Uow/Vdm9NQcl5SE= +github.com/tomarrell/wrapcheck/v2 v2.9.0 h1:801U2YCAjLhdN8zhZ/7tdjB3EnAoRlJHt/s+9hijLQ4= +github.com/tomarrell/wrapcheck/v2 v2.9.0/go.mod h1:g9vNIyhb5/9TQgumxQyOEqDHsmGYcGsVMOx/xGkqdMo= github.com/tommy-muehle/go-mnd/v2 v2.5.1 h1:NowYhSdyE/1zwK9QCLeRb6USWdoif80Ie+v+yU8u1Zw= github.com/tommy-muehle/go-mnd/v2 v2.5.1/go.mod h1:WsUAkMJMYww6l/ufffCD3m+P7LEvr8TnZn9lwVDlgzw= github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= @@ -935,11 +927,11 @@ github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3C github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ultraware/funlen v0.1.0 h1:BuqclbkY6pO+cvxoq7OsktIXZpgBSkYTQtmwhAK81vI= github.com/ultraware/funlen v0.1.0/go.mod h1:XJqmOQja6DpxarLj6Jj1U7JuoS8PvL4nEqDaQhy22p4= -github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= -github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/ultraware/whitespace v0.1.1 h1:bTPOGejYFulW3PkcrqkeQwOd6NKOOXvmGD9bo/Gk8VQ= +github.com/ultraware/whitespace v0.1.1/go.mod h1:XcP1RLD81eV4BW8UhQlpaR+SDc2givTvyI8a586WjW8= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= -github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvniI= -github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= +github.com/uudashr/gocognit v1.1.3 h1:l+a111VcDbKfynh+airAy/DJQKaXh2m9vkoysMPSZyM= +github.com/uudashr/gocognit v1.1.3/go.mod h1:aKH8/e8xbTRBwjbCkwZ8qt4l2EpKXl31KMHgSS+lZ2U= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= github.com/vektra/mockery/v2 v2.46.2 h1:bpUncWvkiDzqn+aWwt4dY1aS0F8Ob4k8+WJrWU/Kh4s= @@ -959,10 +951,10 @@ github.com/xen0n/gosmopolitan v1.2.2/go.mod h1:7XX7Mj61uLYrj0qmeN0zi7XDon9JRAEhY github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= github.com/yagipy/maintidx v1.0.0 h1:h5NvIsCz+nRDapQ0exNv4aJ0yXSI0420omVANTv3GJM= github.com/yagipy/maintidx v1.0.0/go.mod h1:0qNf/I/CCZXSMhsRsrEPDZ+DkekpKLXAJfsTACwgXLk= -github.com/yeya24/promlinter v0.2.0 h1:xFKDQ82orCU5jQujdaD8stOHiv8UN68BSdn2a8u8Y3o= -github.com/yeya24/promlinter v0.2.0/go.mod h1:u54lkmBOZrpEbQQ6gox2zWKKLKu2SGe+2KOiextY+IA= -github.com/ykadowak/zerologlint v0.1.3 h1:TLy1dTW3Nuc+YE3bYRPToG1Q9Ej78b5UUN6bjbGdxPE= -github.com/ykadowak/zerologlint v0.1.3/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= +github.com/yeya24/promlinter v0.3.0 h1:JVDbMp08lVCP7Y6NP3qHroGAO6z2yGKQtS5JsjqtoFs= +github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+YcPQN+mW4= +github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= +github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -970,12 +962,14 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -gitlab.com/bosi/decorder v0.4.1 h1:VdsdfxhstabyhZovHafFw+9eJ6eU0d2CkFNJcZz/NU4= -gitlab.com/bosi/decorder v0.4.1/go.mod h1:jecSqWUew6Yle1pCr2eLWTensJMmsxHsBwt+PVbkAqA= -go-simpler.org/assert v0.6.0 h1:QxSrXa4oRuo/1eHMXSBFHKvJIpWABayzKldqZyugG7E= -go-simpler.org/assert v0.6.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= -go-simpler.org/sloglint v0.1.2 h1:IjdhF8NPxyn0Ckn2+fuIof7ntSnVUAqBFcQRrnG9AiM= -go-simpler.org/sloglint v0.1.2/go.mod h1:2LL+QImPfTslD5muNPydAEYmpXIj6o/WYcqnJjLi4o4= +gitlab.com/bosi/decorder v0.4.2 h1:qbQaV3zgwnBZ4zPMhGLW4KZe7A7NwxEhJx39R3shffo= +gitlab.com/bosi/decorder v0.4.2/go.mod h1:muuhHoaJkA9QLcYHq4Mj8FJUwDZ+EirSHRiaTcTf6T8= +go-simpler.org/assert v0.9.0 h1:PfpmcSvL7yAnWyChSjOz6Sp6m9j5lyK8Ok9pEL31YkQ= +go-simpler.org/assert v0.9.0/go.mod h1:74Eqh5eI6vCK6Y5l3PI8ZYFXG4Sa+tkr70OIPJAUr28= +go-simpler.org/musttag v0.12.2 h1:J7lRc2ysXOq7eM8rwaTYnNrHd5JwjppzB6mScysB2Cs= +go-simpler.org/musttag v0.12.2/go.mod h1:uN1DVIasMTQKk6XSik7yrJoEysGtR2GRqvWnI9S7TYM= +go-simpler.org/sloglint v0.7.2 h1:Wc9Em/Zeuu7JYpl+oKoYOsQSy2X560aVueCW/m6IijY= +go-simpler.org/sloglint v0.7.2/go.mod h1:US+9C80ppl7VsThQclkM7BkCHQAzuz8kHLsW3ppuluo= go.etcd.io/bbolt v1.3.6 h1:/ecaJf0sk1l4l6V4awd65v2C3ILy7MSj+s/x1ADCIMU= go.etcd.io/bbolt v1.3.6/go.mod h1:qXsaaIqmgQH0T+OPdb99Bf+PKfBBQVAdyD6TY9G8XM4= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= @@ -983,36 +977,35 @@ go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0 h1:4K4tsIXefpVJtvA/8srF4V4y0akAoPHkIslgAkjixJA= -go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.53.0/go.mod h1:jjdQuTGVsXV4vSs+CJ2qYDeDPf9yIJV23qlIzBm73Vg= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk= +go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8= go.opentelemetry.io/otel v1.4.1/go.mod h1:StM6F/0fSwpd8dKWDCdRr7uRvEPYdW0hBSlbdTiUde4= -go.opentelemetry.io/otel v1.28.0 h1:/SqNcYk+idO0CxKEUOtKQClMK/MimZihKYMruSMViUo= -go.opentelemetry.io/otel v1.28.0/go.mod h1:q68ijF8Fc8CnMHKyzqL6akLO46ePnjkgfIMIjUIX9z4= +go.opentelemetry.io/otel v1.29.0 h1:PdomN/Al4q/lN6iBJEN3AwPvUiHPMlt93c8bqTG5Llw= +go.opentelemetry.io/otel v1.29.0/go.mod h1:N/WtXPs1CNCUEx+Agz5uouwCba+i+bJGFicT8SR4NP8= go.opentelemetry.io/otel/exporters/otlp/internal/retry v1.4.1/go.mod h1:VpP4/RMn8bv8gNo9uK7/IMY4mtWLELsS+JIP0inH0h4= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1 h1:WPpPsAAs8I2rA47v5u0558meKmmwm1Dj99ZbqCV8sZ8= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.4.1/go.mod h1:o5RW5o2pKpJLD5dNTCmjF1DorYwMeFJmb/rKr5sLaa8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0 h1:Xw8U6u2f8DK2XAkGRFV7BBLENgnTGX9i4rQRxJf+/vs= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.24.0/go.mod h1:6KW1Fm6R/s6Z3PGXwSJN2K4eT6wQB3vXX6CVnYX9NmM= -go.opentelemetry.io/otel/metric v1.28.0 h1:f0HGvSl1KRAU1DLgLGFjrwVyismPlnuU6JD6bOeuA5Q= -go.opentelemetry.io/otel/metric v1.28.0/go.mod h1:Fb1eVBFZmLVTMb6PPohq3TO9IIhUisDsbJoL/+uQW4s= +go.opentelemetry.io/otel/metric v1.29.0 h1:vPf/HFWTNkPu1aYeIsc98l4ktOQaL6LeSoeV2g+8YLc= +go.opentelemetry.io/otel/metric v1.29.0/go.mod h1:auu/QWieFVWx+DmQOUMgj0F8LHWdgalxXqvp7BII/W8= go.opentelemetry.io/otel/sdk v1.4.1/go.mod h1:NBwHDgDIBYjwK2WNu1OPgsIc2IJzmBXNnvIJxJc8BpE= go.opentelemetry.io/otel/sdk v1.28.0 h1:b9d7hIry8yZsgtbmM0DKyPWMMUMlK9NEKuIG4aBqWyE= go.opentelemetry.io/otel/sdk v1.28.0/go.mod h1:oYj7ClPUA7Iw3m+r7GeEjz0qckQRJK2B8zjcZEfu7Pg= go.opentelemetry.io/otel/sdk/metric v1.19.0 h1:EJoTO5qysMsYCa+w4UghwFV/ptQgqSL/8Ni+hx+8i1k= go.opentelemetry.io/otel/sdk/metric v1.19.0/go.mod h1:XjG0jQyFJrv2PbMvwND7LwCEhsJzCzV5210euduKcKY= go.opentelemetry.io/otel/trace v1.4.1/go.mod h1:iYEVbroFCNut9QkwEczV9vMRPHNKSSwYZjulEtsmhFc= -go.opentelemetry.io/otel/trace v1.28.0 h1:GhQ9cUuQGmNDd5BTCP2dAvv75RdMxEfTmYejp+lkx9g= -go.opentelemetry.io/otel/trace v1.28.0/go.mod h1:jPyXzNPg6da9+38HEwElrQiHlVMTnVfM3/yv2OlIHaI= +go.opentelemetry.io/otel/trace v1.29.0 h1:J/8ZNK4XgR7a21DZUAsbF8pZ5Jcw1VhACmnYt39JTi4= +go.opentelemetry.io/otel/trace v1.29.0/go.mod h1:eHl3w0sp3paPkYstJOmAimxhiFXPg+MMTlEh3nsQgWQ= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.12.0/go.mod h1:TsIjwGWIx5VFYv9KGVlOpxoBl5Dy+63SUguV7GGvlSQ= go.opentelemetry.io/proto/otlp v1.3.1 h1:TrMUixzpM0yuc/znrFTP9MMRh8trP93mkCiDVeXrui0= go.opentelemetry.io/proto/otlp v1.3.1/go.mod h1:0X1WI4de4ZsLrrJNLAQbFeLCm3T7yBkR0XqQ7niQU+8= -go.tmz.dev/musttag v0.7.2 h1:1J6S9ipDbalBSODNT5jCep8dhZyMr4ttnjQagmGYR5s= -go.tmz.dev/musttag v0.7.2/go.mod h1:m6q5NiiSKMnQYokefa2xGoyoXnrswCbJ0AWYzf4Zs28= go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE= go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0= +go.uber.org/automaxprocs v1.5.3 h1:kWazyxZUrS3Gs4qUpbwo5kEIMGe/DAvi5Z4tl2NW4j8= +go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnwa1WM0= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= @@ -1030,9 +1023,7 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= @@ -1046,12 +1037,12 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56 h1:2dVuKD2vS7b0QIHQbpyTISPd0LeHDbnYEryqj5Q1ug8= -golang.org/x/exp v0.0.0-20240719175910-8a7402abbf56/go.mod h1:M4RDyNAINzryxdtnbRXRL/OHtkFuWGRjvuhBJpk2IlY= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e h1:I88y4caeGeuDQxgdoFPUq097j7kNfw6uvuiNxUBfcBk= +golang.org/x/exp v0.0.0-20240904232852-e7e105dedf7e/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ= golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= -golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 h1:jWGQJV4niP+CCmFW9ekjA9Zx8vYORzOUH2/Nl5WPuLQ= -golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f h1:phY1HzDcf18Aq9A8KkmRtY9WvOFIxN8wgfvy6Zm1DV8= +golang.org/x/exp/typeparams v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1064,7 +1055,6 @@ golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHl golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= @@ -1073,7 +1063,6 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= @@ -1082,8 +1071,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91 golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI= golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.19.0 h1:fEdghXQSo20giMthA7cd28ZC+jts4amQ3YMXiP5oMQ8= -golang.org/x/mod v0.19.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1116,8 +1105,6 @@ golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= @@ -1130,17 +1117,13 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.27.0 h1:5K3Njcw06/l2y9vpGCSdcxWOYHOUk3dVNGDXN+FvAys= -golang.org/x/net v0.27.0/go.mod h1:dDi0PyhWNoiUOrAS8uXv/vnScO4wnHQO4mj9fn/RytE= +golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE= +golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= -golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b/go.mod h1:DAh4E804XQdzx2j+YRIaUnCqCV2RuMz24cGBJ5QYIrc= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1200,15 +1183,11 @@ golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200923182605-d9f96fdee20d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423185535-09eb48e85fd7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -1228,7 +1207,6 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220702020025-31831981b65f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -1253,7 +1231,6 @@ golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= @@ -1265,8 +1242,8 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200416051211-89c76fbcd5d1/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk= -golang.org/x/time v0.5.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= +golang.org/x/time v0.6.0 h1:eTDhh4ZXt5Qf0augr54TN6suAUudPcawVZeIAPU7D4U= +golang.org/x/time v0.6.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -1315,15 +1292,8 @@ golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= -golang.org/x/tools v0.0.0-20201001104356-43ebab892c4c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210108195828-e2f9c7f1fc8e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= @@ -1331,14 +1301,13 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= -golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA= golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k= golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.23.0 h1:SGsXPZ+2l4JsgaCKkx+FQ9YZ5XEtA1GZYuoDjenLjvg= -golang.org/x/tools v0.23.0/go.mod h1:pnu6ufv6vQkll6szChhK3C3L/ruaIv5eBeztNG8wtsI= +golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24= +golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1359,16 +1328,12 @@ google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0M google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= -google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= -google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1401,17 +1366,10 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a h1:YIa/rzVqMEokBkPtydCkx1VLmv3An1Uw7w1P1m6EhOY= -google.golang.org/genproto/googleapis/api v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a h1:hqK4+jJZXCU4pW7jsAdGOVFIfLHQeV7LaizZKnZ84HI= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240723171418-e6d459c13d2a/go.mod h1:Ue6ibwXGpU+dqIcODieyLOcgj7z8+IcskoNIgZxtrFY= +google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f h1:b1Ln/PG8orm0SsBbHZWke8dDp2lrCD4jSmfglFpTZbk= +google.golang.org/genproto/googleapis/api v0.0.0-20240725223205-93522f1f2a9f/go.mod h1:AHT0dDg3SoMOgZGnZk29b5xTbPHMoEC8qthmBLJCpys= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= @@ -1424,17 +1382,13 @@ google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKa google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= -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.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= google.golang.org/grpc v1.44.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.64.1 h1:LKtvyfbX3UGVPFcGqJ9ItpVWW6oN/2XqTxfAnwRRXiA= -google.golang.org/grpc v1.64.1/go.mod h1:hiQF4LFZelK2WKaP6W0L92zGHtiQdZxk8CrSdvyjeP0= +google.golang.org/grpc v1.66.0 h1:DibZuoBznOxbDQxRINckZcUvnCEvrW9pcWIE2yF9r1c= +google.golang.org/grpc v1.66.0/go.mod h1:s3/l6xSSCURdVfAnL+TqCNMyTDAGN6+lZeVxnZR128Y= 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= @@ -1484,16 +1438,12 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= -honnef.co/go/tools v0.4.6 h1:oFEHCKeID7to/3autwsWfnuv69j3NsfcXbvJKuIcep8= -honnef.co/go/tools v0.4.6/go.mod h1:+rnGS1THNh8zMwnd2oVOTL9QF6vmfyG6ZXBULae2uc0= -mvdan.cc/gofumpt v0.5.0 h1:0EQ+Z56k8tXjj/6TQD25BFNKQXpCvT0rnansIc7Ug5E= -mvdan.cc/gofumpt v0.5.0/go.mod h1:HBeVDtMKRZpXyxFciAirzdKklDlGu8aAy1wEbH5Y9js= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed h1:WX1yoOaKQfddO/mLzdV4wptyWgoH/6hwLs7QHTixo0I= -mvdan.cc/interfacer v0.0.0-20180901003855-c20040233aed/go.mod h1:Xkxe497xwlCKkIaQYRfC7CSLworTXY9RMqwhhCm+8Nc= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b h1:DxJ5nJdkhDlLok9K6qO+5290kphDJbHOQO1DFFFTeBo= -mvdan.cc/lint v0.0.0-20170908181259-adc824a0674b/go.mod h1:2odslEg/xrtNQqCYg2/jCoyKnw3vv5biOc3JnIcYfL4= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d h1:3rvTIIM22r9pvXk+q3swxUQAQOxksVMGK7sml4nG57w= -mvdan.cc/unparam v0.0.0-20221223090309-7455f1af531d/go.mod h1:IeHQjmn6TOD+e4Z3RFiZMMsLVL+A96Nvptar8Fj71is= +honnef.co/go/tools v0.5.1 h1:4bH5o3b5ZULQ4UrBmP+63W9r7qIkqJClEA9ko5YKx+I= +honnef.co/go/tools v0.5.1/go.mod h1:e9irvo83WDG9/irijV44wr3tbhcFeRnfpVlRqVwpzMs= +mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= +mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= pgregory.net/rapid v0.4.8 h1:d+5SGZWUbJPbl3ss6tmPFqnNeQR6VDOFly+eTjwPiEw= pgregory.net/rapid v0.4.8/go.mod h1:Z5PbWqjvWR1I3UGjvboUuan4fe4ZYEYNLNQLExzCoUs= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= From e7d0b6412d35611dfdcf5c1e4c0fd4442a3e720b Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Fri, 11 Oct 2024 21:23:20 +0200 Subject: [PATCH 08/27] fix: linter warnings in multiple files --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 955e41347..f3d129c80 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,7 +6,7 @@ linters: - dogsled - dupl - errcheck - - exportloopref + - copyloopvar # - funlen # - gochecknoglobals # - gochecknoinits From 402f7378c0aea1b203887ddf42bc281f3cc4ad59 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Sat, 12 Oct 2024 00:50:57 +0200 Subject: [PATCH 09/27] chore: fix linter issues, WIP --- internal/p2p/address_test.go | 7 -- internal/p2p/conn/connection_test.go | 22 ++-- .../p2p/conn/evil_secret_connection_test.go | 1 - internal/p2p/conn/secret_connection_test.go | 2 +- internal/p2p/peermanager_test.go | 3 +- internal/p2p/pex/reactor_test.go | 4 - internal/p2p/transport_test.go | 2 - libs/bits/bit_array.go | 20 ++-- libs/bits/bit_array_test.go | 1 - libs/bytes/bytes.go | 8 +- libs/math/safemath.go | 103 +++++++++++++++++ libs/math/safemath_test.go | 105 ++++++++++++++++++ rpc/jsonrpc/server/http_json_handler.go | 3 +- rpc/jsonrpc/server/http_json_handler_test.go | 4 +- rpc/jsonrpc/server/http_server_test.go | 4 +- rpc/jsonrpc/server/parse_test.go | 2 +- rpc/jsonrpc/server/rpc_func.go | 4 +- rpc/jsonrpc/server/ws_handler.go | 6 +- test/e2e/pkg/mockcoreserver/core_server.go | 3 +- test/e2e/pkg/mockcoreserver/expect.go | 6 +- test/e2e/pkg/mockcoreserver/server.go | 4 +- types/block.go | 8 +- types/block_meta_test.go | 2 - types/block_test.go | 6 - types/canonical_test.go | 1 - types/evidence_test.go | 3 - types/light_test.go | 1 - types/node_info.go | 3 +- 28 files changed, 260 insertions(+), 78 deletions(-) diff --git a/internal/p2p/address_test.go b/internal/p2p/address_test.go index f8c0572d7..0746820e9 100644 --- a/internal/p2p/address_test.go +++ b/internal/p2p/address_test.go @@ -28,7 +28,6 @@ func TestNewNodeID(t *testing.T) { {"00112233445566778899aabbccddeeff0011223g", "", false}, } for _, tc := range testcases { - tc := tc t.Run(tc.input, func(t *testing.T) { id, err := types.NewNodeID(tc.input) if !tc.ok { @@ -61,7 +60,6 @@ func TestNodeID_Bytes(t *testing.T) { {"01g0", nil, false}, } for _, tc := range testcases { - tc := tc t.Run(string(tc.nodeID), func(t *testing.T) { bz, err := tc.nodeID.Bytes() if tc.ok { @@ -87,7 +85,6 @@ func TestNodeID_Validate(t *testing.T) { {"00112233445566778899AABBCCDDEEFF00112233", false}, } for _, tc := range testcases { - tc := tc t.Run(string(tc.nodeID), func(t *testing.T) { err := tc.nodeID.Validate() if tc.ok { @@ -189,7 +186,6 @@ func TestParseNodeAddress(t *testing.T) { {"mconn://" + user + "@:80", p2p.NodeAddress{}, false}, } for _, tc := range testcases { - tc := tc t.Run(tc.url, func(t *testing.T) { address, err := p2p.ParseNodeAddress(tc.url) if !tc.ok { @@ -277,7 +273,6 @@ func TestNodeAddress_Resolve(t *testing.T) { {p2p.NodeAddress{Protocol: "tcp", Hostname: "💥"}, &p2p.Endpoint{}, false}, } for _, tc := range testcases { - tc := tc t.Run(tc.address.String(), func(t *testing.T) { ctx, cancel := context.WithCancel(bctx) defer cancel() @@ -348,7 +343,6 @@ func TestNodeAddress_String(t *testing.T) { }, } for _, tc := range testcases { - tc := tc t.Run(tc.address.String(), func(t *testing.T) { require.Equal(t, tc.expect, tc.address.String()) }) @@ -375,7 +369,6 @@ func TestNodeAddress_Validate(t *testing.T) { {p2p.NodeAddress{Protocol: "mconn", NodeID: id, Port: 80, Path: "path"}, false}, } for _, tc := range testcases { - tc := tc t.Run(tc.address.String(), func(t *testing.T) { err := tc.address.Validate() if tc.ok { diff --git a/internal/p2p/conn/connection_test.go b/internal/p2p/conn/connection_test.go index 55c2460c6..0c030f74c 100644 --- a/internal/p2p/conn/connection_test.go +++ b/internal/p2p/conn/connection_test.go @@ -27,10 +27,10 @@ const maxPingPongPacketSize = 1024 // bytes func createTestMConnection(logger log.Logger, conn net.Conn) *MConnection { return createMConnectionWithCallbacks(logger, conn, // onRecieve - func(ctx context.Context, chID ChannelID, msgBytes []byte) { + func(_ context.Context, _ ChannelID, _ []byte) { }, // onError - func(ctx context.Context, r interface{}) { + func(_ context.Context, _ interface{}) { }) } @@ -122,7 +122,7 @@ func TestMConnectionReceive(t *testing.T) { receivedCh := make(chan []byte) errorsCh := make(chan interface{}) - onReceive := func(ctx context.Context, chID ChannelID, msgBytes []byte) { + onReceive := func(ctx context.Context, _ ChannelID, msgBytes []byte) { select { case receivedCh <- msgBytes: case <-ctx.Done(): @@ -209,7 +209,7 @@ func TestMConnectionMultiplePongsInTheBeginning(t *testing.T) { receivedCh := make(chan []byte) errorsCh := make(chan interface{}) - onReceive := func(ctx context.Context, chID ChannelID, msgBytes []byte) { + onReceive := func(ctx context.Context, _ ChannelID, msgBytes []byte) { select { case receivedCh <- msgBytes: case <-ctx.Done(): @@ -268,7 +268,7 @@ func TestMConnectionMultiplePings(t *testing.T) { receivedCh := make(chan []byte) errorsCh := make(chan interface{}) - onReceive := func(ctx context.Context, chID ChannelID, msgBytes []byte) { + onReceive := func(ctx context.Context, _ ChannelID, msgBytes []byte) { select { case receivedCh <- msgBytes: case <-ctx.Done(): @@ -331,7 +331,7 @@ func TestMConnectionPingPongs(t *testing.T) { receivedCh := make(chan []byte) errorsCh := make(chan interface{}) - onReceive := func(ctx context.Context, chID ChannelID, msgBytes []byte) { + onReceive := func(ctx context.Context, _ ChannelID, msgBytes []byte) { select { case receivedCh <- msgBytes: case <-ctx.Done(): @@ -388,7 +388,7 @@ func TestMConnectionStopsAndReturnsError(t *testing.T) { receivedCh := make(chan []byte) errorsCh := make(chan interface{}) - onReceive := func(ctx context.Context, chID ChannelID, msgBytes []byte) { + onReceive := func(ctx context.Context, _ ChannelID, msgBytes []byte) { select { case receivedCh <- msgBytes: case <-ctx.Done(): @@ -447,7 +447,7 @@ func newClientAndServerConnsForReadErrors( // create server conn with 1 channel // it fires on chOnErr when there's an error serverLogger := logger.With("module", "server") - onError = func(ctx context.Context, r interface{}) { + onError = func(ctx context.Context, _ interface{}) { select { case <-ctx.Done(): case chOnErr <- struct{}{}: @@ -515,7 +515,7 @@ func TestMConnectionReadErrorLongMessage(t *testing.T) { mconnClient, mconnServer := newClientAndServerConnsForReadErrors(ctx, t, chOnErr) t.Cleanup(waitAll(mconnClient, mconnServer)) - mconnServer.onReceive = func(ctx context.Context, chID ChannelID, msgBytes []byte) { + mconnServer.onReceive = func(ctx context.Context, _ ChannelID, _ []byte) { select { case <-ctx.Done(): case chOnRcv <- struct{}{}: @@ -604,8 +604,6 @@ func TestConnVectors(t *testing.T) { } for _, tc := range testCases { - tc := tc - pm := mustWrapPacket(tc.msg) bz, err := pm.Marshal() require.NoError(t, err, tc.testName) @@ -628,7 +626,7 @@ func TestMConnectionChannelOverflow(t *testing.T) { mconnClient, mconnServer := newClientAndServerConnsForReadErrors(ctx, t, chOnErr) t.Cleanup(waitAll(mconnClient, mconnServer)) - mconnServer.onReceive = func(ctx context.Context, chID ChannelID, msgBytes []byte) { + mconnServer.onReceive = func(ctx context.Context, _ ChannelID, _ []byte) { select { case <-ctx.Done(): case chOnRcv <- struct{}{}: diff --git a/internal/p2p/conn/evil_secret_connection_test.go b/internal/p2p/conn/evil_secret_connection_test.go index 08d426e9b..52d0e6c8c 100644 --- a/internal/p2p/conn/evil_secret_connection_test.go +++ b/internal/p2p/conn/evil_secret_connection_test.go @@ -252,7 +252,6 @@ func TestMakeSecretConnection(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { privKey := ed25519.GenPrivKey() _, err := MakeSecretConnection(tc.conn, privKey) diff --git a/internal/p2p/conn/secret_connection_test.go b/internal/p2p/conn/secret_connection_test.go index 1c544354d..91bd0f059 100644 --- a/internal/p2p/conn/secret_connection_test.go +++ b/internal/p2p/conn/secret_connection_test.go @@ -109,7 +109,7 @@ func TestSecretConnectionReadWrite(t *testing.T) { } // A helper that will run with (fooConn, fooWrites, fooReads) and vice versa - genNodeRunner := func(id string, nodeConn kvstoreConn, nodeWrites []string, nodeReads *[]string) async.Task { + genNodeRunner := func(_ string, nodeConn kvstoreConn, nodeWrites []string, nodeReads *[]string) async.Task { return func(_ int) (interface{}, bool, error) { // Initiate cryptographic private key and secret connection trhough nodeConn. nodePrvKey := ed25519.GenPrivKey() diff --git a/internal/p2p/peermanager_test.go b/internal/p2p/peermanager_test.go index 7440c4a92..2f201944c 100644 --- a/internal/p2p/peermanager_test.go +++ b/internal/p2p/peermanager_test.go @@ -99,7 +99,6 @@ func TestPeerManagerOptions_Validate(t *testing.T) { }, false}, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { err := tc.options.Validate() if tc.ok { @@ -1068,7 +1067,7 @@ func TestPeerManager_Dialed_UpgradeNoEvict(t *testing.T) { func TestPeerManager_Accepted(t *testing.T) { ctx := context.TODO() a := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("a", 40))} - b := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("b", 40))} + b := p2p.NodeAddress{NodeID: types.NodeID(strings.Repeat("b", 40))} c := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("c", 40))} d := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("d", 40))} diff --git a/internal/p2p/pex/reactor_test.go b/internal/p2p/pex/reactor_test.go index cfd8c2528..791e40113 100644 --- a/internal/p2p/pex/reactor_test.go +++ b/internal/p2p/pex/reactor_test.go @@ -395,10 +395,6 @@ func setupNetwork(ctx context.Context, t *testing.T, opts testOptions) *reactorT idx := 0 for nodeID := range rts.network.Nodes { - // make a copy to avoid getting hit by the range ref - // confusion: - nodeID := nodeID - rts.peerChans[nodeID] = make(chan p2p.PeerUpdate, chBuf) rts.peerUpdates[nodeID] = p2p.NewPeerUpdates(rts.peerChans[nodeID], chBuf, "pex") rts.network.Nodes[nodeID].PeerManager.Register(ctx, rts.peerUpdates[nodeID]) diff --git a/internal/p2p/transport_test.go b/internal/p2p/transport_test.go index 1d87c5179..928166e25 100644 --- a/internal/p2p/transport_test.go +++ b/internal/p2p/transport_test.go @@ -502,7 +502,6 @@ func TestEndpoint_NodeAddress(t *testing.T) { {p2p.Endpoint{Path: "path"}, p2p.NodeAddress{Path: "path"}}, } for _, tc := range testcases { - tc := tc t.Run(tc.endpoint.String(), func(t *testing.T) { // Without NodeID. expect := tc.expect @@ -554,7 +553,6 @@ func TestEndpoint_String(t *testing.T) { {p2p.Endpoint{Path: "foo"}, "/foo"}, } for _, tc := range testcases { - tc := tc t.Run(tc.expect, func(t *testing.T) { require.Equal(t, tc.expect, tc.endpoint.String()) }) diff --git a/libs/bits/bit_array.go b/libs/bits/bit_array.go index 41ef07176..0a20f113f 100644 --- a/libs/bits/bit_array.go +++ b/libs/bits/bit_array.go @@ -66,10 +66,10 @@ func (bA *BitArray) GetIndex(i int) bool { } func (bA *BitArray) getIndex(i int) bool { - if i >= bA.Bits { + if i < 0 || i >= bA.Bits { return false } - return bA.Elems[i/64]&(uint64(1)< 0 + return bA.Elems[i/64]&(uint64(1)<<(i%64)) > 0 } // SetIndex sets the bit at index i within the bit array. @@ -88,9 +88,9 @@ func (bA *BitArray) setIndex(i int, v bool) bool { return false } if v { - bA.Elems[i/64] |= (uint64(1) << uint(i%64)) + bA.Elems[i/64] |= (uint64(1) << (i % 64)) } else { - bA.Elems[i/64] &= ^(uint64(1) << uint(i%64)) + bA.Elems[i/64] &= ^(uint64(1) << (i % 64)) } return true } @@ -243,9 +243,9 @@ func (bA *BitArray) IsFull() bool { } // Check that the last element has (lastElemBits) 1's - lastElemBits := (bA.Bits+63)%64 + 1 + lastElemBits := tmmath.MustConvert[int, uint]((bA.Bits+63)%64 + 1) lastElem := bA.Elems[len(bA.Elems)-1] - return (lastElem+1)&((uint64(1)< 0 { + if (elem & (uint64(1) << j)) > 0 { trueIndices = append(trueIndices, curBit) } curBit++ @@ -293,9 +293,9 @@ func (bA *BitArray) getTrueIndices() []int { } // handle last element lastElem := bA.Elems[numElems-1] - numFinalBits := bA.Bits - curBit - for i := 0; i < numFinalBits; i++ { - if (lastElem & (uint64(1) << uint64(i))) > 0 { + numFinalBits := tmmath.MustConvert[int, uint64](bA.Bits - curBit) + for i := uint64(0); i < numFinalBits; i++ { + if (lastElem & (uint64(1) << i)) > 0 { trueIndices = append(trueIndices, curBit) } curBit++ diff --git a/libs/bits/bit_array_test.go b/libs/bits/bit_array_test.go index e5f898298..66748af52 100644 --- a/libs/bits/bit_array_test.go +++ b/libs/bits/bit_array_test.go @@ -240,7 +240,6 @@ func TestJSONMarshalUnmarshal(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.bA.String(), func(t *testing.T) { bz, err := json.Marshal(tc.bA) require.NoError(t, err) diff --git a/libs/bytes/bytes.go b/libs/bytes/bytes.go index 6737864e2..6e0bd7f5a 100644 --- a/libs/bytes/bytes.go +++ b/libs/bytes/bytes.go @@ -75,11 +75,15 @@ func (bz HexBytes) ReverseBytes() HexBytes { // with leading 0x (%p), or casts HexBytes to bytes and writes as hexadecimal // string to s. func (bz HexBytes) Format(s fmt.State, verb rune) { + var err error switch verb { case 'p': - s.Write([]byte(fmt.Sprintf("%p", bz))) + _, err = s.Write([]byte(fmt.Sprintf("%p", bz))) default: - s.Write([]byte(fmt.Sprintf("%X", []byte(bz)))) + _, err = s.Write([]byte(fmt.Sprintf("%X", []byte(bz)))) + } + if err != nil { + panic(fmt.Errorf("tmbytes.Format failed: %w", err)) } } diff --git a/libs/math/safemath.go b/libs/math/safemath.go index 9afb409b2..1a11c9124 100644 --- a/libs/math/safemath.go +++ b/libs/math/safemath.go @@ -8,9 +8,11 @@ import ( var ErrOverflowInt64 = errors.New("int64 overflow") var ErrOverflowInt32 = errors.New("int32 overflow") +var ErrOverflowUint64 = errors.New("uint64 overflow") var ErrOverflowUint32 = errors.New("uint32 overflow") var ErrOverflowUint8 = errors.New("uint8 overflow") var ErrOverflowInt8 = errors.New("int8 overflow") +var ErrOverflow = errors.New("integer overflow") // SafeAddClipInt64 adds two int64 integers and clips the result to the int64 range. func SafeAddClipInt64(a, b int64) int64 { @@ -98,6 +100,58 @@ type Integer interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 } +// SafeConvert converts a value of type T to a value of type U. +// It returns an error if the conversion would cause an overflow. +func SafeConvert[T Integer, U Integer](from T) (U, error) { + const uintIsSmall = math.MaxUint < math.MaxUint64 + const intIsSmall = math.MaxInt < math.MaxInt64 && math.MinInt > math.MinInt64 + + // special case for int64 and uint64 inputs; all other types are safe to convert to int64 + switch any(from).(type) { + case int64: + // conversion from int64 to uint64 - we need to check for negative values + if _, ok := any(U(0)).(uint64); ok && from < 0 { + return 0, ErrOverflow + } + return U(from), nil + case uint64: + // conversion from uint64 to int64 - we need to check for overflow + if _, ok := any(U(0)).(int64); ok && uint64(from) > math.MaxInt64 { + return 0, ErrOverflow + } + return U(from), nil + case int: + if !intIsSmall { + return SafeConvert[int64, U](int64(from)) + } + // no return here - it's safe to use normal logic + case uint: + if !uintIsSmall { + return SafeConvert[uint64, U](uint64(from)) + } + // no return here - it's safe to use normal logic + } + if uint64(from) > Max[U]() { + return 0, ErrOverflow + } + if int64(from) < Min[U]() { + return 0, ErrOverflow + } + return U(from), nil +} + +func MustConvert[FROM Integer, TO Integer](a FROM) TO { + i, err := SafeConvert[FROM, TO](a) + if err != nil { + panic(fmt.Errorf("cannot convert %d to %T: %w", a, any(i), err)) + } + return i +} + +func MustConvertUint64[T Integer](a T) uint64 { + return MustConvert[T, uint64](a) +} + // MustConvertInt32 takes an Integer and converts it to int32. // Panics if the conversion overflows. func MustConvertInt32[T Integer](a T) int32 { @@ -159,3 +213,52 @@ func SafeMulInt64(a, b int64) (int64, bool) { return a * b, false } + +// Max returns the maximum value for a type T. +func Max[T Integer]() uint64 { + var max T + switch any(max).(type) { + case int: + return uint64(math.MaxInt) + case int8: + return uint64(math.MaxInt8) + case int16: + return uint64(math.MaxInt16) + case int32: + return uint64(math.MaxInt32) + case int64: + return uint64(math.MaxInt64) + case uint: + return uint64(math.MaxUint) + case uint8: + return uint64(math.MaxUint8) + case uint16: + return uint64(math.MaxUint16) + case uint32: + return uint64(math.MaxUint32) + case uint64: + return uint64(math.MaxUint64) + default: + panic("unsupported type") + } +} + +// Min returns the minimum value for a type T. +func Min[T Integer]() int64 { + switch any(T(0)).(type) { + case int: + return int64(math.MinInt) + case int8: + return int64(math.MinInt8) + case int16: + return int64(math.MinInt16) + case int32: + return int64(math.MinInt32) + case int64: + return math.MinInt64 + case uint, uint8, uint16, uint32, uint64: + return 0 + default: + panic("unsupported type") + } +} diff --git a/libs/math/safemath_test.go b/libs/math/safemath_test.go index 92a8f3211..98a57e116 100644 --- a/libs/math/safemath_test.go +++ b/libs/math/safemath_test.go @@ -84,3 +84,108 @@ func TestSafeMul(t *testing.T) { assert.Equal(t, tc.overflow, overflow, "#%d", i) } } + +func TestSafeConvert(t *testing.T) { + testCases := []struct { + from interface{} + want interface{} + err bool + }{ + {int(0), int64(0), false}, + {int(math.MaxInt), int64(math.MaxInt), false}, + {int(math.MinInt), int64(math.MinInt), false}, + {uint(0), uint64(0), false}, + {uint(math.MaxUint), uint64(math.MaxUint), false}, + {int64(0), uint64(0), false}, + {int64(math.MaxInt64), uint64(math.MaxInt64), false}, + {int64(math.MinInt64), uint64(0), true}, + {uint64(math.MaxUint64), int64(0), true}, + {uint64(math.MaxInt64), int64(math.MaxInt64), false}, + {int32(-1), uint32(0), true}, + {int32(0), uint32(0), false}, + {int32(math.MaxInt32), uint32(math.MaxInt32), false}, + {int32(math.MaxInt32), int16(0), true}, + {int32(math.MinInt32), int16(0), true}, + {int32(0), int16(0), false}, + {uint32(math.MaxUint32), int32(0), true}, + {uint32(math.MaxInt32), int32(math.MaxInt32), false}, + {uint32(0), int32(0), false}, + {int16(0), uint32(0), false}, + {int16(-1), uint32(0), true}, + {int16(math.MaxInt16), uint32(math.MaxInt16), false}, + } + + for i, tc := range testCases { + var result interface{} + var err error + + switch from := tc.from.(type) { + case int: + switch tc.want.(type) { + case int64: + result, err = SafeConvert[int, int64](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + case uint: + switch tc.want.(type) { + case uint64: + result, err = SafeConvert[uint, uint64](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + case int64: + switch tc.want.(type) { + case uint64: + result, err = SafeConvert[int64, uint64](from) + case int64: + result, err = SafeConvert[int64, int64](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + case uint64: + switch tc.want.(type) { + case int64: + result, err = SafeConvert[uint64, int64](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + case int32: + switch tc.want.(type) { + case int16: + result, err = SafeConvert[int32, int16](from) + case uint32: + result, err = SafeConvert[int32, uint32](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + case uint32: + switch tc.want.(type) { + case int16: + result, err = SafeConvert[uint32, int16](from) + case int32: + result, err = SafeConvert[uint32, int32](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + case int16: + switch tc.want.(type) { + case int32: + result, err = SafeConvert[int16, int32](from) + case uint32: + result, err = SafeConvert[int16, uint32](from) + default: + t.Fatalf("test case %d: unsupported target type %T", i, tc.want) + } + default: + t.Fatalf("test case %d: unsupported source type %T", i, tc.from) + } + + if (err != nil) != tc.err { + t.Errorf("test case %d: expected error %v, got %v", i, tc.err, err) + } + if err == nil && result != tc.want { + t.Errorf("test case %d: expected result %v, got %v", i, tc.want, result) + } + } +} diff --git a/rpc/jsonrpc/server/http_json_handler.go b/rpc/jsonrpc/server/http_json_handler.go index 9ff030e5e..fc114790f 100644 --- a/rpc/jsonrpc/server/http_json_handler.go +++ b/rpc/jsonrpc/server/http_json_handler.go @@ -57,11 +57,10 @@ func makeJSONRPCHandler(funcMap map[string]*RPCFunc, logger log.Logger) http.Han rpcFunc, ok := funcMap[req.Method] if !ok || rpcFunc.ws { - responses = append(responses, req.MakeErrorf(rpctypes.CodeMethodNotFound, req.Method)) + responses = append(responses, req.MakeErrorf(rpctypes.CodeMethodNotFound, "%s", req.Method)) continue } - req := req ctx := rpctypes.WithCallInfo(hreq.Context(), &rpctypes.CallInfo{ RPCRequest: &req, HTTPRequest: hreq, diff --git a/rpc/jsonrpc/server/http_json_handler_test.go b/rpc/jsonrpc/server/http_json_handler_test.go index 033b39d9f..ab3d6fc1a 100644 --- a/rpc/jsonrpc/server/http_json_handler_test.go +++ b/rpc/jsonrpc/server/http_json_handler_test.go @@ -25,8 +25,8 @@ func testMux() *http.ServeMux { H json.Number `json:"h"` } funcMap := map[string]*RPCFunc{ - "c": NewRPCFunc(func(ctx context.Context, arg *testArgs) (string, error) { return "foo", nil }), - "block": NewRPCFunc(func(ctx context.Context, arg *blockArgs) (string, error) { return "block", nil }), + "c": NewRPCFunc(func(_ context.Context, _ *testArgs) (string, error) { return "foo", nil }), + "block": NewRPCFunc(func(_ context.Context, _ *blockArgs) (string, error) { return "block", nil }), } mux := http.NewServeMux() logger := log.NewNopLogger() diff --git a/rpc/jsonrpc/server/http_server_test.go b/rpc/jsonrpc/server/http_server_test.go index 646f120ad..bd374486e 100644 --- a/rpc/jsonrpc/server/http_server_test.go +++ b/rpc/jsonrpc/server/http_server_test.go @@ -39,7 +39,7 @@ func TestMaxOpenConnections(t *testing.T) { // Start the server. var open int32 mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { if n := atomic.AddInt32(&open, 1); n > int32(max) { t.Errorf("%d open connections, want <= %d", n, max) } @@ -88,7 +88,7 @@ func TestServeTLS(t *testing.T) { defer ln.Close() mux := http.NewServeMux() - mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("/", func(w http.ResponseWriter, _ *http.Request) { fmt.Fprint(w, "some body") }) diff --git a/rpc/jsonrpc/server/parse_test.go b/rpc/jsonrpc/server/parse_test.go index c95cacf79..bb00bb57a 100644 --- a/rpc/jsonrpc/server/parse_test.go +++ b/rpc/jsonrpc/server/parse_test.go @@ -137,7 +137,7 @@ func TestParseJSONRPC(t *testing.T) { Height int `json:"height,string"` Name string `json:"name"` } - demo := func(ctx context.Context, _ *demoArgs) error { return nil } + demo := func(_ context.Context, _ *demoArgs) error { return nil } rfunc := NewRPCFunc(demo) cases := []struct { diff --git a/rpc/jsonrpc/server/rpc_func.go b/rpc/jsonrpc/server/rpc_func.go index 677106414..e6dc326d7 100644 --- a/rpc/jsonrpc/server/rpc_func.go +++ b/rpc/jsonrpc/server/rpc_func.go @@ -105,11 +105,11 @@ func (rf *RPCFunc) parseParams(ctx context.Context, params json.RawMessage) ([]r } bits, err := rf.adjustParams(params) if err != nil { - return nil, invalidParamsError(err.Error()) + return nil, invalidParamsError("%s", err.Error()) } arg := reflect.New(rf.param) if err := json.Unmarshal(bits, arg.Interface()); err != nil { - return nil, invalidParamsError(err.Error()) + return nil, invalidParamsError("%s", err.Error()) } return []reflect.Value{reflect.ValueOf(ctx), arg}, nil } diff --git a/rpc/jsonrpc/server/ws_handler.go b/rpc/jsonrpc/server/ws_handler.go index 0f9ed2dab..d50c921c0 100644 --- a/rpc/jsonrpc/server/ws_handler.go +++ b/rpc/jsonrpc/server/ws_handler.go @@ -40,7 +40,7 @@ func NewWebsocketManager(logger log.Logger, funcMap map[string]*RPCFunc, wsConnO return &WebsocketManager{ funcMap: funcMap, Upgrader: websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { + CheckOrigin: func(_ *http.Request) bool { // TODO ??? // // The default behavior would be relevant to browser-based clients, @@ -268,7 +268,7 @@ func (wsc *wsConnection) readRoutine(ctx context.Context) { } }() - wsc.baseConn.SetPongHandler(func(m string) error { + wsc.baseConn.SetPongHandler(func(_ string) error { return wsc.baseConn.SetReadDeadline(time.Now().Add(wsc.readWait)) }) @@ -321,7 +321,7 @@ func (wsc *wsConnection) readRoutine(ctx context.Context) { rpcFunc := wsc.funcMap[request.Method] if rpcFunc == nil { if err := wsc.WriteRPCResponse(writeCtx, - request.MakeErrorf(rpctypes.CodeMethodNotFound, request.Method)); err != nil { + request.MakeErrorf(rpctypes.CodeMethodNotFound, "%s", request.Method)); err != nil { wsc.Logger.Error("error writing RPC response", "err", err) } continue diff --git a/test/e2e/pkg/mockcoreserver/core_server.go b/test/e2e/pkg/mockcoreserver/core_server.go index 4b6025e12..ea92ea8a5 100644 --- a/test/e2e/pkg/mockcoreserver/core_server.go +++ b/test/e2e/pkg/mockcoreserver/core_server.go @@ -9,6 +9,7 @@ import ( "github.com/dashpay/dashd-go/btcjson" "github.com/dashpay/tenderdash/crypto" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/privval" "github.com/dashpay/tenderdash/types" ) @@ -69,7 +70,7 @@ func (c *MockCoreServer) QuorumInfo(ctx context.Context, cmd btcjson.QuorumCmd) panic(err) } return btcjson.QuorumInfoResult{ - Height: uint32(height), + Height: tmmath.MustConvertUint32(height), Type: strconv.Itoa(int(c.LLMQType)), QuorumHash: quorumHash.String(), Members: members, diff --git a/test/e2e/pkg/mockcoreserver/expect.go b/test/e2e/pkg/mockcoreserver/expect.go index d2659bb3d..a6f1da056 100644 --- a/test/e2e/pkg/mockcoreserver/expect.go +++ b/test/e2e/pkg/mockcoreserver/expect.go @@ -86,7 +86,7 @@ func And(fns ...ExpectFunc) ExpectFunc { // JRPCRequest transforms http.Request into btcjson.Request and executes passed list of functions func JRPCRequest(fns ...func(ctx context.Context, req btcjson.Request) error) ExpectFunc { return func(req *http.Request) error { - jReq, ok := req.Context().Value(jRPCRequestKey).(btcjson.Request) + jReq, ok := req.Context().Value(jRPCRequestKey{}).(btcjson.Request) if !ok { return errors.New("missed btcjson.Request in a context") } @@ -102,8 +102,8 @@ func JRPCRequest(fns ...func(ctx context.Context, req btcjson.Request) error) Ex // JRPCParamsEmpty is a request expectation of empty JRPC params func JRPCParamsEmpty() ExpectFunc { - return JRPCRequest(func(ctx context.Context, req btcjson.Request) error { - if req.Params != nil && len(req.Params) > 0 { + return JRPCRequest(func(_ context.Context, req btcjson.Request) error { + if len(req.Params) > 0 { return errors.New("jRPC request params should be empty") } return nil diff --git a/test/e2e/pkg/mockcoreserver/server.go b/test/e2e/pkg/mockcoreserver/server.go index 67cb10fbb..c38d49700 100644 --- a/test/e2e/pkg/mockcoreserver/server.go +++ b/test/e2e/pkg/mockcoreserver/server.go @@ -16,7 +16,7 @@ import ( "github.com/dashpay/dashd-go/btcjson" ) -var jRPCRequestKey = struct{}{} +type jRPCRequestKey struct{} // MockServer ... type MockServer interface { @@ -144,7 +144,7 @@ func (s *JRPCServer) Start() { return err } // put unmarshalled JRPC request into a context - ctx := context.WithValue(req.Context(), jRPCRequestKey, jReq) + ctx := context.WithValue(req.Context(), jRPCRequestKey{}, jReq) return call.execute(w, req.WithContext(ctx)) } s.httpSrv.Start() diff --git a/types/block.go b/types/block.go index 10901ca37..798c5c5e6 100644 --- a/types/block.go +++ b/types/block.go @@ -547,11 +547,11 @@ func (h *Header) StateID() tmproto.StateID { appHash = make([]byte, crypto.DefaultAppHashSize) } - ts := uint64(h.Time.UnixMilli()) + ts := tmmath.MustConvertUint64(h.Time.UnixMilli()) return tmproto.StateID{ AppVersion: h.Version.App, - Height: uint64(h.Height), + Height: tmmath.MustConvertUint64(h.Height), AppHash: appHash, CoreChainLockedHeight: h.CoreChainLockedHeight, Time: ts, @@ -804,9 +804,9 @@ func (commit *Commit) GetCanonicalVote() *Vote { func (commit *Commit) VoteBlockRequestID() []byte { requestIDMessage := []byte("dpbvote") heightByteArray := make([]byte, 8) - binary.LittleEndian.PutUint64(heightByteArray, uint64(commit.Height)) + binary.LittleEndian.PutUint64(heightByteArray, tmmath.MustConvertUint64(commit.Height)) roundByteArray := make([]byte, 4) - binary.LittleEndian.PutUint32(roundByteArray, uint32(commit.Round)) + binary.LittleEndian.PutUint32(roundByteArray, tmmath.MustConvertUint32(commit.Round)) requestIDMessage = append(requestIDMessage, heightByteArray...) requestIDMessage = append(requestIDMessage, roundByteArray...) diff --git a/types/block_meta_test.go b/types/block_meta_test.go index 600b5592c..cb2b827ef 100644 --- a/types/block_meta_test.go +++ b/types/block_meta_test.go @@ -34,7 +34,6 @@ func TestBlockMeta_ToProto(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.testName, func(t *testing.T) { pb := tt.bm.ToProto() @@ -93,7 +92,6 @@ func TestBlockMeta_ValidateBasic(t *testing.T) { {"failure wrong length blockID hash", bm3, true}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if err := tt.bm.ValidateBasic(); (err != nil) != tt.wantErr { t.Errorf("BlockMeta.ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/types/block_test.go b/types/block_test.go index 0b6139e58..bdddf7e92 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -327,7 +327,6 @@ func TestCommitValidateBasic(t *testing.T) { {"Incorrect round", func(com *Commit) { com.Round = -100 }, true}, } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -893,7 +892,6 @@ func TestHeaderProto(t *testing.T) { } for _, tt := range tc { - tt := tt t.Run(tt.msg, func(t *testing.T) { pb := tt.h1.ToProto() h, err := HeaderFromProto(pb) @@ -1262,8 +1260,6 @@ func TestHeader_ValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { err := tc.header.ValidateBasic() if tc.expectErr { @@ -1377,8 +1373,6 @@ func TestCommit_ValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.name, func(t *testing.T) { err := tc.commit.ValidateBasic() if tc.expectErr { diff --git a/types/canonical_test.go b/types/canonical_test.go index ab05d0b32..080647659 100644 --- a/types/canonical_test.go +++ b/types/canonical_test.go @@ -40,7 +40,6 @@ func TestCanonicalizeBlockID(t *testing.T) { {"second", block2, &cblock2}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if got := tt.args.ToCanonicalBlockID(); !reflect.DeepEqual(got, tt.want) { t.Errorf("CanonicalizeBlockID() = %v, want %v", got, tt.want) diff --git a/types/evidence_test.go b/types/evidence_test.go index 19df99c4f..b02dacbe0 100644 --- a/types/evidence_test.go +++ b/types/evidence_test.go @@ -155,7 +155,6 @@ func TestDuplicateVoteEvidenceValidation(t *testing.T) { }, true}, } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { const height int64 = math.MaxInt64 vote1 := makeVote(ctx, t, val, chainID, math.MaxInt32, height, math.MaxInt32, 0x02, quorumType, @@ -250,7 +249,6 @@ func TestEvidenceProto(t *testing.T) { {"DuplicateVoteEvidence success", &DuplicateVoteEvidence{VoteA: v2, VoteB: v}, false, false}, } for _, tt := range tests { - tt := tt t.Run(tt.testName, func(t *testing.T) { pb, err := EvidenceToProto(tt.evidence) if tt.toProtoErr { @@ -307,7 +305,6 @@ func TestEvidenceVectors(t *testing.T) { } for _, tc := range testCases { - tc := tc hash := tc.evList.Hash() require.Equal(t, tc.expBytes, hex.EncodeToString(hash), tc.testName) } diff --git a/types/light_test.go b/types/light_test.go index bba922c2b..7f79ec94a 100644 --- a/types/light_test.go +++ b/types/light_test.go @@ -179,7 +179,6 @@ func TestSignedHeaderValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { sh := SignedHeader{ Header: tc.shHeader, diff --git a/types/node_info.go b/types/node_info.go index ffb14e215..e2d884486 100644 --- a/types/node_info.go +++ b/types/node_info.go @@ -10,6 +10,7 @@ import ( "github.com/dashpay/tenderdash/crypto" tmstrings "github.com/dashpay/tenderdash/internal/libs/strings" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" + tmmath "github.com/dashpay/tenderdash/libs/math" tmp2p "github.com/dashpay/tenderdash/proto/tendermint/p2p" ) @@ -250,7 +251,7 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) { } for _, ch := range pb.Channels { - dni.Channels.Append(uint16(ch)) + dni.Channels.Append(tmmath.MustConvert[uint32, uint16](ch)) } return dni, nil From 311913042d04726391b8a5a115fb9566de34923e Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Sat, 12 Oct 2024 01:26:44 +0200 Subject: [PATCH 10/27] chore: lint issues, continued --- abci/client/socket_client_test.go | 2 -- cmd/tenderdash/commands/compact.go | 1 - config/config_test.go | 3 --- crypto/ed25519/bench_test.go | 1 - crypto/merkle/proof_test.go | 1 - crypto/merkle/rfc6962_test.go | 1 - crypto/merkle/tree_test.go | 1 - crypto/secp256k1/secp256k1_internal_test.go | 1 - crypto/secp256k1/secp256k1_test.go | 1 - dash/llmq/llmq.go | 4 ++-- dash/llmq/llmq_test.go | 1 - internal/consensus/msgs_test.go | 11 --------- internal/consensus/replay_test.go | 1 - internal/consensus/wal_test.go | 2 -- internal/eventbus/event_bus_test.go | 1 - internal/evidence/pool_test.go | 2 -- internal/evidence/reactor_test.go | 6 ++--- internal/mempool/mempool.go | 1 - internal/p2p/router_filter_test.go | 2 +- internal/p2p/router_test.go | 3 --- internal/p2p/transport_mconn_test.go | 1 - internal/p2p/transport_test.go | 3 --- internal/state/execution_test.go | 2 -- internal/state/indexer/block/kv/kv_test.go | 1 - internal/state/indexer/sink/kv/kv_test.go | 2 -- internal/state/indexer/tx/kv/kv_test.go | 2 -- internal/state/state_test.go | 1 - internal/state/store_test.go | 2 -- internal/statesync/reactor_test.go | 2 -- internal/statesync/snapshots_test.go | 1 - internal/statesync/syncer_test.go | 5 +--- internal/store/store_test.go | 2 -- libs/bytes/bytes_test.go | 1 - libs/log/default_test.go | 1 - libs/promise/promise_test.go | 4 ++-- libs/workerpool/worker_pool_test.go | 9 ++++--- privval/grpc/server_test.go | 2 -- rpc/client/rpc_test.go | 1 - rpc/jsonrpc/client/http_json_client_test.go | 1 - scripts/keymigrate/migrate.go | 1 - scripts/metricsgen/metricsgen.go | 2 +- test/e2e/generator/generate.go | 11 +++++---- test/e2e/generator/main.go | 2 +- test/e2e/runner/main.go | 26 ++++++++++----------- types/node_info_test.go | 1 - types/part_set_test.go | 2 -- types/proposal_test.go | 1 - types/validation_test.go | 1 - types/validator_set_test.go | 2 -- types/vote_test.go | 1 - 50 files changed, 33 insertions(+), 106 deletions(-) diff --git a/abci/client/socket_client_test.go b/abci/client/socket_client_test.go index b17940a7a..3bd58f2df 100644 --- a/abci/client/socket_client_test.go +++ b/abci/client/socket_client_test.go @@ -45,8 +45,6 @@ func TestSocketClientTimeout(t *testing.T) { logger := log.NewTestingLogger(t) for i, tc := range testCases { - i := i - tc := tc t.Run(tc.name, func(t *testing.T) { // wait until all threads end, otherwise we'll get data race in t.Log() diff --git a/cmd/tenderdash/commands/compact.go b/cmd/tenderdash/commands/compact.go index a9360c0a0..118fe8e7f 100644 --- a/cmd/tenderdash/commands/compact.go +++ b/cmd/tenderdash/commands/compact.go @@ -48,7 +48,6 @@ func compactGoLevelDBs(rootDir string, logger log.Logger) { wg := sync.WaitGroup{} for _, dbName := range dbNames { - dbName := dbName wg.Add(1) go func() { defer wg.Done() diff --git a/config/config_test.go b/config/config_test.go index 03c70fe81..6aadfb715 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -71,8 +71,6 @@ func TestAbciConfigValidation(t *testing.T) { } for _, tc := range invalidCases { - tc := tc - t.Run(tc.name+" on validator", func(t *testing.T) { cfg := DefaultConfig() cfg.Mode = ModeValidator @@ -183,7 +181,6 @@ func TestConsensusConfig_ValidateBasic(t *testing.T) { "DoubleSignCheckHeight negative": {func(c *ConsensusConfig) { c.DoubleSignCheckHeight = -1 }, true}, } for desc, tc := range testcases { - tc := tc // appease linter t.Run(desc, func(t *testing.T) { cfg := DefaultConsensusConfig() tc.modify(cfg) diff --git a/crypto/ed25519/bench_test.go b/crypto/ed25519/bench_test.go index ece351875..ecf8cdf3d 100644 --- a/crypto/ed25519/bench_test.go +++ b/crypto/ed25519/bench_test.go @@ -32,7 +32,6 @@ func BenchmarkVerifyBatch(b *testing.B) { msg := []byte("BatchVerifyTest") for _, sigsCount := range []int{1, 8, 64, 1024} { - sigsCount := sigsCount b.Run(fmt.Sprintf("sig-count-%d", sigsCount), func(b *testing.B) { // Pre-generate all of the keys, and signatures, but do not // benchmark key-generation and signing. diff --git a/crypto/merkle/proof_test.go b/crypto/merkle/proof_test.go index 5c6cddccf..d182f34b7 100644 --- a/crypto/merkle/proof_test.go +++ b/crypto/merkle/proof_test.go @@ -158,7 +158,6 @@ func TestProofValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { _, proofs := ProofsFromByteSlices([][]byte{ []byte("apple"), diff --git a/crypto/merkle/rfc6962_test.go b/crypto/merkle/rfc6962_test.go index 4e9dbaf4e..cdcd1a4bd 100644 --- a/crypto/merkle/rfc6962_test.go +++ b/crypto/merkle/rfc6962_test.go @@ -63,7 +63,6 @@ func TestRFC6962Hasher(t *testing.T) { got: innerHash([]byte("N123"), []byte("N456")), }, } { - tc := tc t.Run(tc.desc, func(t *testing.T) { wantBytes, err := hex.DecodeString(tc.want) if err != nil { diff --git a/crypto/merkle/tree_test.go b/crypto/merkle/tree_test.go index 384749c6a..0e186a381 100644 --- a/crypto/merkle/tree_test.go +++ b/crypto/merkle/tree_test.go @@ -34,7 +34,6 @@ func TestHashFromByteSlices(t *testing.T) { }, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { hash := HashFromByteSlices(tc.slices) assert.Equal(t, tc.expectHash, hex.EncodeToString(hash)) diff --git a/crypto/secp256k1/secp256k1_internal_test.go b/crypto/secp256k1/secp256k1_internal_test.go index 3556a4dd0..d384dcb38 100644 --- a/crypto/secp256k1/secp256k1_internal_test.go +++ b/crypto/secp256k1/secp256k1_internal_test.go @@ -29,7 +29,6 @@ func Test_genPrivKey(t *testing.T) { {"valid because 0 < 1 < N", validOne, false}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { if tt.shouldPanic { require.Panics(t, func() { diff --git a/crypto/secp256k1/secp256k1_test.go b/crypto/secp256k1/secp256k1_test.go index 0ee45013f..d2c1eea24 100644 --- a/crypto/secp256k1/secp256k1_test.go +++ b/crypto/secp256k1/secp256k1_test.go @@ -101,7 +101,6 @@ func TestGenPrivKeySecp256k1(t *testing.T) { {"another seed used in cosmos tests #3", []byte("")}, } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { gotPrivKey := secp256k1.GenPrivKeySecp256k1(tt.secret) require.NotNil(t, gotPrivKey) diff --git a/dash/llmq/llmq.go b/dash/llmq/llmq.go index 19ee0ec23..9e5ac0fb0 100644 --- a/dash/llmq/llmq.go +++ b/dash/llmq/llmq.go @@ -248,8 +248,8 @@ func initValidation() func(ld *blsLLMQData) error { return err } pk := bls12381.PubKey(ld.pks[0].Serialize()) - if err != nil { - return err + if len(pk) == 0 { + return fmt.Errorf("public key is empty") } if !thresholdPubKey.Equals(pk) { return fmt.Errorf( diff --git a/dash/llmq/llmq_test.go b/dash/llmq/llmq_test.go index 3e25b3cc5..b8c4700b7 100644 --- a/dash/llmq/llmq_test.go +++ b/dash/llmq/llmq_test.go @@ -184,7 +184,6 @@ func TestLLMQ(t *testing.T) { }, } for i, tc := range testCases { - tc := tc t.Run(fmt.Sprintf("test-case #%d", i), func(t *testing.T) { t.Parallel() llmqData := tc.llmqDataGetter() diff --git a/internal/consensus/msgs_test.go b/internal/consensus/msgs_test.go index 2dea8c9be..68191caaa 100644 --- a/internal/consensus/msgs_test.go +++ b/internal/consensus/msgs_test.go @@ -208,7 +208,6 @@ func TestMsgToProto(t *testing.T) { {"failure", nil, &tmcons.Message{}, true}, } for _, tt := range testsCases { - tt := tt t.Run(tt.testName, func(t *testing.T) { pb, err := MsgToProto(tt.msg) if tt.wantErr == true { @@ -314,7 +313,6 @@ func TestWALMsgProto(t *testing.T) { {"failure", nil, &tmcons.WALMessage{}, true}, } for _, tt := range testsCases { - tt := tt t.Run(tt.testName, func(t *testing.T) { pb, err := WALToProto(tt.msg) if tt.wantErr == true { @@ -442,7 +440,6 @@ func TestConsMsgsVectors(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { bz, err := proto.Marshal(tc.cMsg) require.NoError(t, err) @@ -483,7 +480,6 @@ func TestVoteSetMaj23MessageValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { message := VoteSetMaj23Message{ Height: tc.messageHeight, @@ -519,7 +515,6 @@ func TestVoteSetBitsMessageValidateBasic(t *testing.T) { } for i, tc := range testCases { - tc := tc t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { msg := &VoteSetBitsMessage{ Height: 1, @@ -557,7 +552,6 @@ func TestNewRoundStepMessageValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { message := NewRoundStepMessage{ Height: tc.messageHeight, @@ -592,7 +586,6 @@ func TestNewRoundStepMessageValidateHeight(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { message := NewRoundStepMessage{ Height: tc.messageHeight, @@ -637,7 +630,6 @@ func TestNewValidBlockMessageValidateBasic(t *testing.T) { } for i, tc := range testCases { - tc := tc t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { msg := &NewValidBlockMessage{ Height: 1, @@ -671,7 +663,6 @@ func TestProposalPOLMessageValidateBasic(t *testing.T) { } for i, tc := range testCases { - tc := tc t.Run(fmt.Sprintf("#%d", i), func(t *testing.T) { msg := &ProposalPOLMessage{ Height: 1, @@ -704,7 +695,6 @@ func TestBlockPartMessageValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { message := BlockPartMessage{ Height: tc.messageHeight, @@ -744,7 +734,6 @@ func TestHasVoteMessageValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { message := HasVoteMessage{ Height: tc.messageHeight, diff --git a/internal/consensus/replay_test.go b/internal/consensus/replay_test.go index 671329c9e..c2a1b9cbf 100644 --- a/internal/consensus/replay_test.go +++ b/internal/consensus/replay_test.go @@ -139,7 +139,6 @@ func TestWALCrash(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/internal/consensus/wal_test.go b/internal/consensus/wal_test.go index cdc703da2..fbbda477d 100644 --- a/internal/consensus/wal_test.go +++ b/internal/consensus/wal_test.go @@ -84,8 +84,6 @@ func TestWALEncoderDecoder(t *testing.T) { b := new(bytes.Buffer) for _, msg := range msgs { - msg := msg - b.Reset() enc := NewWALEncoder(b) diff --git a/internal/eventbus/event_bus_test.go b/internal/eventbus/event_bus_test.go index d993a25a0..13a468a64 100644 --- a/internal/eventbus/event_bus_test.go +++ b/internal/eventbus/event_bus_test.go @@ -467,7 +467,6 @@ func BenchmarkEventBus(b *testing.B) { } for _, bm := range benchmarks { - bm := bm b.Run(bm.name, func(b *testing.B) { benchmarkEventBus(bm.numClients, bm.randQueries, bm.randEvents, b) }) diff --git a/internal/evidence/pool_test.go b/internal/evidence/pool_test.go index 036f1df60..a07b74465 100644 --- a/internal/evidence/pool_test.go +++ b/internal/evidence/pool_test.go @@ -169,8 +169,6 @@ func TestAddExpiredEvidence(t *testing.T) { } for _, tc := range testCases { - tc := tc - t.Run(tc.evDescription, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/internal/evidence/reactor_test.go b/internal/evidence/reactor_test.go index 615405281..c142ebbdb 100644 --- a/internal/evidence/reactor_test.go +++ b/internal/evidence/reactor_test.go @@ -99,14 +99,14 @@ func setup(ctx context.Context, t *testing.T, stateStores []sm.Store) *reactorTe rts.network.Nodes[nodeID].PeerManager.Register(ctx, pu) rts.nodes = append(rts.nodes, rts.network.Nodes[nodeID]) - chCreator := func(ctx context.Context, chdesc *p2p.ChannelDescriptor) (p2p.Channel, error) { + chCreator := func(_ context.Context, _ *p2p.ChannelDescriptor) (p2p.Channel, error) { return rts.evidenceChannels[nodeID], nil } rts.reactors[nodeID] = evidence.NewReactor( logger, chCreator, - func(ctx context.Context, _ string) *p2p.PeerUpdates { return pu }, + func(_ context.Context, _ string) *p2p.PeerUpdates { return pu }, rts.pools[nodeID]) require.NoError(t, rts.reactors[nodeID].Start(ctx)) @@ -571,8 +571,6 @@ func TestEvidenceListSerialization(t *testing.T) { } for name, tc := range testCases { - tc := tc - t.Run(name, func(t *testing.T) { protoEv := make([]tmproto.Evidence, len(tc.evidenceList)) for i := 0; i < len(tc.evidenceList); i++ { diff --git a/internal/mempool/mempool.go b/internal/mempool/mempool.go index c268dff0f..e97232c8a 100644 --- a/internal/mempool/mempool.go +++ b/internal/mempool/mempool.go @@ -776,7 +776,6 @@ func (txmp *TxMempool) recheckTransactions(ctx context.Context) { g, start := taskgroup.New(nil).Limit(2 * runtime.NumCPU()) for _, wtx := range wtxs { - wtx := wtx start(func() error { if err := ctx.Err(); err != nil { txmp.logger.Trace("recheck txs task canceled", "err", err, "tx", wtx.hash.String()) diff --git a/internal/p2p/router_filter_test.go b/internal/p2p/router_filter_test.go index e0aea8cfa..f3b51fafa 100644 --- a/internal/p2p/router_filter_test.go +++ b/internal/p2p/router_filter_test.go @@ -22,7 +22,7 @@ func TestConnectionFiltering(t *testing.T) { logger: logger, connTracker: newConnTracker(1, time.Second), options: RouterOptions{ - FilterPeerByIP: func(ctx context.Context, ip net.IP, port uint16) error { + FilterPeerByIP: func(_ context.Context, _ net.IP, port uint16) error { filterByIPCount++ return errors.New("mock") }, diff --git a/internal/p2p/router_test.go b/internal/p2p/router_test.go index d8cd615c8..3ba738a6c 100644 --- a/internal/p2p/router_test.go +++ b/internal/p2p/router_test.go @@ -318,7 +318,6 @@ func TestRouter_AcceptPeers(t *testing.T) { defer bcancel() for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { ctx, cancel := context.WithCancel(bctx) defer cancel() @@ -521,7 +520,6 @@ func TestRouter_DialPeers(t *testing.T) { defer bcancel() for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { t.Cleanup(leaktest.Check(t)) ctx, cancel := context.WithCancel(bctx) @@ -919,7 +917,6 @@ func TestRouter_Channel_Enqueue_Timeout(t *testing.T) { // defer cancel() for _, tc := range testCases { - tc := tc t.Run(fmt.Sprintf("send=%d,recv=%d,delay=%s", tc.sendCount, tc.expectedRecvCount, tc.delay), func(t *testing.T) { // timeout that will expire if we don't receive some of the expected messages ctxTimeout := tc.delay + 200*time.Millisecond diff --git a/internal/p2p/transport_mconn_test.go b/internal/p2p/transport_mconn_test.go index 3cbcac3dc..42f81447f 100644 --- a/internal/p2p/transport_mconn_test.go +++ b/internal/p2p/transport_mconn_test.go @@ -153,7 +153,6 @@ func TestMConnTransport_Listen(t *testing.T) { {&p2p.Endpoint{Protocol: p2p.MConnProtocol, IP: net.IPv4zero, Path: "foo"}, false}, } for _, tc := range testcases { - tc := tc t.Run(tc.endpoint.String(), func(t *testing.T) { t.Cleanup(leaktest.Check(t)) diff --git a/internal/p2p/transport_test.go b/internal/p2p/transport_test.go index 928166e25..b032d6069 100644 --- a/internal/p2p/transport_test.go +++ b/internal/p2p/transport_test.go @@ -28,7 +28,6 @@ var testTransports = map[string]transportFactory{} func withTransports(ctx context.Context, t *testing.T, tester func(context.Context, *testing.T, transportFactory)) { t.Helper() for name, transportFactory := range testTransports { - transportFactory := transportFactory t.Run(name, func(t *testing.T) { t.Cleanup(leaktest.Check(t)) tctx, cancel := context.WithCancel(ctx) @@ -126,7 +125,6 @@ func TestTransport_DialEndpoints(t *testing.T) { // Tests for networked endpoints (with IP). if len(endpoint.IP) > 0 && endpoint.Protocol != p2p.MemoryProtocol { for _, tc := range ipTestCases { - tc := tc t.Run(tc.ip.String(), func(t *testing.T) { e := endpoint require.NotNil(t, e) @@ -586,7 +584,6 @@ func TestEndpoint_Validate(t *testing.T) { {p2p.Endpoint{Protocol: "tcp", Port: 8080, Path: "path"}, false}, } for _, tc := range testcases { - tc := tc t.Run(tc.endpoint.String(), func(t *testing.T) { err := tc.endpoint.Validate() if tc.expectValid { diff --git a/internal/state/execution_test.go b/internal/state/execution_test.go index c94602d3a..dfa053f16 100644 --- a/internal/state/execution_test.go +++ b/internal/state/execution_test.go @@ -485,7 +485,6 @@ func TestValidateValidatorUpdates(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { err := sm.ValidateValidatorUpdates(tc.abciUpdates, tc.validatorParams) if tc.shouldErr { @@ -571,7 +570,6 @@ func TestUpdateValidators(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { updates, _, _, err := types.PB2TM.ValidatorUpdatesFromValidatorSet(tc.abciUpdates) assert.NoError(t, err) diff --git a/internal/state/indexer/block/kv/kv_test.go b/internal/state/indexer/block/kv/kv_test.go index 4d5552745..78ed412a8 100644 --- a/internal/state/indexer/block/kv/kv_test.go +++ b/internal/state/indexer/block/kv/kv_test.go @@ -123,7 +123,6 @@ func TestBlockIndexer(t *testing.T) { } for name, tc := range testCases { - tc := tc t.Run(name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/internal/state/indexer/sink/kv/kv_test.go b/internal/state/indexer/sink/kv/kv_test.go index 5ec843672..83100669d 100644 --- a/internal/state/indexer/sink/kv/kv_test.go +++ b/internal/state/indexer/sink/kv/kv_test.go @@ -142,7 +142,6 @@ func TestBlockFuncs(t *testing.T) { } for name, tc := range testCases { - tc := tc t.Run(name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -243,7 +242,6 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { ctx := context.Background() for _, tc := range testCases { - tc := tc t.Run(tc.q, func(t *testing.T) { results, err := indexer.SearchTxEvents(ctx, query.MustCompile(tc.q)) require.NoError(t, err) diff --git a/internal/state/indexer/tx/kv/kv_test.go b/internal/state/indexer/tx/kv/kv_test.go index 79f8b3217..06342d9c2 100644 --- a/internal/state/indexer/tx/kv/kv_test.go +++ b/internal/state/indexer/tx/kv/kv_test.go @@ -128,7 +128,6 @@ func TestTxSearch(t *testing.T) { ctx := context.Background() for _, tc := range testCases { - tc := tc t.Run(tc.q, func(t *testing.T) { results, err := indexer.Search(ctx, query.MustCompile(tc.q)) assert.NoError(t, err) @@ -227,7 +226,6 @@ func TestTxSearchDeprecatedIndexing(t *testing.T) { ctx := context.Background() for _, tc := range testCases { - tc := tc t.Run(tc.q, func(t *testing.T) { results, err := indexer.Search(ctx, query.MustCompile(tc.q)) require.NoError(t, err) diff --git a/internal/state/state_test.go b/internal/state/state_test.go index 9b8bb5938..7abee8ffd 100644 --- a/internal/state/state_test.go +++ b/internal/state/state_test.go @@ -693,7 +693,6 @@ func TestStateProto(t *testing.T) { } for _, tt := range tc { - tt := tt t.Run(tt.testName, func(t *testing.T) { pbs, err := tt.state.ToProto() if !tt.expPass1 { diff --git a/internal/state/store_test.go b/internal/state/store_test.go index a696f5a8c..90f0bca8c 100644 --- a/internal/state/store_test.go +++ b/internal/state/store_test.go @@ -196,7 +196,6 @@ func BenchmarkLoadValidators(b *testing.B) { b.ResetTimer() for i := 10; i < 10000000000; i *= 10 { // 10, 100, 1000, ... - i := i err = stateStore.Save(makeRandomStateFromValidatorSet(state.Validators, int64(i)-1, state.LastHeightValidatorsChanged, blockStore)) if err != nil { @@ -258,7 +257,6 @@ func TestPruneStates(t *testing.T) { "prune across checkpoint": {99900, 100002, 100002, false, 100000, 99995}, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { db := dbm.NewMemDB() diff --git a/internal/statesync/reactor_test.go b/internal/statesync/reactor_test.go index 40b06dad4..87c37e8df 100644 --- a/internal/statesync/reactor_test.go +++ b/internal/statesync/reactor_test.go @@ -425,8 +425,6 @@ func TestReactor_SnapshotsRequest(t *testing.T) { defer cancel() for name, tc := range testcases { - tc := tc - t.Run(name, func(t *testing.T) { ctx, cancel := context.WithCancel(ctx) defer cancel() diff --git a/internal/statesync/snapshots_test.go b/internal/statesync/snapshots_test.go index fd2d37da8..7c8c5f182 100644 --- a/internal/statesync/snapshots_test.go +++ b/internal/statesync/snapshots_test.go @@ -18,7 +18,6 @@ func TestSnapshot_Key(t *testing.T) { "no metadata": {func(s *snapshot) { s.Metadata = nil }}, } for name, tc := range testcases { - tc := tc t.Run(name, func(t *testing.T) { s := snapshot{ Height: 3, diff --git a/internal/statesync/syncer_test.go b/internal/statesync/syncer_test.go index 00da83c9e..971ffc858 100644 --- a/internal/statesync/syncer_test.go +++ b/internal/statesync/syncer_test.go @@ -603,7 +603,6 @@ func (suite *SyncerTestSuite) TestApplyChunksResults() { } for name, tc := range testCases { - tc := tc suite.Run(name, func() { suite.SetupTest() // reset ctx, cancel := context.WithCancel(suite.ctx) @@ -616,8 +615,7 @@ func (suite *SyncerTestSuite) TestApplyChunksResults() { fetchStartTime := time.Now() - c := &chunk{Height: 1, Version: 1, ID: []byte{0}, Chunk: body} - chunks.Enqueue(c.ID) + chunks.Enqueue([]byte{0}) for _, resp := range tc.resps { suite.conn. @@ -805,7 +803,6 @@ func (suite *SyncerTestSuite) TestApplyChunksRejectSenders() { defer cancel() for name, tc := range testCases { - tc := tc suite.Run(name, func() { for _, peerSnapshot := range peerSnapshots { for _, s := range peerSnapshot.snapshot { diff --git a/internal/store/store_test.go b/internal/store/store_test.go index f7dbbaa84..35bef97db 100644 --- a/internal/store/store_test.go +++ b/internal/store/store_test.go @@ -225,8 +225,6 @@ func TestBlockStoreSaveLoadBlock(t *testing.T) { } for i, tuple := range tuples { - tuple := tuple - bs, db := newInMemoryBlockStore() // SaveBlock res, err, panicErr := doFn(func() (interface{}, error) { diff --git a/libs/bytes/bytes_test.go b/libs/bytes/bytes_test.go index fb1200a04..00227538e 100644 --- a/libs/bytes/bytes_test.go +++ b/libs/bytes/bytes_test.go @@ -41,7 +41,6 @@ func TestJSONMarshal(t *testing.T) { } for i, tc := range cases { - tc := tc t.Run(fmt.Sprintf("Case %d", i), func(t *testing.T) { ts := TestStruct{B1: tc.input, B2: tc.input} diff --git a/libs/log/default_test.go b/libs/log/default_test.go index 5d828a544..d1d434423 100644 --- a/libs/log/default_test.go +++ b/libs/log/default_test.go @@ -32,7 +32,6 @@ func TestNewDefaultLogger(t *testing.T) { } for name, tc := range testCases { - tc := tc t.Run(name, func(t *testing.T) { _, err := log.NewDefaultLogger(tc.format, tc.level) diff --git a/libs/promise/promise_test.go b/libs/promise/promise_test.go index 2062c06c0..4915bebe8 100644 --- a/libs/promise/promise_test.go +++ b/libs/promise/promise_test.go @@ -22,13 +22,13 @@ func TestPromise(t *testing.T) { wantErr string }{ { - exec: func(resolve func(data data), reject func(err error)) { + exec: func(resolve func(data data), _ func(err error)) { resolve(data{value: 10}) }, wantVal: 10, }, { - exec: func(resolve func(data data), reject func(err error)) { + exec: func(_ func(data data), reject func(err error)) { reject(errors.New("reject")) }, wantErr: "reject", diff --git a/libs/workerpool/worker_pool_test.go b/libs/workerpool/worker_pool_test.go index 62dbe1664..f54d520c1 100644 --- a/libs/workerpool/worker_pool_test.go +++ b/libs/workerpool/worker_pool_test.go @@ -44,7 +44,6 @@ func TestWorkerPool_Basic(t *testing.T) { }, } for i, tc := range testCases { - tc := tc t.Run(fmt.Sprintf("%d", i), func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -103,7 +102,7 @@ func TestWorkerPool_Send(t *testing.T) { }{ { wantErr: context.Canceled.Error(), - stopFn: func(ctx context.Context, cancel func(), _ *WorkerPool) { + stopFn: func(_ context.Context, cancel func(), _ *WorkerPool) { cancel() }, }, @@ -146,13 +145,13 @@ func TestWorkerPool_Receive(t *testing.T) { wantErr string }{ { - stopFn: func(ctx context.Context, cancel func(), wp *WorkerPool) { + stopFn: func(_ context.Context, cancel func(), _ *WorkerPool) { cancel() }, wantErr: context.Canceled.Error(), }, { - stopFn: func(ctx context.Context, cancel func(), wp *WorkerPool) { + stopFn: func(ctx context.Context, _ func(), wp *WorkerPool) { wp.Stop(ctx) }, wantErr: ErrWorkerPoolStopped.Error(), @@ -253,7 +252,7 @@ func consumeResult(ctx context.Context, wp *WorkerPool, num int) ([]Result, erro func generateJobs(n int) []*Job { jobs := make([]*Job, n) for i := 0; i < n; i++ { - jobs[i] = NewJob(func(ctx context.Context) Result { + jobs[i] = NewJob(func(_ context.Context) Result { return Result{Value: n} }) } diff --git a/privval/grpc/server_test.go b/privval/grpc/server_test.go index 219134e15..f44b1716c 100644 --- a/privval/grpc/server_test.go +++ b/privval/grpc/server_test.go @@ -120,7 +120,6 @@ func TestSignVote(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -198,7 +197,6 @@ func TestSignProposal(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/rpc/client/rpc_test.go b/rpc/client/rpc_test.go index 7544c9f84..99a34f7f3 100644 --- a/rpc/client/rpc_test.go +++ b/rpc/client/rpc_test.go @@ -873,7 +873,6 @@ func TestClientMethodCallsAdvanced(t *testing.T) { ) for page := 1; page <= pages; page++ { - page := page result, err := c.TxSearch(ctx, "tx.height >= 1", false, &page, &perPage, "asc") require.NoError(t, err) if page < pages { diff --git a/rpc/jsonrpc/client/http_json_client_test.go b/rpc/jsonrpc/client/http_json_client_test.go index 7f0c20704..f9815f371 100644 --- a/rpc/jsonrpc/client/http_json_client_test.go +++ b/rpc/jsonrpc/client/http_json_client_test.go @@ -78,7 +78,6 @@ func Test_parsedURL(t *testing.T) { } for name, tt := range tests { - tt := tt // suppressing linter t.Run(name, func(t *testing.T) { parsed, err := newParsedURL(tt.url) require.NoError(t, err) diff --git a/scripts/keymigrate/migrate.go b/scripts/keymigrate/migrate.go index b5b56e839..82af5fc8e 100644 --- a/scripts/keymigrate/migrate.go +++ b/scripts/keymigrate/migrate.go @@ -639,7 +639,6 @@ func Migrate(ctx context.Context, storeName string, db dbm.DB) error { }).Limit(runtime.NumCPU()) for _, key := range keys { - key := key start(func() error { if err := ctx.Err(); err != nil { return err diff --git a/scripts/metricsgen/metricsgen.go b/scripts/metricsgen/metricsgen.go index 0f564e66a..2a55d727b 100644 --- a/scripts/metricsgen/metricsgen.go +++ b/scripts/metricsgen/metricsgen.go @@ -167,7 +167,7 @@ func ParseMetricsDir(dir string, structName string) (TemplateData, error) { // Grab the package name. var pkgName string - var pkg *ast.Package + var pkg *ast.Package //nolint:staticcheck for pkgName, pkg = range d { } td := TemplateData{ diff --git a/test/e2e/generator/generate.go b/test/e2e/generator/generate.go index 2fbc995cd..568627d06 100644 --- a/test/e2e/generator/generate.go +++ b/test/e2e/generator/generate.go @@ -7,6 +7,7 @@ import ( "strings" "time" + tmmath "github.com/dashpay/tenderdash/libs/math" e2e "github.com/dashpay/tenderdash/test/e2e/pkg" "github.com/dashpay/tenderdash/types" ) @@ -129,8 +130,8 @@ func generateTestnet(r *rand.Rand, opt map[string]interface{}) (e2e.Manifest, er TxSize: opt["txSize"].(int), // Tenderdash specific settings - GenesisCoreChainLockedHeight: uint32(opt["initialCoreChainLockedHeight"].(int)), - InitAppCoreChainLockedHeight: uint32(opt["initAppCoreChainLockedHeight"].(int)), + GenesisCoreChainLockedHeight: tmmath.MustConvertUint32(opt["initialCoreChainLockedHeight"].(int)), + InitAppCoreChainLockedHeight: tmmath.MustConvertUint32(opt["initAppCoreChainLockedHeight"].(int)), ChainLockUpdates: map[string]int64{}, } @@ -316,9 +317,9 @@ func generateNode( Database: nodeDatabases.Choose(r), PrivvalProtocol: nodePrivvalProtocols.Choose(r), StateSync: e2e.StateSyncDisabled, - PersistInterval: ptrUint64(uint64(nodePersistIntervals.Choose(r).(int))), - SnapshotInterval: uint64(nodeSnapshotIntervals.Choose(r).(int)), - RetainBlocks: uint64(nodeRetainBlocks.Choose(r).(int)), + PersistInterval: ptrUint64(tmmath.MustConvertUint64(nodePersistIntervals.Choose(r).(int))), + SnapshotInterval: tmmath.MustConvertUint64(nodeSnapshotIntervals.Choose(r).(int)), + RetainBlocks: tmmath.MustConvertUint64(nodeRetainBlocks.Choose(r).(int)), Perturb: nodePerturbations.Choose(r), } diff --git a/test/e2e/generator/main.go b/test/e2e/generator/main.go index ab1f7491a..90e7f29f7 100644 --- a/test/e2e/generator/main.go +++ b/test/e2e/generator/main.go @@ -52,7 +52,7 @@ func NewCLI() (*CLI, error) { Short: "End-to-end testnet generator", SilenceUsage: true, SilenceErrors: true, // we'll output them ourselves in Run() - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { configPreset, err := cmd.Flags().GetString("preset") if err != nil { return err diff --git a/test/e2e/runner/main.go b/test/e2e/runner/main.go index c63abf53a..39dd57334 100644 --- a/test/e2e/runner/main.go +++ b/test/e2e/runner/main.go @@ -47,7 +47,7 @@ func NewCLI(logger log.Logger) *CLI { Short: "End-to-end test runner", SilenceUsage: true, SilenceErrors: true, // we'll output them ourselves in Run() - PersistentPreRunE: func(cmd *cobra.Command, args []string) error { + PersistentPreRunE: func(cmd *cobra.Command, _ []string) error { file, err := cmd.Flags().GetString("file") if err != nil { return err @@ -71,7 +71,7 @@ func NewCLI(logger log.Logger) *CLI { cli.testnet = testnet return nil }, - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { if err = Cleanup(cmd.Context(), logger, cli.testnet.Dir, cli.infra); err != nil { return err } @@ -171,7 +171,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "setup", Short: "Generates the testnet directory and configuration", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return Setup(cmd.Context(), logger, cli.testnet, cli.infra) }, }) @@ -179,7 +179,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "start", Short: "Starts the Docker testnet, waiting for nodes to become available", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { _, err := os.Stat(cli.testnet.Dir) if os.IsNotExist(err) { err = Setup(cmd.Context(), logger, cli.testnet, cli.infra) @@ -194,7 +194,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "perturb", Short: "Perturbs the Docker testnet, e.g. by restarting or disconnecting nodes", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return Perturb(cmd.Context(), logger, cli.testnet, cli.infra) }, }) @@ -202,7 +202,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "wait", Short: "Waits for a few blocks to be produced and all nodes to catch up", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return Wait(cmd.Context(), logger, cli.testnet, 5) }, }) @@ -210,7 +210,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "stop", Short: "Stops the Docker testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { logger.Info("Stopping testnet") return cli.infra.Stop(cmd.Context()) }, @@ -219,7 +219,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "pause", Short: "Pauses the Docker testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { logger.Info("Pausing testnet") return cli.infra.Pause(cmd.Context()) }, @@ -228,7 +228,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "resume", Short: "Resumes the Docker testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { logger.Info("Resuming testnet") return cli.infra.Unpause(cmd.Context()) }, @@ -237,7 +237,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "load", Short: "Generates transaction load until the command is canceled", - RunE: func(cmd *cobra.Command, args []string) (err error) { + RunE: func(cmd *cobra.Command, _ []string) (err error) { return Load( cmd.Context(), logger, @@ -274,7 +274,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "test", Short: "Runs test cases against a running testnet", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return Test(cmd.Context(), cli.testnet) }, }) @@ -282,7 +282,7 @@ func NewCLI(logger log.Logger) *CLI { cli.root.AddCommand(&cobra.Command{ Use: "cleanup", Short: "Removes the testnet directory", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return Cleanup(cmd.Context(), logger, cli.testnet.Dir, cli.infra) }, }) @@ -332,7 +332,7 @@ over a 100 block sampling period. Does not run any perbutations. `, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { if err := Cleanup(cmd.Context(), logger, cli.testnet.Dir, cli.infra); err != nil { return err } diff --git a/types/node_info_test.go b/types/node_info_test.go index d16b1e985..3f3c02886 100644 --- a/types/node_info_test.go +++ b/types/node_info_test.go @@ -249,7 +249,6 @@ func TestParseAddressString(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.name, func(t *testing.T) { na, err := ParseAddressString(tc.addr) if tc.correct { diff --git a/types/part_set_test.go b/types/part_set_test.go index 04b342087..4998d08b9 100644 --- a/types/part_set_test.go +++ b/types/part_set_test.go @@ -110,7 +110,6 @@ func TestPartSetHeaderValidateBasic(t *testing.T) { {"Invalid Hash", func(psHeader *PartSetHeader) { psHeader.Hash = make([]byte, 1) }, true}, } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { data := tmrand.Bytes(testPartSize * 100) ps := NewPartSetFromData(data, testPartSize) @@ -143,7 +142,6 @@ func TestPartValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { data := tmrand.Bytes(testPartSize * 100) ps := NewPartSetFromData(data, testPartSize) diff --git a/types/proposal_test.go b/types/proposal_test.go index 49ea38cff..38a50dcf8 100644 --- a/types/proposal_test.go +++ b/types/proposal_test.go @@ -197,7 +197,6 @@ func TestProposalValidateBasic(t *testing.T) { ) for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() diff --git a/types/validation_test.go b/types/validation_test.go index f518d1f7e..2ea855d3a 100644 --- a/types/validation_test.go +++ b/types/validation_test.go @@ -114,7 +114,6 @@ func TestValidatorSet_VerifyCommit_All(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.description, func(t *testing.T) { err := vset.VerifyCommit(tc.chainID, tc.blockID, tc.height, tc.commit) if tc.expErr { diff --git a/types/validator_set_test.go b/types/validator_set_test.go index c423ff771..a8c637e88 100644 --- a/types/validator_set_test.go +++ b/types/validator_set_test.go @@ -202,7 +202,6 @@ func TestValidatorSetValidateBasic(t *testing.T) { } for _, tc := range testCases { - tc := tc t.Run(tc.testName, func(t *testing.T) { err := tc.vals.ValidateBasic() if tc.err { @@ -851,7 +850,6 @@ func BenchmarkValidatorSet_VerifyCommit_Ed25519(b *testing.B) { defer cancel() for _, n := range []int{1, 8, 64, 1024} { - n := n var ( chainID = "test_chain_id" h = int64(3) diff --git a/types/vote_test.go b/types/vote_test.go index 044024b0d..b51175d15 100644 --- a/types/vote_test.go +++ b/types/vote_test.go @@ -429,7 +429,6 @@ func TestIsVoteTypeValid(t *testing.T) { } for _, tt := range tc { - tt := tt t.Run(tt.name, func(_st *testing.T) { if rs := IsVoteTypeValid(tt.in); rs != tt.out { t.Errorf("got unexpected Vote type. Expected:\n%v\nGot:\n%v", rs, tt.out) From 0ce78fd140738326c9c85aedff27fccdb90a6032 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Sat, 12 Oct 2024 01:31:53 +0200 Subject: [PATCH 11/27] chore: linter, wip --- cmd/abcidump/cmd/capture.go | 2 +- cmd/abcidump/cmd/cbor.go | 2 +- cmd/abcidump/cmd/parse.go | 2 +- cmd/abcidump/cmd/rootcmd.go | 2 +- libs/cli/setup_test.go | 8 ++++---- libs/store/store_test.go | 2 +- types/part_set_test.go | 2 +- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmd/abcidump/cmd/capture.go b/cmd/abcidump/cmd/capture.go index af76ebdd8..ca6e89e86 100644 --- a/cmd/abcidump/cmd/capture.go +++ b/cmd/abcidump/cmd/capture.go @@ -47,7 +47,7 @@ func (captureCmd *CaptureCmd) Command() *cobra.Command { Short: "capture TCP traffic, parse as ABCI protocol and display it in JSON format", RunE: captureCmd.RunE, - PostRun: func(cmd *cobra.Command, args []string) { + PostRun: func(_ *cobra.Command, _ []string) { if captureCmd.Input != nil { if closer, ok := captureCmd.Input.(io.Closer); ok { closer.Close() diff --git a/cmd/abcidump/cmd/cbor.go b/cmd/abcidump/cmd/cbor.go index 827260871..94aaaf860 100644 --- a/cmd/abcidump/cmd/cbor.go +++ b/cmd/abcidump/cmd/cbor.go @@ -35,7 +35,7 @@ func (cborCmd *CborCmd) Command() *cobra.Command { Short: "Decode a CBOR-encoded message", PreRunE: cborCmd.PreRunE, RunE: cborCmd.RunE, - PostRun: func(cmd *cobra.Command, args []string) { + PostRun: func(_ *cobra.Command, _ []string) { if cborCmd.Input != nil { if closer, ok := cborCmd.Input.(io.Closer); ok { closer.Close() diff --git a/cmd/abcidump/cmd/parse.go b/cmd/abcidump/cmd/parse.go index b0c750f2b..ff05decca 100644 --- a/cmd/abcidump/cmd/parse.go +++ b/cmd/abcidump/cmd/parse.go @@ -50,7 +50,7 @@ func (parseCmd *ParseCmd) Command() *cobra.Command { PreRunE: parseCmd.PreRunE, RunE: parseCmd.RunE, - PostRun: func(cmd *cobra.Command, args []string) { + PostRun: func(_ *cobra.Command, _ []string) { if parseCmd.Input != nil { if closer, ok := parseCmd.Input.(io.Closer); ok { closer.Close() diff --git a/cmd/abcidump/cmd/rootcmd.go b/cmd/abcidump/cmd/rootcmd.go index 872400a0c..f5d367989 100644 --- a/cmd/abcidump/cmd/rootcmd.go +++ b/cmd/abcidump/cmd/rootcmd.go @@ -19,7 +19,7 @@ func MakeRootCmd() *cobra.Command { cmd := &cobra.Command{ Use: "abcidump", Short: "Parse dump of protobuf communication between two nodes", - PersistentPreRunE: func(cmd *cobra.Command, args []string) (err error) { + PersistentPreRunE: func(_ *cobra.Command, _ []string) (err error) { logger, err = log.NewDefaultLogger(log.LogFormatPlain, logLevel) if err != nil { return fmt.Errorf("cannot initialize logging: %w", err) diff --git a/libs/cli/setup_test.go b/libs/cli/setup_test.go index 9198485ef..4a337fb16 100644 --- a/libs/cli/setup_test.go +++ b/libs/cli/setup_test.go @@ -44,7 +44,7 @@ func TestSetupEnv(t *testing.T) { var foo string demo := &cobra.Command{ Use: "demo", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { foo = viper.GetString("foobar") return nil }, @@ -108,7 +108,7 @@ func TestSetupConfig(t *testing.T) { var foo, two string boo := &cobra.Command{ Use: "reader", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { foo = viper.GetString("boo") two = viper.GetString("two-words") return nil @@ -189,7 +189,7 @@ func TestSetupUnmarshal(t *testing.T) { cfg := base marsh := &cobra.Command{ Use: "marsh", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return viper.Unmarshal(&cfg) }, } @@ -228,7 +228,7 @@ func TestSetupTrace(t *testing.T) { // test command that store value of foobar in local variable trace := &cobra.Command{ Use: "trace", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return fmt.Errorf("trace flag = %t", viper.GetBool(TraceFlag)) }, } diff --git a/libs/store/store_test.go b/libs/store/store_test.go index 47db3cbf6..a36aba80e 100644 --- a/libs/store/store_test.go +++ b/libs/store/store_test.go @@ -50,7 +50,7 @@ func TestInMemStore(t *testing.T) { } // Update test { - updateFun := func(key string, it *int) { + updateFun := func(_ string, it *int) { *it++ } store.Update(pairs[2].key, updateFun) diff --git a/types/part_set_test.go b/types/part_set_test.go index 4998d08b9..fc0b1eb73 100644 --- a/types/part_set_test.go +++ b/types/part_set_test.go @@ -106,7 +106,7 @@ func TestPartSetHeaderValidateBasic(t *testing.T) { malleatePartSetHeader func(*PartSetHeader) expectErr bool }{ - {"Good PartSet", func(psHeader *PartSetHeader) {}, false}, + {"Good PartSet", func(_ *PartSetHeader) {}, false}, {"Invalid Hash", func(psHeader *PartSetHeader) { psHeader.Hash = make([]byte, 1) }, true}, } for _, tc := range testCases { From 821a3ea50e971c5bf94e8006cc30d616d751e9fa Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Sat, 12 Oct 2024 01:46:16 +0200 Subject: [PATCH 12/27] chore: linter, wip --- cmd/tenderdash/commands/gen_validator.go | 2 +- cmd/tenderdash/commands/inspect.go | 2 +- cmd/tenderdash/commands/key_migrate.go | 2 +- cmd/tenderdash/commands/reindex_event.go | 4 ++-- cmd/tenderdash/commands/reindex_event_test.go | 2 +- cmd/tenderdash/commands/reset.go | 8 ++++---- cmd/tenderdash/commands/rollback.go | 2 +- cmd/tenderdash/commands/root_test.go | 2 +- cmd/tenderdash/commands/show_node_id.go | 2 +- cmd/tenderdash/commands/show_validator.go | 2 +- cmd/tenderdash/commands/testnet.go | 2 +- cmd/tenderdash/commands/version.go | 2 +- internal/blocksync/peer_store.go | 12 ++++++------ internal/libs/async/async_test.go | 6 +++--- internal/p2p/router_filter_test.go | 2 +- internal/p2p/transport_test.go | 6 +++--- internal/store/store.go | 2 +- test/e2e/pkg/utils.go | 8 ++++---- 18 files changed, 34 insertions(+), 34 deletions(-) diff --git a/cmd/tenderdash/commands/gen_validator.go b/cmd/tenderdash/commands/gen_validator.go index 23214e38b..ac5191049 100644 --- a/cmd/tenderdash/commands/gen_validator.go +++ b/cmd/tenderdash/commands/gen_validator.go @@ -15,7 +15,7 @@ func MakeGenValidatorCommand() *cobra.Command { cmd := &cobra.Command{ Use: "gen-validator", Short: "Generate new validator keypair", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { pv := privval.GenFilePV("", "") jsbz, err := json.Marshal(pv) diff --git a/cmd/tenderdash/commands/inspect.go b/cmd/tenderdash/commands/inspect.go index 84bbb1e18..51ac1ff5e 100644 --- a/cmd/tenderdash/commands/inspect.go +++ b/cmd/tenderdash/commands/inspect.go @@ -25,7 +25,7 @@ func MakeInspectCommand(conf *config.Config, logger log.Logger) *cobra.Command { The inspect command can be used to query the block and state store using Tendermint RPC calls to debug issues of inconsistent state. `, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { ctx, cancel := signal.NotifyContext(cmd.Context(), syscall.SIGTERM, syscall.SIGINT) defer cancel() diff --git a/cmd/tenderdash/commands/key_migrate.go b/cmd/tenderdash/commands/key_migrate.go index cf20d76a0..c57f0d27e 100644 --- a/cmd/tenderdash/commands/key_migrate.go +++ b/cmd/tenderdash/commands/key_migrate.go @@ -16,7 +16,7 @@ func MakeKeyMigrateCommand(conf *config.Config, logger log.Logger) *cobra.Comman cmd := &cobra.Command{ Use: "key-migrate", Short: "Run Database key migration", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { return RunDatabaseMigration(cmd.Context(), logger, conf) }, } diff --git a/cmd/tenderdash/commands/reindex_event.go b/cmd/tenderdash/commands/reindex_event.go index 43250430b..55de22105 100644 --- a/cmd/tenderdash/commands/reindex_event.go +++ b/cmd/tenderdash/commands/reindex_event.go @@ -51,7 +51,7 @@ either or both arguments. tendermint reindex-event --end-height 10 tendermint reindex-event --start-height 2 --end-height 10 `, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { bs, ss, err := loadStateAndBlockStore(conf) if err != nil { return fmt.Errorf("%s: %w", reindexFailed, err) @@ -210,7 +210,7 @@ func eventReIndex(cmd *cobra.Command, args eventReIndexArgs) error { for i := range b.Data.Txs { tr := abcitypes.TxResult{ Height: b.Height, - Index: uint32(i), + Index: uint32(i), //#nosec:G115 Tx: b.Data.Txs[i], Result: *(r.ProcessProposal.TxResults[i]), } diff --git a/cmd/tenderdash/commands/reindex_event_test.go b/cmd/tenderdash/commands/reindex_event_test.go index 37f58d952..672c849ec 100644 --- a/cmd/tenderdash/commands/reindex_event_test.go +++ b/cmd/tenderdash/commands/reindex_event_test.go @@ -31,7 +31,7 @@ func setupReIndexEventCmd(ctx context.Context, conf *config.Config, logger log.L reIndexEventCmd := &cobra.Command{ Use: cmd.Use, - Run: func(cmd *cobra.Command, args []string) {}, + Run: func(_ *cobra.Command, _ []string) {}, } _ = reIndexEventCmd.ExecuteContext(ctx) diff --git a/cmd/tenderdash/commands/reset.go b/cmd/tenderdash/commands/reset.go index 30822ddcd..b37484671 100644 --- a/cmd/tenderdash/commands/reset.go +++ b/cmd/tenderdash/commands/reset.go @@ -26,7 +26,7 @@ func MakeResetCommand(conf *config.Config, logger log.Logger) *cobra.Command { resetBlocksCmd := &cobra.Command{ Use: "blockchain", Short: "Removes all blocks, state, transactions and evidence stored by the tendermint node", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return ResetState(conf.DBDir(), logger) }, } @@ -34,7 +34,7 @@ func MakeResetCommand(conf *config.Config, logger log.Logger) *cobra.Command { resetPeersCmd := &cobra.Command{ Use: "peers", Short: "Removes all peer addresses", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return ResetPeerStore(conf.DBDir()) }, } @@ -44,7 +44,7 @@ func MakeResetCommand(conf *config.Config, logger log.Logger) *cobra.Command { Short: "esets private validator signer state", Long: `Resets private validator signer state. Only use in testing. This can cause the node to double sign`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return ResetFilePV(conf.PrivValidator.KeyFile(), conf.PrivValidator.StateFile(), logger, keyType) }, } @@ -54,7 +54,7 @@ Only use in testing. This can cause the node to double sign`, Short: "Removes all tendermint data including signing state", Long: `Removes all tendermint data including signing state. Only use in testing. This can cause the node to double sign`, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { return ResetAll(conf.DBDir(), conf.PrivValidator.KeyFile(), conf.PrivValidator.StateFile(), logger, keyType) }, diff --git a/cmd/tenderdash/commands/rollback.go b/cmd/tenderdash/commands/rollback.go index 1dd88ccb6..8c2f09642 100644 --- a/cmd/tenderdash/commands/rollback.go +++ b/cmd/tenderdash/commands/rollback.go @@ -21,7 +21,7 @@ The application should also roll back to height n - 1. No blocks are removed, so restarting Tendermint the transactions in block n will be re-executed against the application. `, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { height, hash, err := RollbackState(conf) if err != nil { return fmt.Errorf("failed to rollback state: %w", err) diff --git a/cmd/tenderdash/commands/root_test.go b/cmd/tenderdash/commands/root_test.go index f3719220c..871931387 100644 --- a/cmd/tenderdash/commands/root_test.go +++ b/cmd/tenderdash/commands/root_test.go @@ -46,7 +46,7 @@ func clearConfig(t *testing.T, dir string) *cfg.Config { func testRootCmd(conf *cfg.Config) *cobra.Command { logger := log.NewNopLogger() cmd := RootCommand(conf, logger) - cmd.RunE = func(cmd *cobra.Command, args []string) error { return nil } + cmd.RunE = func(_ *cobra.Command, _ []string) error { return nil } var l string cmd.PersistentFlags().String("log", l, "Log") diff --git a/cmd/tenderdash/commands/show_node_id.go b/cmd/tenderdash/commands/show_node_id.go index d9e381d1b..0517994fd 100644 --- a/cmd/tenderdash/commands/show_node_id.go +++ b/cmd/tenderdash/commands/show_node_id.go @@ -13,7 +13,7 @@ func MakeShowNodeIDCommand(conf *config.Config) *cobra.Command { return &cobra.Command{ Use: "show-node-id", Short: "Show this node's ID", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(_ *cobra.Command, _ []string) error { nodeKeyID, err := conf.LoadNodeKeyID() if err != nil { return err diff --git a/cmd/tenderdash/commands/show_validator.go b/cmd/tenderdash/commands/show_validator.go index 67a2be4cb..7e86f11de 100644 --- a/cmd/tenderdash/commands/show_validator.go +++ b/cmd/tenderdash/commands/show_validator.go @@ -21,7 +21,7 @@ func MakeShowValidatorCommand(conf *config.Config, logger log.Logger) *cobra.Com return &cobra.Command{ Use: "show-validator", Short: "Show this node's validator info", - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { var ( pubKey crypto.PubKey err error diff --git a/cmd/tenderdash/commands/testnet.go b/cmd/tenderdash/commands/testnet.go index 3906f740d..e88002d8e 100644 --- a/cmd/tenderdash/commands/testnet.go +++ b/cmd/tenderdash/commands/testnet.go @@ -96,7 +96,7 @@ Example: cmd.Flags().StringVar(&keyType, "key", types.ABCIPubKeyTypeEd25519, "Key type to generate privval file with. Options: ed25519, secp256k1") - cmd.RunE = func(cmd *cobra.Command, args []string) error { + cmd.RunE = func(cmd *cobra.Command, _ []string) error { if len(hostnames) > 0 && len(hostnames) != (nValidators+nNonValidators) { return fmt.Errorf( "testnet needs precisely %d hostnames (number of validators plus non-validators) if --hostname parameter is used", diff --git a/cmd/tenderdash/commands/version.go b/cmd/tenderdash/commands/version.go index e53c330b6..ecb5b9242 100644 --- a/cmd/tenderdash/commands/version.go +++ b/cmd/tenderdash/commands/version.go @@ -15,7 +15,7 @@ var VersionCmd *cobra.Command = func() *cobra.Command { Use: "version", Short: "Show version info", - Run: func(cmd *cobra.Command, args []string) { + Run: func(cmd *cobra.Command, _ []string) { cmd.Println(version.TMCoreSemVer) if verbose { cmd.Println("Go version: " + runtime.Version()) diff --git a/internal/blocksync/peer_store.go b/internal/blocksync/peer_store.go index 2ec26cbb1..76be3954b 100644 --- a/internal/blocksync/peer_store.go +++ b/internal/blocksync/peer_store.go @@ -156,7 +156,7 @@ func (p *InMemPeerStore) updateMaxHeight() { // TODO with fixed worker pool size this condition is not needed anymore func peerNumPendingCond(val int32, op string) store.QueryFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer PeerData) bool { + return func(_ types.NodeID, peer PeerData) bool { switch op { case "<": return peer.numPending < val @@ -168,20 +168,20 @@ func peerNumPendingCond(val int32, op string) store.QueryFunc[types.NodeID, Peer } func heightBetweenPeerHeightRange(height int64) store.QueryFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer PeerData) bool { + return func(_ types.NodeID, peer PeerData) bool { return height >= peer.base && height <= peer.height } } func transferRateNotZeroAndLessMinRate(minRate int64) store.QueryFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer PeerData) bool { + return func(_ types.NodeID, peer PeerData) bool { curRate := peer.recvMonitor.CurrentTransferRate() return curRate != 0 && curRate < minRate } } func ignoreTimedOutPeers(minRate int64) store.QueryFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer PeerData) bool { + return func(_ types.NodeID, peer PeerData) bool { curRate := peer.recvMonitor.CurrentTransferRate() if curRate == 0 { return true @@ -216,7 +216,7 @@ func AddNumPending(val int32) store.UpdateFunc[types.NodeID, PeerData] { // UpdateMonitor adds a block size value to the peer monitor if numPending is greater than zero func UpdateMonitor(recvSize int) store.UpdateFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer *PeerData) { + return func(_ types.NodeID, peer *PeerData) { if peer.numPending > 0 { peer.recvMonitor.Update(recvSize) } @@ -225,7 +225,7 @@ func UpdateMonitor(recvSize int) store.UpdateFunc[types.NodeID, PeerData] { // ResetMonitor replaces a peer monitor on a new one if numPending is zero func ResetMonitor() store.UpdateFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer *PeerData) { + return func(_ types.NodeID, peer *PeerData) { if peer.numPending == 0 { peer.recvMonitor = newPeerMonitor(peer.startAt) } diff --git a/internal/libs/async/async_test.go b/internal/libs/async/async_test.go index 4faead444..62cb62e55 100644 --- a/internal/libs/async/async_test.go +++ b/internal/libs/async/async_test.go @@ -107,13 +107,13 @@ func TestParallelRecover(t *testing.T) { // Create tasks. var tasks = []Task{ - func(i int) (res interface{}, abort bool, err error) { + func(_ int) (res interface{}, abort bool, err error) { return 0, false, nil }, - func(i int) (res interface{}, abort bool, err error) { + func(_ int) (res interface{}, abort bool, err error) { return 1, false, errors.New("some error") }, - func(i int) (res interface{}, abort bool, err error) { + func(_ int) (res interface{}, abort bool, err error) { panic(2) }, } diff --git a/internal/p2p/router_filter_test.go b/internal/p2p/router_filter_test.go index f3b51fafa..cd51a6201 100644 --- a/internal/p2p/router_filter_test.go +++ b/internal/p2p/router_filter_test.go @@ -22,7 +22,7 @@ func TestConnectionFiltering(t *testing.T) { logger: logger, connTracker: newConnTracker(1, time.Second), options: RouterOptions{ - FilterPeerByIP: func(_ context.Context, _ net.IP, port uint16) error { + FilterPeerByIP: func(_ context.Context, _ net.IP, _ uint16) error { filterByIPCount++ return errors.New("mock") }, diff --git a/internal/p2p/transport_test.go b/internal/p2p/transport_test.go index b032d6069..7670cca9f 100644 --- a/internal/p2p/transport_test.go +++ b/internal/p2p/transport_test.go @@ -206,7 +206,7 @@ func TestTransport_Endpoints(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - withTransports(ctx, t, func(ctx context.Context, t *testing.T, makeTransport transportFactory) { + withTransports(ctx, t, func(_ context.Context, t *testing.T, makeTransport transportFactory) { a := makeTransport(t) b := makeTransport(t) @@ -238,7 +238,7 @@ func TestTransport_Protocols(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - withTransports(ctx, t, func(ctx context.Context, t *testing.T, makeTransport transportFactory) { + withTransports(ctx, t, func(_ context.Context, t *testing.T, makeTransport transportFactory) { a := makeTransport(t) protocols := a.Protocols() endpoint, err := a.Endpoint() @@ -254,7 +254,7 @@ func TestTransport_String(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - withTransports(ctx, t, func(ctx context.Context, t *testing.T, makeTransport transportFactory) { + withTransports(ctx, t, func(_ context.Context, t *testing.T, makeTransport transportFactory) { a := makeTransport(t) require.NotEmpty(t, a.String()) }) diff --git a/internal/store/store.go b/internal/store/store.go index 02faa0e51..f70e4ba02 100644 --- a/internal/store/store.go +++ b/internal/store/store.go @@ -319,7 +319,7 @@ func (bs *BlockStore) PruneBlocks(height int64) (uint64, error) { } // when removing the block meta, use the hash to remove the hash key at the same time - removeBlockHash := func(key, value []byte, batch dbm.Batch) error { + removeBlockHash := func(_, value []byte, batch dbm.Batch) error { // unmarshal block meta var pbbm = new(tmproto.BlockMeta) err := proto.Unmarshal(value, pbbm) diff --git a/test/e2e/pkg/utils.go b/test/e2e/pkg/utils.go index 5f58a1d0b..857adcf99 100644 --- a/test/e2e/pkg/utils.go +++ b/test/e2e/pkg/utils.go @@ -76,7 +76,7 @@ func initValidator(iter *llmq.Iter, quorumHash crypto.QuorumHash, handlers ...in } func updateProTxHash() initValidatorFunc { - return func(node *Node, proTxHash crypto.ProTxHash, qks crypto.QuorumKeys) error { + return func(node *Node, proTxHash crypto.ProTxHash, _ crypto.QuorumKeys) error { node.ProTxHash = proTxHash fmt.Printf("Setting validator %s proTxHash to %s\n", node.Name, node.ProTxHash.ShortString()) return nil @@ -84,7 +84,7 @@ func updateProTxHash() initValidatorFunc { } func updateGenesisValidators(testnet *Testnet) initValidatorFunc { - return func(node *Node, proTxHash crypto.ProTxHash, qks crypto.QuorumKeys) error { + return func(node *Node, _ crypto.ProTxHash, qks crypto.QuorumKeys) error { vu, err := node.validatorUpdate(qks.PubKey) if err != nil { return err @@ -105,7 +105,7 @@ func updatePrivvalUpdateHeights(height int, quorumHash crypto.QuorumHash) initNo } func updateValidatorUpdate(valUpdate ValidatorsMap) initValidatorFunc { - return func(node *Node, proTxHash crypto.ProTxHash, qks crypto.QuorumKeys) error { + return func(node *Node, _ crypto.ProTxHash, qks crypto.QuorumKeys) error { vu, err := node.validatorUpdate(qks.PubKey) if err != nil { return err @@ -129,7 +129,7 @@ func initAnyNode(thresholdPublicKey crypto.PubKey, quorumHash crypto.QuorumHash) } func printInitValidatorInfo(height int) initValidatorFunc { - return func(node *Node, proTxHash crypto.ProTxHash, qks crypto.QuorumKeys) error { + return func(node *Node, _ crypto.ProTxHash, qks crypto.QuorumKeys) error { if height == 0 { fmt.Printf("Set validator %s/%X (at genesis) pubkey to %X\n", node.Name, node.ProTxHash, qks.PubKey.Bytes()) From a642c5b0af721b1de56056cc84f511727c110d31 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Oct 2024 10:16:10 +0200 Subject: [PATCH 13/27] chore: apply lint suggestions --- crypto/merkle/proof_test.go | 2 +- internal/blocksync/peer_store.go | 2 +- internal/blocksync/reactor_test.go | 4 ++-- internal/blocksync/synchronizer_test.go | 12 ++++++------ internal/libs/clist/clist_test.go | 4 ++-- libs/store/store_test.go | 2 +- rpc/jsonrpc/client/http_json_client.go | 2 +- rpc/jsonrpc/client/http_json_client_test.go | 2 +- rpc/test/helpers.go | 2 +- scripts/keymigrate/migrate.go | 8 +++++--- test/fuzz/tests/mempool_test.go | 2 +- test/fuzz/tests/p2p_secretconnection_test.go | 2 +- test/fuzz/tests/rpc_jsonrpc_server_test.go | 2 +- types/part_set_test.go | 2 +- 14 files changed, 25 insertions(+), 23 deletions(-) diff --git a/crypto/merkle/proof_test.go b/crypto/merkle/proof_test.go index d182f34b7..759034dc8 100644 --- a/crypto/merkle/proof_test.go +++ b/crypto/merkle/proof_test.go @@ -146,7 +146,7 @@ func TestProofValidateBasic(t *testing.T) { malleateProof func(*Proof) errStr string }{ - {"Good", func(sp *Proof) {}, ""}, + {"Good", func(_ *Proof) {}, ""}, {"Negative Total", func(sp *Proof) { sp.Total = -1 }, "negative Total"}, {"Negative Index", func(sp *Proof) { sp.Index = -1 }, "negative Index"}, {"Invalid LeafHash", func(sp *Proof) { sp.LeafHash = make([]byte, 10) }, diff --git a/internal/blocksync/peer_store.go b/internal/blocksync/peer_store.go index 76be3954b..4a54443c0 100644 --- a/internal/blocksync/peer_store.go +++ b/internal/blocksync/peer_store.go @@ -209,7 +209,7 @@ func newPeerMonitor(at time.Time) *flowrate.Monitor { // AddNumPending adds a value to the numPending field func AddNumPending(val int32) store.UpdateFunc[types.NodeID, PeerData] { - return func(peerID types.NodeID, peer *PeerData) { + return func(_ types.NodeID, peer *PeerData) { peer.numPending += val } } diff --git a/internal/blocksync/reactor_test.go b/internal/blocksync/reactor_test.go index 21aa67df4..197f2993b 100644 --- a/internal/blocksync/reactor_test.go +++ b/internal/blocksync/reactor_test.go @@ -181,12 +181,12 @@ func (rts *reactorTestSuite) addNode( rts.peerUpdates[nodeID] = p2p.NewPeerUpdates(rts.peerChans[nodeID], 1, "blocksync") rts.network.Nodes[nodeID].PeerManager.Register(ctx, rts.peerUpdates[nodeID]) - chCreator := func(ctx context.Context, chdesc *p2p.ChannelDescriptor) (p2p.Channel, error) { + chCreator := func(_ context.Context, _ *p2p.ChannelDescriptor) (p2p.Channel, error) { return rts.blockSyncChannels[nodeID], nil } proTxHash := rts.network.Nodes[nodeID].NodeInfo.ProTxHash - peerEvents := func(ctx context.Context, _ string) *p2p.PeerUpdates { return rts.peerUpdates[nodeID] } + peerEvents := func(_ context.Context, _ string) *p2p.PeerUpdates { return rts.peerUpdates[nodeID] } reactor := makeReactor(ctx, t, rts.config, proTxHash, nodeID, genDoc, privVal, chCreator, peerEvents) commit := types.NewCommit(0, 0, types.BlockID{}, nil, nil) diff --git a/internal/blocksync/synchronizer_test.go b/internal/blocksync/synchronizer_test.go index 8c9c544c1..5dff6e92e 100644 --- a/internal/blocksync/synchronizer_test.go +++ b/internal/blocksync/synchronizer_test.go @@ -75,14 +75,14 @@ func (suite *SynchronizerTestSuite) TestBasic() { suite.blockExec. On("ApplyBlock", mock.Anything, mock.Anything, mock.Anything, mock.Anything, mock.Anything). Maybe(). - Return(func(_ context.Context, state sm.State, _ types.BlockID, block *types.Block, _ *types.Commit) sm.State { + Return(func(_ context.Context, state sm.State, _ types.BlockID, _ *types.Block, _ *types.Commit) sm.State { return state }, nil) suite.client. On("GetBlock", mock.Anything, mock.Anything, mock.Anything). Maybe(). - Return(func(ctx context.Context, height int64, peerID types.NodeID) *promise.Promise[*blocksync.BlockResponse] { - return promise.New(func(resolve func(data *blocksync.BlockResponse), reject func(err error)) { + Return(func(_ context.Context, height int64, _ types.NodeID) *promise.Promise[*blocksync.BlockResponse] { + return promise.New(func(resolve func(data *blocksync.BlockResponse), _ func(err error)) { resolve(suite.responses[int(height-1)]) }) }, nil) @@ -179,7 +179,7 @@ func (suite *SynchronizerTestSuite) TestConsumeJobResult() { }{ { result: workerpool.Result{Value: respH1}, - mockFn: func(pool *Synchronizer) { + mockFn: func(_ *Synchronizer) { suite.store. On("SaveBlock", mock.Anything, mock.Anything, mock.Anything). Once(). @@ -197,7 +197,7 @@ func (suite *SynchronizerTestSuite) TestConsumeJobResult() { { result: workerpool.Result{Err: mockErr}, wantPushBack: []int64{1}, - mockFn: func(pool *Synchronizer) { + mockFn: func(_ *Synchronizer) { suite.client. On("Send", mock.Anything, p2p.PeerError{NodeID: "peer 1", Err: mockErr}). Once(). @@ -233,7 +233,7 @@ func (suite *SynchronizerTestSuite) TestConsumeJobResult() { }, { result: workerpool.Result{Value: respH2}, - mockFn: func(pool *Synchronizer) {}, + mockFn: func(_ *Synchronizer) {}, }, } for i, tc := range testCases { diff --git a/internal/libs/clist/clist_test.go b/internal/libs/clist/clist_test.go index a3fc4bfb9..b97044b23 100644 --- a/internal/libs/clist/clist_test.go +++ b/internal/libs/clist/clist_test.go @@ -83,7 +83,7 @@ func TestGCFifo(t *testing.T) { v := new(value) v.Int = i l.PushBack(v) - runtime.SetFinalizer(v, func(v *value) { + runtime.SetFinalizer(v, func(_ *value) { gcCh <- struct{}{} }) } @@ -144,7 +144,7 @@ func TestGCRandom(t *testing.T) { v := new(value) v.Int = i l.PushBack(v) - runtime.SetFinalizer(v, func(v *value) { + runtime.SetFinalizer(v, func(_ *value) { gcCh <- struct{}{} }) } diff --git a/libs/store/store_test.go b/libs/store/store_test.go index a36aba80e..fb7ba6771 100644 --- a/libs/store/store_test.go +++ b/libs/store/store_test.go @@ -27,7 +27,7 @@ func TestInMemStore(t *testing.T) { require.Equal(t, []int{1, 2, 3}, store.All()) // Query test { - vals := store.Query(func(key string, val int) bool { + vals := store.Query(func(_ string, val int) bool { return val > 1 }, 0) require.Equal(t, []int{2, 3}, vals) diff --git a/rpc/jsonrpc/client/http_json_client.go b/rpc/jsonrpc/client/http_json_client.go index d5d6ae8e3..e62b9aa0c 100644 --- a/rpc/jsonrpc/client/http_json_client.go +++ b/rpc/jsonrpc/client/http_json_client.go @@ -369,7 +369,7 @@ func dialParamsFromURL(pURL *parsedURL) (string, string) { } func makeHTTPDialer(protocol, addr string) func(context.Context, string, string) (net.Conn, error) { - return func(ctx context.Context, _, _ string) (net.Conn, error) { + return func(_ context.Context, _, _ string) (net.Conn, error) { return net.DialTimeout(protocol, addr, 10*time.Second) } } diff --git a/rpc/jsonrpc/client/http_json_client_test.go b/rpc/jsonrpc/client/http_json_client_test.go index f9815f371..091492c25 100644 --- a/rpc/jsonrpc/client/http_json_client_test.go +++ b/rpc/jsonrpc/client/http_json_client_test.go @@ -15,7 +15,7 @@ import ( func TestHTTPClientMakeHTTPDialer(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + handler := http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) { _, _ = w.Write([]byte("Hi!\n")) }) ts := httptest.NewServer(handler) diff --git a/rpc/test/helpers.go b/rpc/test/helpers.go index e2e64deab..1be66ceec 100644 --- a/rpc/test/helpers.go +++ b/rpc/test/helpers.go @@ -114,7 +114,7 @@ func StartTendermint( fmt.Println("Tendermint running!") } - return tmNode, func(ctx context.Context) error { + return tmNode, func(_ context.Context) error { cancel() tmNode.Wait() os.RemoveAll(conf.RootDir) diff --git a/scripts/keymigrate/migrate.go b/scripts/keymigrate/migrate.go index 82af5fc8e..e598f97ec 100644 --- a/scripts/keymigrate/migrate.go +++ b/scripts/keymigrate/migrate.go @@ -183,7 +183,7 @@ var migrations = []migrationDefinition{ storeName: "state", prefix: []byte(legacyStateKeyPrefix), ktype: stateStoreKey, - transform: func(key keyID) (keyID, error) { + transform: func(_ keyID) (keyID, error) { return orderedcode.Append(nil, int64(8)) }, }, @@ -276,7 +276,7 @@ var migrations = []migrationDefinition{ storeName: "light", prefix: []byte(legacyLightSizePrefix), ktype: lightSizeKey, - transform: func(key keyID) (keyID, error) { + transform: func(_ keyID) (keyID, error) { return orderedcode.Append(nil, int64(12)) }, }, @@ -402,8 +402,10 @@ var migrations = []migrationDefinition{ } // checkKeyType classifies a candidate key based on its structure. + func checkKeyType(key keyID, storeName string) (keyType, error) { - var migrations []migrationDefinition + // Migrations are empty, as we don't have any migrations to do atm, but we leave it here for future use. + migrations := []migrationDefinition{} for _, m := range migrations { if m.storeName != storeName { continue diff --git a/test/fuzz/tests/mempool_test.go b/test/fuzz/tests/mempool_test.go index 7e65a8f6f..d4b78f1a5 100644 --- a/test/fuzz/tests/mempool_test.go +++ b/test/fuzz/tests/mempool_test.go @@ -31,7 +31,7 @@ func FuzzMempool(f *testing.F) { mp := mempool.NewTxMempool(logger, cfg, conn) - f.Fuzz(func(t *testing.T, data []byte) { + f.Fuzz(func(_ *testing.T, data []byte) { _ = mp.CheckTx(context.Background(), data, nil, mempool.TxInfo{}) }) } diff --git a/test/fuzz/tests/p2p_secretconnection_test.go b/test/fuzz/tests/p2p_secretconnection_test.go index b3227847f..02f150979 100644 --- a/test/fuzz/tests/p2p_secretconnection_test.go +++ b/test/fuzz/tests/p2p_secretconnection_test.go @@ -15,7 +15,7 @@ import ( ) func FuzzP2PSecretConnection(f *testing.F) { - f.Fuzz(func(t *testing.T, data []byte) { + f.Fuzz(func(_ *testing.T, data []byte) { fuzz(data) }) } diff --git a/test/fuzz/tests/rpc_jsonrpc_server_test.go b/test/fuzz/tests/rpc_jsonrpc_server_test.go index e62d58686..66ef995bc 100644 --- a/test/fuzz/tests/rpc_jsonrpc_server_test.go +++ b/test/fuzz/tests/rpc_jsonrpc_server_test.go @@ -29,7 +29,7 @@ func FuzzRPCJSONRPCServer(f *testing.F) { mux := http.NewServeMux() rpcserver.RegisterRPCFuncs(mux, rpcFuncMap, log.NewNopLogger()) - f.Fuzz(func(t *testing.T, data []byte) { + f.Fuzz(func(_ *testing.T, data []byte) { if len(data) == 0 { return } diff --git a/types/part_set_test.go b/types/part_set_test.go index fc0b1eb73..59c669084 100644 --- a/types/part_set_test.go +++ b/types/part_set_test.go @@ -130,7 +130,7 @@ func TestPartValidateBasic(t *testing.T) { malleatePart func(*Part) expectErr bool }{ - {"Good Part", func(pt *Part) {}, false}, + {"Good Part", func(_ *Part) {}, false}, {"Too big part", func(pt *Part) { pt.Bytes = make([]byte, BlockPartSizeBytes+1) }, true}, {"Too big proof", func(pt *Part) { pt.Proof = merkle.Proof{ From 5346c28f82b54b5b36b92a4cfb9d61be6cdfb18a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:27:58 +0200 Subject: [PATCH 14/27] chore: lint, wip --- abci/example/counter/counter.go | 9 +++++---- abci/example/kvstore/config.go | 14 +++++++------- abci/example/kvstore/kvstore.go | 12 +++++++----- abci/example/kvstore/snapshots.go | 3 ++- cmd/tenderdash/commands/debug/dump.go | 3 ++- cmd/tenderdash/commands/debug/io.go | 2 +- cmd/tenderdash/commands/debug/util.go | 2 +- crypto/merkle/tree.go | 4 +++- crypto/secp256k1/secp256k1.go | 4 ++-- internal/eventlog/cursor/cursor.go | 8 +++++--- internal/evidence/pool.go | 7 ++++--- libs/math/safemath.go | 4 ++++ test/e2e/node/config.go | 4 ++-- types/quorum_sign_data.go | 2 +- 14 files changed, 46 insertions(+), 32 deletions(-) diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index 7e3492375..51a382a19 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -8,6 +8,7 @@ import ( "github.com/dashpay/tenderdash/abci/example/code" "github.com/dashpay/tenderdash/abci/types" tmcrypto "github.com/dashpay/tenderdash/crypto" + tmmath "github.com/dashpay/tenderdash/libs/math" tmtypes "github.com/dashpay/tenderdash/types" ) @@ -34,7 +35,7 @@ func (app *Application) InitCoreChainLock(initCoreChainHeight uint32, step int32 app.CoreChainLockStep = step app.HasCoreChainLocks = true app.CurrentCoreChainLockHeight = initCoreChainHeight - app.lastCoreChainLock = tmtypes.NewMockChainLock(app.CurrentCoreChainLockHeight) + app.lastCoreChainLock = tmtypes.NewMockChainLock(tmmath.MustConvertUint32(app.CurrentCoreChainLockHeight)) } func (app *Application) Info(_ context.Context, _ *types.RequestInfo) (*types.ResponseInfo, error) { @@ -51,7 +52,7 @@ func (app *Application) CheckTx(_ context.Context, req *types.RequestCheckTx) (* tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(req.Tx):], req.Tx) txValue := binary.BigEndian.Uint64(tx8) - if txValue < uint64(app.txCount) { + if txValue < tmmath.MustConvertUint64(app.txCount) { return &types.ResponseCheckTx{ Code: code.CodeTypeBadNonce, }, nil @@ -122,7 +123,7 @@ func (app *Application) handleTxs(txs [][]byte) []*types.ExecTxResult { tx8 := make([]byte, 8) copy(tx8[len(tx8)-len(tx):], tx) txValue := binary.BigEndian.Uint64(tx8) - if txValue != uint64(app.txCount) { + if txValue != tmmath.MustConvertUint64(app.txCount) { txResults = append(txResults, &types.ExecTxResult{ Code: code.CodeTypeBadNonce, Log: fmt.Sprintf("Invalid nonce. Expected %v, got %v", app.txCount, txValue), @@ -138,6 +139,6 @@ func (app *Application) updateCoreChainLock() { if !app.HasCoreChainLocks { return } - app.CurrentCoreChainLockHeight += uint32(app.CoreChainLockStep) + app.CurrentCoreChainLockHeight += tmmath.MustConvertUint32(app.CoreChainLockStep) app.lastCoreChainLock = tmtypes.NewMockChainLock(app.CurrentCoreChainLockHeight) } diff --git a/abci/example/kvstore/config.go b/abci/example/kvstore/config.go index e06495435..002a0834f 100644 --- a/abci/example/kvstore/config.go +++ b/abci/example/kvstore/config.go @@ -24,7 +24,7 @@ type Config struct { // SnapshotInterval specifies the height interval at which the application // will take state sync snapshots. Defaults to 0 (disabled). - SnapshotInterval uint64 `toml:"snapshot_interval"` + SnapshotInterval int64 `toml:"snapshot_interval"` // RetainBlocks specifies the number of recent blocks to retain. Defaults to // 0, which retains all blocks. Must be greater that PersistInterval, @@ -38,7 +38,7 @@ type Config struct { // PersistInterval specifies the height interval at which the application // will persist state to disk. Defaults to 1 (every height), setting this to // 0 disables state persistence. - PersistInterval uint64 `toml:"persist_interval"` + PersistInterval int64 `toml:"persist_interval"` // ValidatorUpdates is a map of heights to validator names and their power, // and will be returned by the ABCI application. For example, the following @@ -58,11 +58,11 @@ type Config struct { // Add artificial delays to each of the main ABCI calls to mimic computation time // of the application - PrepareProposalDelayMS uint64 `toml:"prepare_proposal_delay_ms"` - ProcessProposalDelayMS uint64 `toml:"process_proposal_delay_ms"` - CheckTxDelayMS uint64 `toml:"check_tx_delay_ms"` - VoteExtensionDelayMS uint64 `toml:"vote_extension_delay_ms"` - FinalizeBlockDelayMS uint64 `toml:"finalize_block_delay_ms"` + PrepareProposalDelayMS int64 `toml:"prepare_proposal_delay_ms"` + ProcessProposalDelayMS int64 `toml:"process_proposal_delay_ms"` + CheckTxDelayMS int64 `toml:"check_tx_delay_ms"` + VoteExtensionDelayMS int64 `toml:"vote_extension_delay_ms"` + FinalizeBlockDelayMS int64 `toml:"finalize_block_delay_ms"` // dash parameters ThesholdPublicKeyUpdate map[string]string `toml:"threshold_public_key_update"` diff --git a/abci/example/kvstore/kvstore.go b/abci/example/kvstore/kvstore.go index 608bc8be4..2a3cdf469 100644 --- a/abci/example/kvstore/kvstore.go +++ b/abci/example/kvstore/kvstore.go @@ -22,6 +22,7 @@ import ( "github.com/dashpay/tenderdash/internal/libs/protoio" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" types1 "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" "github.com/dashpay/tenderdash/version" @@ -302,7 +303,7 @@ func (app *Application) InitChain(_ context.Context, req *abci.RequestInitChain) if !ok { consensusParams = types1.ConsensusParams{ Version: &types1.VersionParams{ - AppVersion: uint64(app.LastCommittedState.GetHeight()) + 1, + AppVersion: tmmath.MustConvertUint64(app.LastCommittedState.GetHeight() + 1), }, } } @@ -581,7 +582,7 @@ func (app *Application) ApplySnapshotChunk(_ context.Context, req *abci.RequestA } func (app *Application) appVersionForHeight(height int64) uint64 { if app.appVersion == 0 { - return uint64(height) + return tmmath.MustConvertUint64(height) } return app.appVersion @@ -589,7 +590,8 @@ func (app *Application) appVersionForHeight(height int64) uint64 { func (app *Application) createSnapshot() error { height := app.LastCommittedState.GetHeight() - if app.cfg.SnapshotInterval == 0 || uint64(height)%app.cfg.SnapshotInterval != 0 { + + if app.cfg.SnapshotInterval == 0 || height%app.cfg.SnapshotInterval != 0 { return nil } _, err := app.snapshots.Create(app.LastCommittedState) @@ -851,7 +853,7 @@ func (app *Application) chainLockUpdate(height int64) (*types1.CoreChainLock, er if err != nil { return nil, fmt.Errorf("invalid number chainLockUpdate value %q: %w", chainLockUpdateStr, err) } - chainLock := types.NewMockChainLock(uint32(chainLockUpdate)) + chainLock := types.NewMockChainLock(tmmath.MustConvertUint32(chainLockUpdate)) return chainLock.ToProto(), nil } @@ -904,7 +906,7 @@ func (app *Application) persist() error { // persistInterval persists application state according to persist-interval parameter func (app *Application) persistInterval() error { - if app.cfg.PersistInterval == 0 || app.LastCommittedState.GetHeight()%int64(app.cfg.PersistInterval) != 0 { + if app.cfg.PersistInterval == 0 || app.LastCommittedState.GetHeight()%app.cfg.PersistInterval != 0 { return nil } return app.persist() diff --git a/abci/example/kvstore/snapshots.go b/abci/example/kvstore/snapshots.go index 271d5cf02..76f5df4fb 100644 --- a/abci/example/kvstore/snapshots.go +++ b/abci/example/kvstore/snapshots.go @@ -17,6 +17,7 @@ import ( "github.com/dashpay/tenderdash/crypto" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/ds" + tmmath "github.com/dashpay/tenderdash/libs/math" ) const ( @@ -118,7 +119,7 @@ func (s *SnapshotStore) Create(state State) (abci.Snapshot, error) { } snapshot := abci.Snapshot{ - Height: uint64(height), + Height: tmmath.MustConvertUint64(height), Version: 1, Hash: hasher.Sum(nil), } diff --git a/cmd/tenderdash/commands/debug/dump.go b/cmd/tenderdash/commands/debug/dump.go index 4797b33b4..47f15e261 100644 --- a/cmd/tenderdash/commands/debug/dump.go +++ b/cmd/tenderdash/commands/debug/dump.go @@ -14,6 +14,7 @@ import ( "github.com/dashpay/tenderdash/config" "github.com/dashpay/tenderdash/libs/cli" "github.com/dashpay/tenderdash/libs/log" + "github.com/dashpay/tenderdash/libs/math" rpchttp "github.com/dashpay/tenderdash/rpc/client/http" ) @@ -75,7 +76,7 @@ if enabled.`, } dumpDebugData(ctx, logger, rpc, dumpArgs) - ticker := time.NewTicker(time.Duration(frequency) * time.Second) + ticker := time.NewTicker(time.Duration(math.MustConvert[uint, int64](frequency)) * time.Second) for range ticker.C { dumpDebugData(ctx, logger, rpc, dumpArgs) } diff --git a/cmd/tenderdash/commands/debug/io.go b/cmd/tenderdash/commands/debug/io.go index bf904cf5c..9e40389e8 100644 --- a/cmd/tenderdash/commands/debug/io.go +++ b/cmd/tenderdash/commands/debug/io.go @@ -110,5 +110,5 @@ func writeStateJSONToFile(state interface{}, dir, filename string) error { return fmt.Errorf("failed to encode state dump: %w", err) } - return os.WriteFile(path.Join(dir, filename), stateJSON, os.ModePerm) + return os.WriteFile(path.Join(dir, filename), stateJSON, 0600) } diff --git a/cmd/tenderdash/commands/debug/util.go b/cmd/tenderdash/commands/debug/util.go index 445f37a7d..f67807ddb 100644 --- a/cmd/tenderdash/commands/debug/util.go +++ b/cmd/tenderdash/commands/debug/util.go @@ -78,5 +78,5 @@ func dumpProfile(dir, addr, profile string, debug int) error { return fmt.Errorf("failed to read %s profile response body: %w", profile, err) } - return os.WriteFile(path.Join(dir, fmt.Sprintf("%s.out", profile)), body, os.ModePerm) + return os.WriteFile(path.Join(dir, fmt.Sprintf("%s.out", profile)), body, 0600) } diff --git a/crypto/merkle/tree.go b/crypto/merkle/tree.go index 896b67c59..4a3dfb3c1 100644 --- a/crypto/merkle/tree.go +++ b/crypto/merkle/tree.go @@ -4,6 +4,8 @@ import ( "crypto/sha256" "hash" "math/bits" + + "github.com/dashpay/tenderdash/libs/math" ) // HashFromByteSlices computes a Merkle tree where the leaves are the byte slice, @@ -104,7 +106,7 @@ func getSplitPoint(length int64) int64 { } uLength := uint(length) bitlen := bits.Len(uLength) - k := int64(1 << uint(bitlen-1)) + k := int64(1 << math.MustConvert[int, uint](bitlen-1)) if k == length { k >>= 1 } diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index bbb23e1fe..9d07353a0 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -161,8 +161,8 @@ func (pubKey PubKey) Address() crypto.Address { _, _ = hasherSHA256.Write(pubKey) // does not error sha := hasherSHA256.Sum(nil) - hasherRIPEMD160 := ripemd160.New() - _, _ = hasherRIPEMD160.Write(sha) // does not error + hasherRIPEMD160 := ripemd160.New() //#nosec:G406 + _, _ = hasherRIPEMD160.Write(sha) // does not error return crypto.Address(hasherRIPEMD160.Sum(nil)) } diff --git a/internal/eventlog/cursor/cursor.go b/internal/eventlog/cursor/cursor.go index 215c79789..fc884b6da 100644 --- a/internal/eventlog/cursor/cursor.go +++ b/internal/eventlog/cursor/cursor.go @@ -7,6 +7,8 @@ import ( "strconv" "strings" "time" + + tmmath "github.com/dashpay/tenderdash/libs/math" ) // A Source produces cursors based on a time index generator and a sequence @@ -36,8 +38,8 @@ func (s *Source) nextCounter() int64 { // Cursor produces a fresh cursor from s at the current time index and counter. func (s *Source) Cursor() Cursor { return Cursor{ - timestamp: uint64(s.timeIndex()), - sequence: uint16(s.nextCounter() & 0xffff), + timestamp: tmmath.MustConvertUint64(s.timeIndex()), + sequence: tmmath.MustConvert[int64, uint16](s.nextCounter() & 0xffff), } } @@ -55,7 +57,7 @@ func (c Cursor) Before(o Cursor) bool { return c.timestamp < o.timestamp } // Diff returns the time duration between c and o. The duration is negative if // c is before o in time order. func (c Cursor) Diff(o Cursor) time.Duration { - return time.Duration(c.timestamp) - time.Duration(o.timestamp) + return time.Duration(tmmath.MustConvertInt64(c.timestamp) - tmmath.MustConvertInt64(o.timestamp)) } // IsZero reports whether c is the zero cursor. diff --git a/internal/evidence/pool.go b/internal/evidence/pool.go index 6c4db07a8..087a2fa12 100644 --- a/internal/evidence/pool.go +++ b/internal/evidence/pool.go @@ -19,6 +19,7 @@ import ( clist "github.com/dashpay/tenderdash/internal/libs/clist" sm "github.com/dashpay/tenderdash/internal/state" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" ) @@ -274,7 +275,7 @@ func (evpool *Pool) Start(state sm.State) error { return err } - atomic.StoreUint32(&evpool.evidenceSize, uint32(len(evList))) + atomic.StoreUint32(&evpool.evidenceSize, tmmath.MustConvertUint32(len(evList))) evpool.Metrics.NumEvidence.Set(float64(evpool.evidenceSize)) for _, ev := range evList { @@ -401,7 +402,7 @@ func (evpool *Pool) markEvidenceAsCommitted(evidence types.EvidenceList, height evpool.removeEvidenceFromList(blockEvidenceMap) // update the evidence size - atomic.AddUint32(&evpool.evidenceSize, ^uint32(len(blockEvidenceMap)-1)) + atomic.AddUint32(&evpool.evidenceSize, ^tmmath.MustConvertUint32(len(blockEvidenceMap)-1)) evpool.Metrics.NumEvidence.Set(float64(evpool.evidenceSize)) } @@ -482,7 +483,7 @@ func (evpool *Pool) removeExpiredPendingEvidence() (int64, time.Time) { // remove evidence from the clist evpool.removeEvidenceFromList(blockEvidenceMap) // update the evidence size - atomic.AddUint32(&evpool.evidenceSize, ^uint32(len(blockEvidenceMap)-1)) + atomic.AddUint32(&evpool.evidenceSize, ^tmmath.MustConvertUint32(len(blockEvidenceMap)-1)) return height, time } diff --git a/libs/math/safemath.go b/libs/math/safemath.go index 1a11c9124..34379afc7 100644 --- a/libs/math/safemath.go +++ b/libs/math/safemath.go @@ -152,6 +152,10 @@ func MustConvertUint64[T Integer](a T) uint64 { return MustConvert[T, uint64](a) } +func MustConvertInt64[T Integer](a T) int64 { + return MustConvert[T, int64](a) +} + // MustConvertInt32 takes an Integer and converts it to int32. // Panics if the conversion overflows. func MustConvertInt32[T Integer](a T) int32 { diff --git a/test/e2e/node/config.go b/test/e2e/node/config.go index 918355330..501501cae 100644 --- a/test/e2e/node/config.go +++ b/test/e2e/node/config.go @@ -16,8 +16,8 @@ type Config struct { Protocol string Dir string Mode string `toml:"mode"` - PersistInterval uint64 `toml:"persist_interval"` - SnapshotInterval uint64 `toml:"snapshot_interval"` + PersistInterval int64 `toml:"persist_interval"` + SnapshotInterval int64 `toml:"snapshot_interval"` RetainBlocks int64 `toml:"retain_blocks"` ValidatorUpdates map[string]map[string]string `toml:"validator_update"` PrivValServer string `toml:"privval_server"` diff --git a/types/quorum_sign_data.go b/types/quorum_sign_data.go index 1bd51c622..d4d01750e 100644 --- a/types/quorum_sign_data.go +++ b/types/quorum_sign_data.go @@ -179,7 +179,7 @@ func (i SignItem) MarshalZerologObject(e *zerolog.Event) { e.Hex("signID", i.SignHash) e.Hex("msgHash", i.MsgHash) e.Hex("quorumHash", i.QuorumHash) - e.Uint8("llmqType", uint8(i.LlmqType)) + e.Int("llmqType", int(i.LlmqType)) } From 8561eed050287dc89f4960d4326ca2b64b1eca7b Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Oct 2024 13:33:13 +0200 Subject: [PATCH 15/27] chore: lint issues --- dash/core/mock.go | 3 ++- internal/libs/flowrate/util.go | 4 +++- internal/libs/protoio/writer.go | 7 ++++--- internal/libs/tempfile/tempfile.go | 6 ++++-- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/dash/core/mock.go b/dash/core/mock.go index 8afd06d93..8b8932896 100644 --- a/dash/core/mock.go +++ b/dash/core/mock.go @@ -10,6 +10,7 @@ import ( "github.com/dashpay/tenderdash/crypto" tmbytes "github.com/dashpay/tenderdash/libs/bytes" + "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/types" ) @@ -74,7 +75,7 @@ func (mc *MockClient) QuorumInfo( panic(err) } return &btcjson.QuorumInfoResult{ - Height: uint32(height), + Height: math.MustConvertUint32(height), Type: strconv.Itoa(int(quorumType)), QuorumHash: quorumHash.String(), Members: members, diff --git a/internal/libs/flowrate/util.go b/internal/libs/flowrate/util.go index c18096107..b0d3764de 100644 --- a/internal/libs/flowrate/util.go +++ b/internal/libs/flowrate/util.go @@ -8,6 +8,8 @@ import ( "math" "strconv" "time" + + tmmath "github.com/dashpay/tenderdash/libs/math" ) // clockRate is the resolution and precision of clock(). @@ -39,7 +41,7 @@ func percentOf(x, total float64) Percent { if x < 0 || total <= 0 { return 0 } else if p := round(x / total * 1e5); p <= math.MaxUint32 { - return Percent(p) + return Percent(tmmath.MustConvertUint32(p)) } return Percent(math.MaxUint32) } diff --git a/internal/libs/protoio/writer.go b/internal/libs/protoio/writer.go index c2305fa2e..f2489c290 100644 --- a/internal/libs/protoio/writer.go +++ b/internal/libs/protoio/writer.go @@ -34,10 +34,11 @@ import ( "bytes" "encoding/binary" "io" - "sync" "github.com/gogo/protobuf/proto" + + tmmath "github.com/dashpay/tenderdash/libs/math" ) // NewDelimitedWriter writes a varint-delimited Protobuf message to a writer. It is @@ -60,7 +61,7 @@ func (w *varintWriter) WriteMsg(msg proto.Message) (int, error) { if n+binary.MaxVarintLen64 >= len(w.buffer) { w.buffer = make([]byte, n+binary.MaxVarintLen64) } - lenOff := binary.PutUvarint(w.buffer, uint64(n)) + lenOff := binary.PutUvarint(w.buffer, tmmath.MustConvertUint64(n)) _, err := m.MarshalTo(w.buffer[lenOff:]) if err != nil { return 0, err @@ -94,7 +95,7 @@ func (w *varintWriter) Close() error { func varintWrittenBytes(m marshaler, size int) ([]byte, error) { buf := make([]byte, size+binary.MaxVarintLen64) - n := binary.PutUvarint(buf, uint64(size)) + n := binary.PutUvarint(buf, tmmath.MustConvertUint64(size)) nw, err := m.MarshalTo(buf[n:]) if err != nil { return nil, err diff --git a/internal/libs/tempfile/tempfile.go b/internal/libs/tempfile/tempfile.go index 7209a4614..b5ac5051d 100644 --- a/internal/libs/tempfile/tempfile.go +++ b/internal/libs/tempfile/tempfile.go @@ -10,6 +10,8 @@ import ( "time" sync "github.com/sasha-s/go-deadlock" + + tmmath "github.com/dashpay/tenderdash/libs/math" ) const ( @@ -43,7 +45,7 @@ func writeFileRandReseed() uint64 { // The important thing here is that now for a seed conflict, they would both have to be on // the correct nanosecond offset, and second-based offset, which is much less likely than // just a conflict with the correct nanosecond offset. - return uint64(time.Now().UnixNano() + int64(os.Getpid()<<20)) + return tmmath.MustConvertUint64(time.Now().UnixNano() + int64(os.Getpid()<<20)) } // Use a fast thread safe LCG for atomic write file names. @@ -62,7 +64,7 @@ func randWriteFileSuffix() string { atomicWriteFileRand = r atomicWriteFileRandMu.Unlock() // Can have a negative name, replace this in the following - suffix := strconv.Itoa(int(r)) + suffix := strconv.FormatUint(r, 10) if string(suffix[0]) == "-" { // Replace first "-" with "0". This is purely for UI clarity, // as otherwhise there would be two `-` in a row. From 8831e1acfa10ab86e6feebdc9e839d456c41a01a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Wed, 16 Oct 2024 15:53:09 +0200 Subject: [PATCH 16/27] chore: change ChannelID to 32 bit to match proto --- internal/libs/sync/concurrent_slice_test.go | 8 +++--- internal/p2p/client/consumer.go | 3 ++- internal/p2p/conn/connection.go | 4 +-- internal/p2p/conn/secret_connection.go | 3 ++- internal/p2p/p2p_test.go | 5 ++-- internal/p2p/p2ptest/network.go | 3 ++- internal/p2p/peermanager.go | 5 ++-- internal/p2p/pqueue.go | 15 +++++------ internal/p2p/router.go | 11 +++++--- internal/p2p/router_test.go | 9 ++++--- internal/p2p/transport_test.go | 9 ++++--- libs/math/safemath.go | 16 ++++++++++++ node/setup.go | 28 ++++++++++----------- types/node_info.go | 18 ++++++++----- types/node_info_test.go | 17 +++++++------ 15 files changed, 95 insertions(+), 59 deletions(-) diff --git a/internal/libs/sync/concurrent_slice_test.go b/internal/libs/sync/concurrent_slice_test.go index 122f3a1a2..b37268cfe 100644 --- a/internal/libs/sync/concurrent_slice_test.go +++ b/internal/libs/sync/concurrent_slice_test.go @@ -6,6 +6,8 @@ import ( "testing" "github.com/stretchr/testify/assert" + + "github.com/dashpay/tenderdash/internal/p2p/conn" ) func TestConcurrentSlice(t *testing.T) { @@ -72,9 +74,9 @@ func TestConcurrentSlice_Concurrency(t *testing.T) { func TestConcurrentSlice_MarshalUnmarshalJSON(t *testing.T) { type node struct { - Channels *ConcurrentSlice[uint16] + Channels *ConcurrentSlice[conn.ChannelID] } - cs := NewConcurrentSlice[uint16](1, 2, 3) + cs := NewConcurrentSlice[conn.ChannelID](1, 2, 3) node1 := node{ Channels: cs, @@ -86,7 +88,7 @@ func TestConcurrentSlice_MarshalUnmarshalJSON(t *testing.T) { // Unmarshal from JSON node2 := node{ - // Channels: NewConcurrentSlice[uint16](), + // Channels: NewConcurrentSlice[conn.ChannelID](), } err = json.Unmarshal(data, &node2) diff --git a/internal/p2p/client/consumer.go b/internal/p2p/client/consumer.go index 976c0590f..3c8d5e58f 100644 --- a/internal/p2p/client/consumer.go +++ b/internal/p2p/client/consumer.go @@ -7,6 +7,7 @@ import ( "github.com/dashpay/tenderdash/internal/p2p" "github.com/dashpay/tenderdash/libs/log" + "github.com/dashpay/tenderdash/libs/math" ) // DefaultRecvBurstMultiplier tells how many times burst is bigger than the limit in recvRateLimitPerPeerHandler @@ -155,7 +156,7 @@ func (h *validateMessageHandler) Handle(ctx context.Context, client *Client, env } func (h *recvRateLimitPerPeerHandler) Handle(ctx context.Context, client *Client, envelope *p2p.Envelope) error { - accepted, err := h.RateLimit.Limit(ctx, envelope.From, int(h.nTokensFunc(envelope))) + accepted, err := h.RateLimit.Limit(ctx, envelope.From, math.MustConvert[uint, int](h.nTokensFunc(envelope))) if err != nil { return fmt.Errorf("rate limit failed for peer '%s;: %w", envelope.From, err) } diff --git a/internal/p2p/conn/connection.go b/internal/p2p/conn/connection.go index 7ff317a1e..5abf0b197 100644 --- a/internal/p2p/conn/connection.go +++ b/internal/p2p/conn/connection.go @@ -599,11 +599,11 @@ type ChannelStatus struct { // ----------------------------------------------------------------------------- // ChannelID is an arbitrary channel ID. -type ChannelID uint16 +type ChannelID int32 type ChannelDescriptor struct { ID ChannelID - Priority int + Priority uint // TODO: Remove once p2p refactor is complete. SendQueueCapacity int diff --git a/internal/p2p/conn/secret_connection.go b/internal/p2p/conn/secret_connection.go index 222fc1b69..2ba5918bc 100644 --- a/internal/p2p/conn/secret_connection.go +++ b/internal/p2p/conn/secret_connection.go @@ -28,6 +28,7 @@ import ( "github.com/dashpay/tenderdash/crypto/encoding" "github.com/dashpay/tenderdash/internal/libs/async" "github.com/dashpay/tenderdash/internal/libs/protoio" + tmmath "github.com/dashpay/tenderdash/libs/math" tmp2p "github.com/dashpay/tenderdash/proto/tendermint/p2p" ) @@ -217,7 +218,7 @@ func (sc *SecretConnection) Write(data []byte) (n int, err error) { data = nil } chunkLength := len(chunk) - binary.LittleEndian.PutUint32(frame, uint32(chunkLength)) + binary.LittleEndian.PutUint32(frame, tmmath.MustConvertUint32(chunkLength)) copy(frame[dataLenSize:], chunk) // encrypt the frame diff --git a/internal/p2p/p2p_test.go b/internal/p2p/p2p_test.go index 2d2c6c2c4..732ef7801 100644 --- a/internal/p2p/p2p_test.go +++ b/internal/p2p/p2p_test.go @@ -5,6 +5,7 @@ import ( "github.com/dashpay/tenderdash/crypto/ed25519" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" "github.com/dashpay/tenderdash/internal/p2p" + "github.com/dashpay/tenderdash/internal/p2p/conn" "github.com/dashpay/tenderdash/types" ) @@ -26,7 +27,7 @@ var ( ListenAddr: "0.0.0.0:0", Network: "test", Moniker: string(selfID), - Channels: tmsync.NewConcurrentSlice[uint16](0x01, 0x02), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](0x01, 0x02), } peerKey crypto.PrivKey = ed25519.GenPrivKeyFromSecret([]byte{0x84, 0xd7, 0x01, 0xbf, 0x83, 0x20, 0x1c, 0xfe}) @@ -36,6 +37,6 @@ var ( ListenAddr: "0.0.0.0:0", Network: "test", Moniker: string(peerID), - Channels: tmsync.NewConcurrentSlice[uint16](0x01, 0x02), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](0x01, 0x02), } ) diff --git a/internal/p2p/p2ptest/network.go b/internal/p2p/p2ptest/network.go index e9f6d9abd..d59821652 100644 --- a/internal/p2p/p2ptest/network.go +++ b/internal/p2p/p2ptest/network.go @@ -15,6 +15,7 @@ import ( tmsync "github.com/dashpay/tenderdash/internal/libs/sync" "github.com/dashpay/tenderdash/internal/p2p" p2pclient "github.com/dashpay/tenderdash/internal/p2p/client" + "github.com/dashpay/tenderdash/internal/p2p/conn" "github.com/dashpay/tenderdash/libs/log" "github.com/dashpay/tenderdash/types" ) @@ -272,7 +273,7 @@ func (n *Network) MakeNode(ctx context.Context, t *testing.T, proTxHash crypto.P ListenAddr: "0.0.0.0:0", // FIXME: We have to fake this for now. Moniker: string(nodeID), ProTxHash: proTxHash.Copy(), - Channels: tmsync.NewConcurrentSlice[uint16](), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](), } transport := n.memoryNetwork.CreateTransport(nodeID) diff --git a/internal/p2p/peermanager.go b/internal/p2p/peermanager.go index 533a570fe..500c7c11c 100644 --- a/internal/p2p/peermanager.go +++ b/internal/p2p/peermanager.go @@ -19,6 +19,7 @@ import ( tmsync "github.com/dashpay/tenderdash/internal/libs/sync" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" p2pproto "github.com/dashpay/tenderdash/proto/tendermint/p2p" "github.com/dashpay/tenderdash/types" ) @@ -1071,7 +1072,7 @@ func (m *PeerManager) Advertise(peerID types.NodeID, limit uint16) []NodeAddress // if the number of addresses is less than the number of peers // to advertise, adjust the limit downwards if numAddresses < int(limit) { - limit = uint16(numAddresses) + limit = tmmath.MustConvertUint16(numAddresses) } if numAddresses == 0 { @@ -1674,7 +1675,7 @@ func (p *peerInfo) Score() PeerScore { score = math.MinInt16 } - return PeerScore(score) + return PeerScore(tmmath.MustConvertInt16(score)) } // Validate validates the peer info. diff --git a/internal/p2p/pqueue.go b/internal/p2p/pqueue.go index eea4ea214..ae2023efe 100644 --- a/internal/p2p/pqueue.go +++ b/internal/p2p/pqueue.go @@ -12,6 +12,7 @@ import ( "github.com/gogo/protobuf/proto" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" ) // pqEnvelope defines a wrapper around an Envelope with priority to be inserted @@ -118,8 +119,8 @@ func newPQScheduler( for _, chDesc := range chDescsCopy { chID := chDesc.ID - chPriorities[chID] = uint(chDesc.Priority) - sizes[uint(chDesc.Priority)] = 0 + chPriorities[chID] = chDesc.Priority + sizes[chDesc.Priority] = 0 } pq := make(priorityQueue, 0) @@ -170,7 +171,7 @@ func (s *pqScheduler) process(ctx context.Context) { chIDStr := strconv.Itoa(int(e.ChannelID)) pqEnv := &pqEnvelope{ envelope: e, - size: uint(proto.Size(e.Message)), + size: tmmath.MustConvertUint(proto.Size(e.Message)), priority: s.chPriorities[e.ChannelID], timestamp: time.Now().UTC(), } @@ -255,8 +256,8 @@ func (s *pqScheduler) process(ctx context.Context) { s.size -= pqEnv.size // deduct the Envelope size from all the relevant cumulative sizes - for i := 0; i < len(s.chDescs) && pqEnv.priority <= uint(s.chDescs[i].Priority); i++ { - s.sizes[uint(s.chDescs[i].Priority)] -= pqEnv.size + for i := 0; i < len(s.chDescs) && pqEnv.priority <= s.chDescs[i].Priority; i++ { + s.sizes[s.chDescs[i].Priority] -= pqEnv.size } s.metrics.PeerSendBytesTotal.With( @@ -287,7 +288,7 @@ func (s *pqScheduler) push(pqEnv *pqEnvelope) { // Update the cumulative sizes by adding the Envelope's size to every // priority less than or equal to it. - for i := 0; i < len(s.chDescs) && pqEnv.priority <= uint(s.chDescs[i].Priority); i++ { - s.sizes[uint(s.chDescs[i].Priority)] += pqEnv.size + for i := 0; i < len(s.chDescs) && pqEnv.priority <= s.chDescs[i].Priority; i++ { + s.sizes[s.chDescs[i].Priority] += pqEnv.size } } diff --git a/internal/p2p/router.go b/internal/p2p/router.go index 4ac248e1d..53abd8fba 100644 --- a/internal/p2p/router.go +++ b/internal/p2p/router.go @@ -16,7 +16,9 @@ import ( "github.com/dashpay/tenderdash/crypto" tmstrings "github.com/dashpay/tenderdash/internal/libs/strings" + "github.com/dashpay/tenderdash/internal/p2p/conn" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/libs/service" "github.com/dashpay/tenderdash/proto/tendermint/p2p" "github.com/dashpay/tenderdash/types" @@ -227,7 +229,8 @@ func (r *Router) createQueueFactory(ctx context.Context) (func(int) queue, error if size%2 != 0 { size++ } - q := newPQScheduler(r.logger, r.metrics, r.lc, r.chDescs, uint(size)/2, uint(size)/2, defaultCapacity) + halfSize := tmmath.MustConvertUint(size / 2) + q := newPQScheduler(r.logger, r.metrics, r.lc, r.chDescs, halfSize, halfSize, defaultCapacity) q.start(ctx) return q }, nil @@ -269,7 +272,7 @@ func (r *Router) OpenChannel(ctx context.Context, chDesc *ChannelDescriptor) (Ch r.channelQueues[id] = queue // add the channel to the nodeInfo if it's not already there. - r.nodeInfoProducer().AddChannel(uint16(chDesc.ID)) + r.nodeInfoProducer().AddChannel(chDesc.ID) r.transport.AddChannelDescriptors([]*ChannelDescriptor{chDesc}) @@ -1009,10 +1012,10 @@ func (cs ChannelIDSet) Contains(id ChannelID) bool { return ok } -func toChannelIDs(ids []uint16) ChannelIDSet { +func toChannelIDs(ids []conn.ChannelID) ChannelIDSet { c := make(map[ChannelID]struct{}, len(ids)) for _, b := range ids { - c[ChannelID(b)] = struct{}{} + c[b] = struct{}{} } return c } diff --git a/internal/p2p/router_test.go b/internal/p2p/router_test.go index 3ba738a6c..a9430f8b0 100644 --- a/internal/p2p/router_test.go +++ b/internal/p2p/router_test.go @@ -22,6 +22,7 @@ import ( "github.com/dashpay/tenderdash/crypto" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" "github.com/dashpay/tenderdash/internal/p2p" + "github.com/dashpay/tenderdash/internal/p2p/conn" "github.com/dashpay/tenderdash/internal/p2p/mocks" "github.com/dashpay/tenderdash/internal/p2p/p2ptest" "github.com/dashpay/tenderdash/libs/log" @@ -307,7 +308,7 @@ func TestRouter_AcceptPeers(t *testing.T) { ListenAddr: "0.0.0.0:0", Network: "other-network", Moniker: string(peerID), - Channels: tmsync.NewConcurrentSlice[uint16](), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](), }, peerKey.PubKey(), false, @@ -508,7 +509,7 @@ func TestRouter_DialPeers(t *testing.T) { ListenAddr: "0.0.0.0:0", Network: "other-network", Moniker: string(peerID), - Channels: tmsync.NewConcurrentSlice[uint16](), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](), }, peerKey.PubKey(), nil, @@ -770,7 +771,7 @@ func TestRouter_ChannelCompatability(t *testing.T) { ListenAddr: "0.0.0.0:0", Network: "test", Moniker: string(peerID), - Channels: tmsync.NewConcurrentSlice[uint16](0x03), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](0x03), } mockConnection := &mocks.Connection{} @@ -821,7 +822,7 @@ func TestRouter_DontSendOnInvalidChannel(t *testing.T) { ListenAddr: "0.0.0.0:0", Network: "test", Moniker: string(peerID), - Channels: tmsync.NewConcurrentSlice[uint16](0x02), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](0x02), } mockConnection := &mocks.Connection{} diff --git a/internal/p2p/transport_test.go b/internal/p2p/transport_test.go index 7670cca9f..05f4661ba 100644 --- a/internal/p2p/transport_test.go +++ b/internal/p2p/transport_test.go @@ -14,6 +14,7 @@ import ( "github.com/dashpay/tenderdash/crypto/ed25519" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" "github.com/dashpay/tenderdash/internal/p2p" + "github.com/dashpay/tenderdash/internal/p2p/conn" "github.com/dashpay/tenderdash/types" ) @@ -281,7 +282,7 @@ func TestConnection_Handshake(t *testing.T) { ListenAddr: "listenaddr", Network: "network", Version: "1.2.3", - Channels: tmsync.NewConcurrentSlice[uint16](0xf0, 0x0f), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](0xf0, 0x0f), Moniker: "moniker", Other: types.NodeInfoOther{ TxIndex: "txindex", @@ -291,7 +292,7 @@ func TestConnection_Handshake(t *testing.T) { bKey := ed25519.GenPrivKey() bInfo := types.NodeInfo{ NodeID: types.NodeIDFromPubKey(bKey.PubKey()), - Channels: tmsync.NewConcurrentSlice[uint16](), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](), } errCh := make(chan error, 1) @@ -639,13 +640,13 @@ func dialAcceptHandshake(ctx context.Context, t *testing.T, a, b p2p.Transport) errCh := make(chan error, 1) go func() { privKey := ed25519.GenPrivKey() - nodeInfo := types.NodeInfo{NodeID: types.NodeIDFromPubKey(privKey.PubKey()), Channels: tmsync.NewConcurrentSlice[uint16]()} + nodeInfo := types.NodeInfo{NodeID: types.NodeIDFromPubKey(privKey.PubKey()), Channels: tmsync.NewConcurrentSlice[conn.ChannelID]()} _, _, err := ba.Handshake(ctx, 0, nodeInfo, privKey) errCh <- err }() privKey := ed25519.GenPrivKey() - nodeInfo := types.NodeInfo{NodeID: types.NodeIDFromPubKey(privKey.PubKey()), Channels: tmsync.NewConcurrentSlice[uint16]()} + nodeInfo := types.NodeInfo{NodeID: types.NodeIDFromPubKey(privKey.PubKey()), Channels: tmsync.NewConcurrentSlice[conn.ChannelID]()} _, _, err := ab.Handshake(ctx, 0, nodeInfo, privKey) require.NoError(t, err) diff --git a/libs/math/safemath.go b/libs/math/safemath.go index 34379afc7..ac555d075 100644 --- a/libs/math/safemath.go +++ b/libs/math/safemath.go @@ -156,6 +156,22 @@ func MustConvertInt64[T Integer](a T) int64 { return MustConvert[T, int64](a) } +func MustConvertUint16[T Integer](a T) uint16 { + return MustConvert[T, uint16](a) +} + +func MustConvertInt16[T Integer](a T) int16 { + return MustConvert[T, int16](a) +} + +func MustConvertUint[T Integer](a T) uint { + return MustConvert[T, uint](a) +} + +func MustConvertInt[T Integer](a T) int { + return MustConvert[T, int](a) +} + // MustConvertInt32 takes an Integer and converts it to int32. // Panics if the conversion overflows. func MustConvertInt32[T Integer](a T) int32 { diff --git a/node/setup.go b/node/setup.go index 8d3dbf2be..64c8b68eb 100644 --- a/node/setup.go +++ b/node/setup.go @@ -365,19 +365,19 @@ func makeNodeInfo( NodeID: nodeKey.ID, Network: genDoc.ChainID, Version: version.TMCoreSemVer, - Channels: tmsync.NewConcurrentSlice[uint16]( - uint16(p2p.BlockSyncChannel), - uint16(p2p.ConsensusStateChannel), - uint16(p2p.ConsensusDataChannel), - uint16(p2p.ConsensusVoteChannel), - uint16(p2p.VoteSetBitsChannel), - uint16(p2p.MempoolChannel), - uint16(evidence.EvidenceChannel), - uint16(statesync.SnapshotChannel), - uint16(statesync.ChunkChannel), - uint16(statesync.LightBlockChannel), - uint16(statesync.ParamsChannel), - uint16(pex.PexChannel), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID]( + p2p.BlockSyncChannel, + p2p.ConsensusStateChannel, + p2p.ConsensusDataChannel, + p2p.ConsensusVoteChannel, + p2p.VoteSetBitsChannel, + p2p.MempoolChannel, + evidence.EvidenceChannel, + statesync.SnapshotChannel, + statesync.ChunkChannel, + statesync.LightBlockChannel, + statesync.ParamsChannel, + pex.PexChannel, ), Moniker: cfg.Moniker, Other: types.NodeInfoOther{ @@ -410,7 +410,7 @@ func makeSeedNodeInfo( NodeID: nodeKey.ID, Network: genDoc.ChainID, Version: version.TMCoreSemVer, - Channels: tmsync.NewConcurrentSlice[uint16](pex.PexChannel), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](pex.PexChannel), Moniker: cfg.Moniker, Other: types.NodeInfoOther{ TxIndex: "off", diff --git a/types/node_info.go b/types/node_info.go index e2d884486..f7d54296e 100644 --- a/types/node_info.go +++ b/types/node_info.go @@ -10,7 +10,8 @@ import ( "github.com/dashpay/tenderdash/crypto" tmstrings "github.com/dashpay/tenderdash/internal/libs/strings" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" - tmmath "github.com/dashpay/tenderdash/libs/math" + "github.com/dashpay/tenderdash/internal/p2p/conn" + "github.com/dashpay/tenderdash/libs/math" tmp2p "github.com/dashpay/tenderdash/proto/tendermint/p2p" ) @@ -50,7 +51,7 @@ type NodeInfo struct { Network string `json:"network"` // network/chain ID Version string `json:"version"` // major.minor.revision // Channels supported by this node. Use GetChannels() as a getter. - Channels *tmsync.ConcurrentSlice[uint16] `json:"channels"` // channels this node knows about + Channels *tmsync.ConcurrentSlice[conn.ChannelID] `json:"channels"` // channels this node knows about // ASCIIText fields Moniker string `json:"moniker"` // arbitrary moniker @@ -105,7 +106,7 @@ func (info NodeInfo) Validate() error { if info.Channels.Len() > maxNumChannels { return fmt.Errorf("info.Channels is too long (%v). Max is %v", info.Channels.Len(), maxNumChannels) } - channels := make(map[uint16]struct{}) + channels := make(map[conn.ChannelID]struct{}) for _, ch := range info.Channels.ToSlice() { _, ok := channels[ch] if ok { @@ -174,7 +175,7 @@ OUTER_LOOP: } // AddChannel is used by the router when a channel is opened to add it to the node info -func (info *NodeInfo) AddChannel(channel uint16) { +func (info *NodeInfo) AddChannel(channel conn.ChannelID) { // check that the channel doesn't already exist for _, ch := range info.Channels.ToSlice() { if ch == channel { @@ -241,7 +242,7 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) { ListenAddr: pb.ListenAddr, Network: pb.Network, Version: pb.Version, - Channels: tmsync.NewConcurrentSlice[uint16](), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](), Moniker: pb.Moniker, Other: NodeInfoOther{ TxIndex: pb.Other.TxIndex, @@ -251,7 +252,12 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) { } for _, ch := range pb.Channels { - dni.Channels.Append(tmmath.MustConvert[uint32, uint16](ch)) + // we need to explicitly validate the channel id, to avoid panics when remote host sends invalid channel id + chID, err := math.SafeConvert[uint32, int32](ch) + if err != nil { + return NodeInfo{}, fmt.Errorf("failed to convert channel id %d: %v", ch, err) + } + dni.Channels.Append(conn.ChannelID(chID)) } return dni, nil diff --git a/types/node_info_test.go b/types/node_info_test.go index 3f3c02886..587b38c9d 100644 --- a/types/node_info_test.go +++ b/types/node_info_test.go @@ -9,6 +9,7 @@ import ( "github.com/dashpay/tenderdash/crypto/ed25519" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" + "github.com/dashpay/tenderdash/internal/p2p/conn" tmnet "github.com/dashpay/tenderdash/libs/net" "github.com/dashpay/tenderdash/version" ) @@ -21,12 +22,12 @@ func TestNodeInfoValidate(t *testing.T) { ni := NodeInfo{} assert.Error(t, ni.Validate()) - channels := tmsync.NewConcurrentSlice[uint16]() - for i := uint16(0); i < maxNumChannels; i++ { + channels := tmsync.NewConcurrentSlice[conn.ChannelID]() + for i := conn.ChannelID(0); i < maxNumChannels; i++ { channels.Append(i) } - dupChannels := tmsync.NewConcurrentSlice[uint16](channels.ToSlice()[:5]...) + dupChannels := tmsync.NewConcurrentSlice[conn.ChannelID](channels.ToSlice()[:5]...) dupChannels.Append(testCh) nonASCII := "¢§µ" @@ -125,7 +126,7 @@ func testNodeInfoWithNetwork(t *testing.T, id NodeID, name, network string) Node ListenAddr: fmt.Sprintf("127.0.0.1:%d", getFreePort(t)), Network: network, Version: "1.2.3-rc0-deadbeef", - Channels: tmsync.NewConcurrentSlice[uint16](testCh), + Channels: tmsync.NewConcurrentSlice[conn.ChannelID](testCh), Moniker: name, Other: NodeInfoOther{ TxIndex: "on", @@ -146,7 +147,7 @@ func TestNodeInfoCompatible(t *testing.T) { nodeKey2ID := testNodeID() name := "testing" - var newTestChannel byte = 0x2 + var newTestChannel conn.ChannelID = 0x2 // test NodeInfo is compatible ni1 := testNodeInfo(t, nodeKey1ID, name) @@ -154,7 +155,7 @@ func TestNodeInfoCompatible(t *testing.T) { assert.NoError(t, ni1.CompatibleWith(ni2)) // add another channel; still compatible - ni2.Channels = tmsync.NewConcurrentSlice[uint16](testCh) + ni2.Channels = tmsync.NewConcurrentSlice[conn.ChannelID](testCh) assert.NoError(t, ni1.CompatibleWith(ni2)) testCases := []struct { @@ -163,7 +164,7 @@ func TestNodeInfoCompatible(t *testing.T) { }{ {"Wrong block version", func(ni *NodeInfo) { ni.ProtocolVersion.Block++ }}, {"Wrong network", func(ni *NodeInfo) { ni.Network += "-wrong" }}, - {"No common channels", func(ni *NodeInfo) { ni.Channels = tmsync.NewConcurrentSlice[uint16](uint16(newTestChannel)) }}, + {"No common channels", func(ni *NodeInfo) { ni.Channels = tmsync.NewConcurrentSlice[conn.ChannelID](newTestChannel) }}, } for _, tc := range testCases { @@ -175,7 +176,7 @@ func TestNodeInfoCompatible(t *testing.T) { func TestNodeInfoAddChannel(t *testing.T) { nodeInfo := testNodeInfo(t, testNodeID(), "testing") - nodeInfo.Channels = tmsync.NewConcurrentSlice[uint16]() + nodeInfo.Channels = tmsync.NewConcurrentSlice[conn.ChannelID]() require.Empty(t, nodeInfo.Channels) nodeInfo.AddChannel(2) From 9c444b341937d8140e9bb611c2d76d2658b068ca Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Sat, 2 Nov 2024 18:12:33 +0100 Subject: [PATCH 17/27] chore: lint allow ripemd160 --- crypto/secp256k1/secp256k1.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index 9d07353a0..a7fd87668 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -17,7 +17,7 @@ import ( "github.com/dashpay/tenderdash/internal/jsontypes" // necessary for Bitcoin address format - "golang.org/x/crypto/ripemd160" //nolint:staticcheck + "golang.org/x/crypto/ripemd160" //nolint:staticcheck,deprecated ) // ------------------------------------- From 0848cbe80b2ca8effaab7eca9e63b7eda52ced0a Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Sat, 2 Nov 2024 23:02:55 +0100 Subject: [PATCH 18/27] chore(github): check whole code base in gha --- .github/workflows/lint.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bd494e3a7..0865f8055 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -56,5 +56,5 @@ jobs: version: v1.61 args: --timeout 10m github-token: ${{ secrets.github_token }} - only-new-issues: true + only-new-issues: false if: env.GIT_DIFF From a0b2032fd86ab3ba2d3922bdf1483acc99987916 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 11:54:41 +0100 Subject: [PATCH 19/27] chore: lint green --- abci/cmd/abci-cli/abci-cli.go | 5 +++-- abci/example/kvstore/kvstore_test.go | 9 +++++---- crypto/secp256k1/secp256k1.go | 2 +- internal/blocksync/reactor_test.go | 7 +++++-- internal/consensus/wal_test.go | 3 ++- internal/eventlog/cursor/cursor.go | 2 +- internal/mempool/mempool_bench_test.go | 3 ++- internal/p2p/address.go | 3 ++- internal/p2p/rqueue.go | 6 ++++-- internal/p2p/transport_mconn.go | 7 ++++--- internal/rpc/core/abci.go | 3 ++- internal/state/test/factory/block.go | 3 ++- internal/statesync/dispatcher.go | 3 ++- internal/statesync/reactor.go | 5 +++-- internal/statesync/repo.go | 3 ++- internal/statesync/stateprovider.go | 7 ++++--- internal/statesync/syncer.go | 5 +++-- internal/test/factory/commit.go | 3 ++- internal/test/factory/vote.go | 3 ++- libs/math/safemath.go | 4 ++++ libs/promise/promise_test.go | 2 +- libs/workerpool/worker_pool.go | 3 ++- light/proxy/routes.go | 5 +++-- light/rpc/client.go | 6 +++--- privval/dash_consensus_key.go | 2 +- privval/file_test.go | 3 ++- privval/grpc/client.go | 5 +++-- privval/secret_connection.go | 2 +- privval/signer_client.go | 5 +++-- rpc/client/evidence_test.go | 3 ++- rpc/client/http/http.go | 3 ++- rpc/client/local/local.go | 5 +++-- test/e2e/app/app.go | 3 ++- test/e2e/pkg/testnet.go | 17 +++++++++-------- types/block.go | 18 ++++++++++++++++++ types/block_test.go | 3 ++- types/netaddress.go | 4 +++- types/node_info.go | 8 ++++---- types/part_set.go | 2 +- types/proposal.go | 9 +++++---- types/quorum_sign_data.go | 3 ++- types/test_util.go | 5 +++-- types/validation.go | 3 ++- types/validator_address.go | 3 ++- types/vote.go | 5 +++-- 45 files changed, 137 insertions(+), 76 deletions(-) diff --git a/abci/cmd/abci-cli/abci-cli.go b/abci/cmd/abci-cli/abci-cli.go index efc2c8593..ee7fe7945 100644 --- a/abci/cmd/abci-cli/abci-cli.go +++ b/abci/cmd/abci-cli/abci-cli.go @@ -23,6 +23,7 @@ import ( "github.com/dashpay/tenderdash/abci/types" "github.com/dashpay/tenderdash/config" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/proto/tendermint/crypto" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" pbversion "github.com/dashpay/tenderdash/proto/tendermint/version" @@ -568,7 +569,7 @@ func cmdFinalizeBlock(cmd *cobra.Command, args []string) error { txs[i] = txBytes } res, err := client.FinalizeBlock(cmd.Context(), &types.RequestFinalizeBlock{ - Height: int64(height), + Height: tmmath.MustConvertInt64(height), Block: &tmproto.Block{ Header: tmproto.Header{AppHash: appHash}, Data: tmproto.Data{Txs: txs}, @@ -837,5 +838,5 @@ func processProposalArgs(args []string) (int64, [][]byte, error) { } txsBytesArray[i] = txBytes } - return int64(height), txsBytesArray, nil + return tmmath.MustConvertInt64(height), txsBytesArray, nil } diff --git a/abci/example/kvstore/kvstore_test.go b/abci/example/kvstore/kvstore_test.go index 93b044a4c..0df4f3402 100644 --- a/abci/example/kvstore/kvstore_test.go +++ b/abci/example/kvstore/kvstore_test.go @@ -19,6 +19,7 @@ import ( tmcrypto "github.com/dashpay/tenderdash/crypto" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/libs/service" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" pbversion "github.com/dashpay/tenderdash/proto/tendermint/version" @@ -51,7 +52,7 @@ func testKVStore(ctx context.Context, t *testing.T, app types.Application, tx [] reqProcess := &types.RequestProcessProposal{ Txs: [][]byte{tx}, Height: height, - Version: &pbversion.Consensus{App: uint64(height)}, + Version: &pbversion.Consensus{App: tmmath.MustConvertUint64(height)}, } respProcess, err := app.ProcessProposal(ctx, reqProcess) require.NoError(t, err) @@ -290,7 +291,7 @@ func makeApplyBlock( Hash: hash, Height: height, Txs: txs, - Version: &pbversion.Consensus{App: uint64(height)}, + Version: &pbversion.Consensus{App: tmmath.MustConvertUint64(height)}, }) require.NoError(t, err) require.NotZero(t, respProcessProposal) @@ -415,7 +416,7 @@ func testClient(ctx context.Context, t *testing.T, app abciclient.Client, height rpp, err := app.ProcessProposal(ctx, &types.RequestProcessProposal{ Txs: [][]byte{tx}, Height: height, - Version: &pbversion.Consensus{App: uint64(height)}, + Version: &pbversion.Consensus{App: tmmath.MustConvertUint64(height)}, }) require.NoError(t, err) require.NotZero(t, rpp) @@ -555,7 +556,7 @@ func assertRespInfo(t *testing.T, expectLastBlockHeight int64, expectAppHash tmb LastBlockHeight: expectLastBlockHeight, LastBlockAppHash: expectAppHash, Version: version.ABCIVersion, - AppVersion: uint64(expectLastBlockHeight + 1), + AppVersion: tmmath.MustConvertUint64(expectLastBlockHeight + 1), Data: fmt.Sprintf(`{"appHash":"%s"}`, expectAppHash.String()), } diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index a7fd87668..b24c9eaa6 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -17,7 +17,7 @@ import ( "github.com/dashpay/tenderdash/internal/jsontypes" // necessary for Bitcoin address format - "golang.org/x/crypto/ripemd160" //nolint:staticcheck,deprecated + "golang.org/x/crypto/ripemd160" //nolint:staticcheck,deprecated,#nosec:G507 ) // ------------------------------------- diff --git a/internal/blocksync/reactor_test.go b/internal/blocksync/reactor_test.go index 197f2993b..8d50a2d1a 100644 --- a/internal/blocksync/reactor_test.go +++ b/internal/blocksync/reactor_test.go @@ -27,6 +27,7 @@ import ( "github.com/dashpay/tenderdash/internal/store" "github.com/dashpay/tenderdash/internal/test/factory" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/types" ) @@ -419,9 +420,11 @@ func TestReactor_BadBlockStopsPeer(t *testing.T) { // XXX: This causes a potential race condition. // See: https://github.com/tendermint/tendermint/issues/6005 otherGenDoc, otherPrivVals := factory.RandGenesisDoc(1, factory.ConsensusParams()) + newNode := rts.network.MakeNode(ctx, t, nil, p2ptest.NodeOptions{ - MaxPeers: uint16(len(rts.nodes) + 1), - MaxConnected: uint16(len(rts.nodes) + 1), + + MaxPeers: tmmath.MustConvertUint16(len(rts.nodes) + 1), + MaxConnected: tmmath.MustConvertUint16(len(rts.nodes) + 1), ChanDescr: p2p.ChannelDescriptors(cfg), }) rts.addNode(ctx, t, newNode.NodeID, otherGenDoc, otherPrivVals[0], maxBlockHeight) diff --git a/internal/consensus/wal_test.go b/internal/consensus/wal_test.go index fbbda477d..190764830 100644 --- a/internal/consensus/wal_test.go +++ b/internal/consensus/wal_test.go @@ -18,6 +18,7 @@ import ( "github.com/dashpay/tenderdash/internal/consensus/types" "github.com/dashpay/tenderdash/internal/libs/autofile" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" tmtime "github.com/dashpay/tenderdash/libs/time" tmtypes "github.com/dashpay/tenderdash/types" ) @@ -156,7 +157,7 @@ func TestWALWriteCommit(t *testing.T) { // Prepare and write commit msg height := rand.Int63() stateID := tmtypes.RandStateID() - stateID.Height = uint64(height) + stateID.Height = tmmath.MustConvertUint64(height) blockID := tmtypes.BlockID{ Hash: crypto.CRandBytes(crypto.HashSize), PartSetHeader: tmtypes.PartSetHeader{ diff --git a/internal/eventlog/cursor/cursor.go b/internal/eventlog/cursor/cursor.go index fc884b6da..a32f7a135 100644 --- a/internal/eventlog/cursor/cursor.go +++ b/internal/eventlog/cursor/cursor.go @@ -92,7 +92,7 @@ func (c *Cursor) UnmarshalText(data []byte) error { return fmt.Errorf("invalid sequence: %w", err) } c.timestamp = ts - c.sequence = uint16(sn) + c.sequence = tmmath.MustConvertUint16(sn) return nil } diff --git a/internal/mempool/mempool_bench_test.go b/internal/mempool/mempool_bench_test.go index bf79d3259..c57c34ca8 100644 --- a/internal/mempool/mempool_bench_test.go +++ b/internal/mempool/mempool_bench_test.go @@ -12,6 +12,7 @@ import ( abciclient "github.com/dashpay/tenderdash/abci/client" "github.com/dashpay/tenderdash/abci/example/kvstore" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" ) func BenchmarkTxMempool_CheckTx(b *testing.B) { @@ -43,7 +44,7 @@ func BenchmarkTxMempool_CheckTx(b *testing.B) { priority := int64(rng.Intn(9999-1000) + 1000) tx := []byte(fmt.Sprintf("sender-%d-%d=%X=%d", n, peerID, prefix, priority)) - txInfo := TxInfo{SenderID: uint16(peerID)} + txInfo := TxInfo{SenderID: tmmath.MustConvertUint16(peerID)} b.StartTimer() diff --git a/internal/p2p/address.go b/internal/p2p/address.go index 45224f506..a4bd1a5f6 100644 --- a/internal/p2p/address.go +++ b/internal/p2p/address.go @@ -10,6 +10,7 @@ import ( "strconv" "strings" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/types" ) @@ -74,7 +75,7 @@ func ParseNodeAddress(urlString string) (NodeAddress, error) { if err != nil { return NodeAddress{}, fmt.Errorf("invalid port %q: %w", portString, err) } - address.Port = uint16(port64) + address.Port = tmmath.MustConvertUint16(port64) } address.Path = url.Path diff --git a/internal/p2p/rqueue.go b/internal/p2p/rqueue.go index a46eefe50..d1f380a37 100644 --- a/internal/p2p/rqueue.go +++ b/internal/p2p/rqueue.go @@ -7,6 +7,8 @@ import ( "time" "github.com/gogo/protobuf/proto" + + "github.com/dashpay/tenderdash/libs/math" ) type simpleQueue struct { @@ -48,7 +50,7 @@ func (q *simpleQueue) run(ctx context.Context) { var chPriorities = make(map[ChannelID]uint, len(q.chDescs)) for _, chDesc := range q.chDescs { chID := chDesc.ID - chPriorities[chID] = uint(chDesc.Priority) + chPriorities[chID] = chDesc.Priority } pq := make(priorityQueue, 0, q.maxSize) @@ -68,7 +70,7 @@ func (q *simpleQueue) run(ctx context.Context) { // enqueue the incoming Envelope heap.Push(&pq, &pqEnvelope{ envelope: e, - size: uint(proto.Size(e.Message)), + size: math.MustConvertUint(proto.Size(e.Message)), priority: chPriorities[e.ChannelID], timestamp: time.Now().UTC(), }) diff --git a/internal/p2p/transport_mconn.go b/internal/p2p/transport_mconn.go index 3757f8f7d..156daf740 100644 --- a/internal/p2p/transport_mconn.go +++ b/internal/p2p/transport_mconn.go @@ -17,6 +17,7 @@ import ( "github.com/dashpay/tenderdash/internal/libs/protoio" "github.com/dashpay/tenderdash/internal/p2p/conn" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" p2pproto "github.com/dashpay/tenderdash/proto/tendermint/p2p" "github.com/dashpay/tenderdash/types" ) @@ -96,7 +97,7 @@ func (m *MConnTransport) Endpoint() (*Endpoint, error) { } if addr, ok := m.listener.Addr().(*net.TCPAddr); ok { endpoint.IP = addr.IP - endpoint.Port = uint16(addr.Port) + endpoint.Port = tmmath.MustConvertUint16(addr.Port) } return endpoint, nil } @@ -488,7 +489,7 @@ func (c *mConnConnection) LocalEndpoint() Endpoint { } if addr, ok := c.conn.LocalAddr().(*net.TCPAddr); ok { endpoint.IP = addr.IP - endpoint.Port = uint16(addr.Port) + endpoint.Port = tmmath.MustConvertUint16(addr.Port) } return endpoint } @@ -500,7 +501,7 @@ func (c *mConnConnection) RemoteEndpoint() Endpoint { } if addr, ok := c.conn.RemoteAddr().(*net.TCPAddr); ok { endpoint.IP = addr.IP - endpoint.Port = uint16(addr.Port) + endpoint.Port = tmmath.MustConvertUint16(addr.Port) } return endpoint } diff --git a/internal/rpc/core/abci.go b/internal/rpc/core/abci.go index 5de75ea5e..04f6529c1 100644 --- a/internal/rpc/core/abci.go +++ b/internal/rpc/core/abci.go @@ -5,6 +5,7 @@ import ( abci "github.com/dashpay/tenderdash/abci/types" "github.com/dashpay/tenderdash/internal/proxy" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/rpc/coretypes" ) @@ -14,7 +15,7 @@ func (env *Environment) ABCIQuery(ctx context.Context, req *coretypes.RequestABC resQuery, err := env.ProxyApp.Query(ctx, &abci.RequestQuery{ Path: req.Path, Data: req.Data, - Height: int64(req.Height), + Height: tmmath.MustConvertInt64(req.Height), Prove: req.Prove, }) if err != nil { diff --git a/internal/state/test/factory/block.go b/internal/state/test/factory/block.go index e6d25549b..f3a5c67c6 100644 --- a/internal/state/test/factory/block.go +++ b/internal/state/test/factory/block.go @@ -14,6 +14,7 @@ import ( "github.com/dashpay/tenderdash/crypto" sm "github.com/dashpay/tenderdash/internal/state" "github.com/dashpay/tenderdash/internal/test/factory" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/types" ) @@ -39,7 +40,7 @@ func MakeBlocks(ctx context.Context, t *testing.T, n int, state *sm.State, privV // update state appHash := make([]byte, crypto.DefaultAppHashSize) - binary.BigEndian.PutUint64(appHash, uint64(height)) + binary.BigEndian.PutUint64(appHash, tmmath.MustConvertUint64(height)) changes, err := state.NewStateChangeset(ctx, sm.RoundParams{AppHash: appHash}) require.NoError(t, err) err = changes.UpdateState(state) diff --git a/internal/statesync/dispatcher.go b/internal/statesync/dispatcher.go index 6539285fe..25c492a29 100644 --- a/internal/statesync/dispatcher.go +++ b/internal/statesync/dispatcher.go @@ -10,6 +10,7 @@ import ( "github.com/dashpay/tenderdash/internal/p2p" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/light/provider" ssproto "github.com/dashpay/tenderdash/proto/tendermint/statesync" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" @@ -106,7 +107,7 @@ func (d *Dispatcher) dispatch(ctx context.Context, peer types.NodeID, height int if err := d.requestCh.Send(ctx, p2p.Envelope{ To: peer, Message: &ssproto.LightBlockRequest{ - Height: uint64(height), + Height: tmmath.MustConvertUint64(height), }, }); err != nil { close(ch) diff --git a/internal/statesync/reactor.go b/internal/statesync/reactor.go index e31088ff4..e0a692119 100644 --- a/internal/statesync/reactor.go +++ b/internal/statesync/reactor.go @@ -22,6 +22,7 @@ import ( sm "github.com/dashpay/tenderdash/internal/state" "github.com/dashpay/tenderdash/internal/store" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/libs/service" "github.com/dashpay/tenderdash/light/provider" ssproto "github.com/dashpay/tenderdash/proto/tendermint/statesync" @@ -848,7 +849,7 @@ func (r *Reactor) handleParamsMessage(ctx context.Context, envelope *p2p.Envelop switch msg := envelope.Message.(type) { case *ssproto.ParamsRequest: r.logger.Debug("received consensus params request", "height", msg.Height) - cp, err := r.stateStore.LoadConsensusParams(int64(msg.Height)) + cp, err := r.stateStore.LoadConsensusParams(tmmath.MustConvertInt64(msg.Height)) if err != nil { r.logger.Error("failed to fetch requested consensus params", "height", msg.Height, @@ -1077,7 +1078,7 @@ func (r *Reactor) recentSnapshots(ctx context.Context, n uint32) ([]*snapshot, e // fetchLightBlock works out whether the node has a light block at a particular // height and if so returns it so it can be gossiped to peers func (r *Reactor) fetchLightBlock(height uint64) (*types.LightBlock, error) { - h := int64(height) + h := tmmath.MustConvertInt64(height) blockMeta := r.blockStore.LoadBlockMeta(h) if blockMeta == nil { diff --git a/internal/statesync/repo.go b/internal/statesync/repo.go index 900524e44..1749a3110 100644 --- a/internal/statesync/repo.go +++ b/internal/statesync/repo.go @@ -10,6 +10,7 @@ import ( sm "github.com/dashpay/tenderdash/internal/state" "github.com/dashpay/tenderdash/internal/store" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/types" ) @@ -22,7 +23,7 @@ type LightBlockRepository struct { // Get works out whether the node has a light block at a particular // height and if so returns it so it can be gossiped to peers func (r *LightBlockRepository) Get(height uint64) (*types.LightBlock, error) { - h := int64(height) + h := tmmath.MustConvertInt64(height) blockMeta := r.blockStore.LoadBlockMeta(h) if blockMeta == nil { diff --git a/internal/statesync/stateprovider.go b/internal/statesync/stateprovider.go index 1fe8b93a8..d1866e224 100644 --- a/internal/statesync/stateprovider.go +++ b/internal/statesync/stateprovider.go @@ -17,6 +17,7 @@ import ( sm "github.com/dashpay/tenderdash/internal/state" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/light" lightprovider "github.com/dashpay/tenderdash/light/provider" lighthttp "github.com/dashpay/tenderdash/light/provider/http" @@ -94,7 +95,7 @@ func NewRPCStateProvider( func (s *stateProviderRPC) verifyLightBlockAtHeight(ctx context.Context, height uint64, ts time.Time) (*types.LightBlock, error) { ctx, cancel := context.WithTimeout(ctx, 20*time.Second) defer cancel() - return s.lc.VerifyLightBlockAtHeight(ctx, int64(height), ts) + return s.lc.VerifyLightBlockAtHeight(ctx, tmmath.MustConvertInt64(height), ts) } // AppHash implements part of StateProvider. It calls the application to verify the @@ -235,7 +236,7 @@ func NewP2PStateProvider( func (s *stateProviderP2P) verifyLightBlockAtHeight(ctx context.Context, height uint64, ts time.Time) (*types.LightBlock, error) { ctx, cancel := context.WithTimeout(ctx, 20*time.Second) defer cancel() - return s.lc.VerifyLightBlockAtHeight(ctx, int64(height), ts) + return s.lc.VerifyLightBlockAtHeight(ctx, tmmath.MustConvertInt64(height), ts) } // AppHash implements StateProvider. @@ -368,7 +369,7 @@ func (s *stateProviderP2P) consensusParams(ctx context.Context, height int64) (t if err := s.paramsSendCh.Send(ctx, p2p.Envelope{ To: peer, Message: &ssproto.ParamsRequest{ - Height: uint64(height), + Height: tmmath.MustConvertUint64(height), }, }); err != nil { // this only errors if diff --git a/internal/statesync/syncer.go b/internal/statesync/syncer.go index 24ce2eb0a..ec6dc6a50 100644 --- a/internal/statesync/syncer.go +++ b/internal/statesync/syncer.go @@ -16,6 +16,7 @@ import ( sm "github.com/dashpay/tenderdash/internal/state" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/light" ssproto "github.com/dashpay/tenderdash/proto/tendermint/statesync" "github.com/dashpay/tenderdash/types" @@ -215,7 +216,7 @@ func (s *syncer) SyncAny( switch { case err == nil: s.metrics.SnapshotHeight.Set(float64(snapshot.Height)) - s.lastSyncedSnapshotHeight = int64(snapshot.Height) + s.lastSyncedSnapshotHeight = tmmath.MustConvertInt64(snapshot.Height) return newState, commit, nil case errors.Is(err, errAbort): @@ -595,7 +596,7 @@ func (s *syncer) verifyApp(ctx context.Context, snapshot *snapshot, appVersion u return errVerifyFailed } - if uint64(resp.LastBlockHeight) != snapshot.Height { + if tmmath.MustConvertUint64(resp.LastBlockHeight) != snapshot.Height { s.logger.Error( "ABCI app reported unexpected last block height", "expected", snapshot.Height, diff --git a/internal/test/factory/commit.go b/internal/test/factory/commit.go index d93898552..1055ee03f 100644 --- a/internal/test/factory/commit.go +++ b/internal/test/factory/commit.go @@ -3,6 +3,7 @@ package factory import ( "context" + tmmath "github.com/dashpay/tenderdash/libs/math" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" ) @@ -24,7 +25,7 @@ func MakeCommit( } vote := &types.Vote{ ValidatorProTxHash: proTxHash, - ValidatorIndex: int32(i), + ValidatorIndex: tmmath.MustConvertInt32(i), Height: height, Round: round, Type: tmproto.PrecommitType, diff --git a/internal/test/factory/vote.go b/internal/test/factory/vote.go index 7a5110858..b21453228 100644 --- a/internal/test/factory/vote.go +++ b/internal/test/factory/vote.go @@ -3,6 +3,7 @@ package factory import ( "context" + "github.com/dashpay/tenderdash/libs/math" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" ) @@ -28,7 +29,7 @@ func MakeVote( ValidatorIndex: valIndex, Height: height, Round: round, - Type: tmproto.SignedMsgType(step), + Type: tmproto.SignedMsgType(math.MustConvertInt32(step)), BlockID: blockID, } diff --git a/libs/math/safemath.go b/libs/math/safemath.go index ac555d075..7e25ded92 100644 --- a/libs/math/safemath.go +++ b/libs/math/safemath.go @@ -164,6 +164,10 @@ func MustConvertInt16[T Integer](a T) int16 { return MustConvert[T, int16](a) } +func MustConvertUint8[T Integer](a T) uint8 { + return MustConvert[T, uint8](a) +} + func MustConvertUint[T Integer](a T) uint { return MustConvert[T, uint](a) } diff --git a/libs/promise/promise_test.go b/libs/promise/promise_test.go index 4915bebe8..1e75f0434 100644 --- a/libs/promise/promise_test.go +++ b/libs/promise/promise_test.go @@ -49,7 +49,7 @@ func TestThen(t *testing.T) { T message[int] M message[string] ) - promise := New[T](func(resolve func(data T), reject func(err error)) { + promise := New[T](func(resolve func(data T), _ func(err error)) { resolve(T{val: 100}) }) wrappedPromise := Then[T, M](promise, func(msg T) M { diff --git a/libs/workerpool/worker_pool.go b/libs/workerpool/worker_pool.go index 97312ab77..80d1758dc 100644 --- a/libs/workerpool/worker_pool.go +++ b/libs/workerpool/worker_pool.go @@ -8,6 +8,7 @@ import ( sync "github.com/sasha-s/go-deadlock" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" ) var ( @@ -92,7 +93,7 @@ func (j *Job) Status() JobStatus { } func (j *Job) SetStatus(status JobStatus) { - j.status.Swap(int32(status)) + j.status.Swap(tmmath.MustConvertInt32(status)) } // WithLogger sets a logger to worker-pool using option function diff --git a/light/proxy/routes.go b/light/proxy/routes.go index 3bc23f125..1741ad5ec 100644 --- a/light/proxy/routes.go +++ b/light/proxy/routes.go @@ -3,6 +3,7 @@ package proxy import ( "context" + tmmath "github.com/dashpay/tenderdash/libs/math" lrpc "github.com/dashpay/tenderdash/light/rpc" rpcclient "github.com/dashpay/tenderdash/rpc/client" "github.com/dashpay/tenderdash/rpc/coretypes" @@ -19,7 +20,7 @@ func (p proxyService) ABCIInfo(_ctx context.Context) (*coretypes.ResultABCIInfo, func (p proxyService) ABCIQuery(ctx context.Context, req *coretypes.RequestABCIQuery) (*coretypes.ResultABCIQuery, error) { return p.Client.ABCIQueryWithOptions(ctx, req.Path, req.Data, rpcclient.ABCIQueryOptions{ - Height: int64(req.Height), + Height: tmmath.MustConvertInt64(req.Height), Prove: req.Prove, }) } @@ -89,7 +90,7 @@ func (p proxyService) Genesis(ctx context.Context) (*coretypes.ResultGenesis, er } func (p proxyService) GenesisChunked(ctx context.Context, req *coretypes.RequestGenesisChunked) (*coretypes.ResultGenesisChunk, error) { - return p.Client.GenesisChunked(ctx, uint(req.Chunk)) + return p.Client.GenesisChunked(ctx, tmmath.MustConvertUint(req.Chunk)) } func (p proxyService) GetConsensusState(ctx context.Context) (*coretypes.ResultConsensusState, error) { diff --git a/light/rpc/client.go b/light/rpc/client.go index af282d6fa..301b5a751 100644 --- a/light/rpc/client.go +++ b/light/rpc/client.go @@ -577,7 +577,7 @@ func (c *Client) Validators( } skipCount := validateSkipCount(page, perPage) - v := l.ValidatorSet.Validators[skipCount : skipCount+tmmath.MinInt(int(perPage), totalCount-skipCount)] + v := l.ValidatorSet.Validators[skipCount : skipCount+tmmath.MinInt(tmmath.MustConvertInt(perPage), totalCount-skipCount)] var ( thresholdPublicKey crypto.PubKey quorumHash crypto.QuorumHash @@ -700,7 +700,7 @@ func validatePage(pagePtr *int, perPage uint, totalCount int) (int, error) { return 1, nil } - pages := ((totalCount - 1) / int(perPage)) + 1 + pages := ((totalCount - 1) / tmmath.MustConvertInt(perPage)) + 1 if pages == 0 { pages = 1 // one page (even if it's empty) } @@ -727,7 +727,7 @@ func validatePerPage(perPagePtr *int) uint { } func validateSkipCount(page int, perPage uint) int { - skipCount := (page - 1) * int(perPage) + skipCount := (page - 1) * tmmath.MustConvertInt(perPage) if skipCount < 0 { return 0 } diff --git a/privval/dash_consensus_key.go b/privval/dash_consensus_key.go index 60a976c8b..b9f26f5b1 100644 --- a/privval/dash_consensus_key.go +++ b/privval/dash_consensus_key.go @@ -22,7 +22,7 @@ var _ tmcrypto.PrivKey = &dashConsensusPrivateKey{} func (key dashConsensusPrivateKey) Bytes() []byte { quorumType := make([]byte, 8) - binary.LittleEndian.PutUint64(quorumType, uint64(key.quorumType)) + binary.LittleEndian.PutUint64(quorumType, uint64(key.quorumType)) //#nosec:G115 ourType := key.TypeTag() bytes := make([]byte, len(key.quorumHash)+len(ourType)+8) diff --git a/privval/file_test.go b/privval/file_test.go index ef51f6248..0213e8341 100644 --- a/privval/file_test.go +++ b/privval/file_test.go @@ -17,6 +17,7 @@ import ( "github.com/dashpay/tenderdash/crypto" "github.com/dashpay/tenderdash/crypto/bls12381" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" tmrand "github.com/dashpay/tenderdash/libs/rand" tmtime "github.com/dashpay/tenderdash/libs/time" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" @@ -351,7 +352,7 @@ func TestVoteExtensionsAreAlwaysSigned(t *testing.T) { height, round := int64(10), int32(1) stateID := types.RandStateID() - stateID.Height = uint64(height) + stateID.Height = tmmath.MustConvertUint64(height) blockID := types.BlockID{ Hash: tmrand.Bytes(crypto.HashSize), PartSetHeader: types.PartSetHeader{Total: 5, Hash: tmrand.Bytes(crypto.HashSize)}, diff --git a/privval/grpc/client.go b/privval/grpc/client.go index 99ba6506d..db7510a0f 100644 --- a/privval/grpc/client.go +++ b/privval/grpc/client.go @@ -13,6 +13,7 @@ import ( "github.com/dashpay/tenderdash/crypto/encoding" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" privvalproto "github.com/dashpay/tenderdash/proto/tendermint/privval" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" @@ -138,7 +139,7 @@ func (sc *SignerClient) SignVote( return fmt.Errorf("quorum hash must be 32 bytes long when signing vote") } resp, err := sc.client.SignVote(ctx, &privvalproto.SignVoteRequest{ChainId: sc.chainID, Vote: vote, - QuorumType: int32(quorumType), QuorumHash: quorumHash}) + QuorumType: tmmath.MustConvertInt32(quorumType), QuorumHash: quorumHash}) if err != nil { errStatus, _ := status.FromError(err) sc.logger.Error("Client SignVote", "err", errStatus.Message()) @@ -156,7 +157,7 @@ func (sc *SignerClient) SignProposal( ) (tmbytes.HexBytes, error) { resp, err := sc.client.SignProposal( ctx, &privvalproto.SignProposalRequest{ChainId: chainID, Proposal: proposal, - QuorumType: int32(quorumType), QuorumHash: quorumHash}) + QuorumType: tmmath.MustConvertInt32(quorumType), QuorumHash: quorumHash}) if err != nil { errStatus, _ := status.FromError(err) diff --git a/privval/secret_connection.go b/privval/secret_connection.go index 309512580..018312192 100644 --- a/privval/secret_connection.go +++ b/privval/secret_connection.go @@ -216,7 +216,7 @@ func (sc *SecretConnection) Write(data []byte) (n int, err error) { data = nil } chunkLength := len(chunk) - binary.LittleEndian.PutUint32(frame, uint32(chunkLength)) + binary.LittleEndian.PutUint32(frame, uint32(chunkLength)) //#nosec:G115 copy(frame[dataLenSize:], chunk) // encrypt the frame diff --git a/privval/signer_client.go b/privval/signer_client.go index dbc00b659..eabcb7bb3 100644 --- a/privval/signer_client.go +++ b/privval/signer_client.go @@ -12,6 +12,7 @@ import ( "github.com/dashpay/tenderdash/crypto/encoding" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" privvalproto "github.com/dashpay/tenderdash/proto/tendermint/privval" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" @@ -190,7 +191,7 @@ func (sc *SignerClient) SignVote( voteRequest := privvalproto.SignVoteRequest{ Vote: vote, ChainId: chainID, - QuorumType: int32(quorumType), + QuorumType: tmmath.MustConvertInt32(quorumType), QuorumHash: quorumHash, } @@ -222,7 +223,7 @@ func (sc *SignerClient) SignProposal( ) (tmbytes.HexBytes, error) { response, err := sc.endpoint.SendRequest(ctx, mustWrapMsg( &privvalproto.SignProposalRequest{Proposal: proposal, ChainId: chainID, - QuorumType: int32(quorumType), QuorumHash: quorumHash}, + QuorumType: tmmath.MustConvertInt32(quorumType), QuorumHash: quorumHash}, )) if err != nil { return nil, err diff --git a/rpc/client/evidence_test.go b/rpc/client/evidence_test.go index 5789e6a64..b10229dc6 100644 --- a/rpc/client/evidence_test.go +++ b/rpc/client/evidence_test.go @@ -9,6 +9,7 @@ import ( "github.com/stretchr/testify/require" "github.com/dashpay/tenderdash/crypto" + tmmath "github.com/dashpay/tenderdash/libs/math" tmrand "github.com/dashpay/tenderdash/libs/rand" "github.com/dashpay/tenderdash/privval" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" @@ -56,7 +57,7 @@ func makeEvidences( ) (correct *types.DuplicateVoteEvidence, fakes []*types.DuplicateVoteEvidence) { const height = int64(1) stateID := types.RandStateID() - stateID.Height = uint64(height) + stateID.Height = tmmath.MustConvertUint64(height) vote := types.Vote{ ValidatorProTxHash: val.Key.ProTxHash, diff --git a/rpc/client/http/http.go b/rpc/client/http/http.go index 7708e9619..ccfeaeda2 100644 --- a/rpc/client/http/http.go +++ b/rpc/client/http/http.go @@ -8,6 +8,7 @@ import ( "time" "github.com/dashpay/tenderdash/libs/bytes" + tmmath "github.com/dashpay/tenderdash/libs/math" rpcclient "github.com/dashpay/tenderdash/rpc/client" "github.com/dashpay/tenderdash/rpc/coretypes" jsonrpcclient "github.com/dashpay/tenderdash/rpc/jsonrpc/client" @@ -362,7 +363,7 @@ func (c *baseRPCClient) Genesis(ctx context.Context) (*coretypes.ResultGenesis, func (c *baseRPCClient) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error) { result := new(coretypes.ResultGenesisChunk) if err := c.caller.Call(ctx, "genesis_chunked", &coretypes.RequestGenesisChunked{ - Chunk: coretypes.Int64(id), + Chunk: coretypes.Int64(tmmath.MustConvertInt64(id)), }, result); err != nil { return nil, err } diff --git a/rpc/client/local/local.go b/rpc/client/local/local.go index 6408a377b..091cd250e 100644 --- a/rpc/client/local/local.go +++ b/rpc/client/local/local.go @@ -12,6 +12,7 @@ import ( rpccore "github.com/dashpay/tenderdash/internal/rpc/core" "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + "github.com/dashpay/tenderdash/libs/math" rpcclient "github.com/dashpay/tenderdash/rpc/client" "github.com/dashpay/tenderdash/rpc/coretypes" "github.com/dashpay/tenderdash/types" @@ -154,7 +155,7 @@ func (c *Local) Genesis(ctx context.Context) (*coretypes.ResultGenesis, error) { } func (c *Local) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error) { - return c.env.GenesisChunked(ctx, &coretypes.RequestGenesisChunked{Chunk: coretypes.Int64(id)}) + return c.env.GenesisChunked(ctx, &coretypes.RequestGenesisChunked{Chunk: coretypes.Int64(math.MustConvertInt64(id))}) } func (c *Local) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { @@ -296,7 +297,7 @@ func (c *Local) resubscribe(ctx context.Context, subArgs pubsub.SubscribeArgs) e } attempts++ - timer.Reset((10 << uint(attempts)) * time.Millisecond) // 10ms -> 20ms -> 40ms + timer.Reset((10 << math.MustConvertUint(attempts)) * time.Millisecond) // 10ms -> 20ms -> 40ms select { case <-timer.C: continue diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index b9abd895a..949e258f6 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -19,6 +19,7 @@ import ( abci "github.com/dashpay/tenderdash/abci/types" "github.com/dashpay/tenderdash/crypto" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" types1 "github.com/dashpay/tenderdash/proto/tendermint/types" "github.com/dashpay/tenderdash/types" ) @@ -73,7 +74,7 @@ func NewApplication(cfg kvstore.Config, opts ...kvstore.OptFunc) (*Application, AppVersion: kvstore.ProtocolVersion, }, } - app.AddConsensusParamsUpdate(params, int64(height)) + app.AddConsensusParamsUpdate(params, tmmath.MustConvertInt64(height)) } return &app, nil diff --git a/test/e2e/pkg/testnet.go b/test/e2e/pkg/testnet.go index afa6f7a1f..f943977e4 100644 --- a/test/e2e/pkg/testnet.go +++ b/test/e2e/pkg/testnet.go @@ -21,6 +21,7 @@ import ( "github.com/dashpay/tenderdash/crypto/ed25519" "github.com/dashpay/tenderdash/crypto/secp256k1" "github.com/dashpay/tenderdash/dash/llmq" + tmmath "github.com/dashpay/tenderdash/libs/math" rpchttp "github.com/dashpay/tenderdash/rpc/client/http" "github.com/dashpay/tenderdash/types" ) @@ -379,7 +380,7 @@ func LoadTestnet(file string) (*Testnet, error) { // Set up validator updates. for _, height := range heights { - heightStr := strconv.FormatInt(int64(height), 10) + heightStr := strconv.FormatInt(tmmath.MustConvertInt64(height), 10) validators := manifest.ValidatorUpdates[heightStr] valUpdate := ValidatorsMap{} proTxHashes := make([]crypto.ProTxHash, 0, len(validators)) @@ -395,7 +396,7 @@ func LoadTestnet(file string) (*Testnet, error) { proTxHashes = append(proTxHashes, node.ProTxHash) } - ld = llmq.MustGenerate(proTxHashes, llmq.WithSeed(randomSeed+int64(height))) + ld = llmq.MustGenerate(proTxHashes, llmq.WithSeed(randomSeed+tmmath.MustConvertInt64(height))) quorumHash := quorumHashGen.generate() err = updateNodeParams( @@ -425,9 +426,9 @@ func LoadTestnet(file string) (*Testnet, error) { testnet.ThresholdPublicKey = ld.ThresholdPubKey testnet.Validators = valUpdate } - testnet.ValidatorUpdates[int64(height)] = valUpdate - testnet.ThresholdPublicKeyUpdates[int64(height)] = ld.ThresholdPubKey - testnet.QuorumHashUpdates[int64(height)] = quorumHash + testnet.ValidatorUpdates[tmmath.MustConvertInt64(height)] = valUpdate + testnet.ThresholdPublicKeyUpdates[tmmath.MustConvertInt64(height)] = ld.ThresholdPubKey + testnet.QuorumHashUpdates[tmmath.MustConvertInt64(height)] = quorumHash } chainLockSetHeights := make([]int, 0, len(manifest.ChainLockUpdates)) @@ -444,9 +445,9 @@ func LoadTestnet(file string) (*Testnet, error) { // Set up chainlock updates. for _, height := range chainLockSetHeights { - heightStr := strconv.FormatInt(int64(height), 10) + heightStr := strconv.FormatInt(tmmath.MustConvertInt64(height), 10) chainLockHeight := manifest.ChainLockUpdates[heightStr] - testnet.ChainLockUpdates[int64(height)] = chainLockHeight + testnet.ChainLockUpdates[tmmath.MustConvertInt64(height)] = chainLockHeight fmt.Printf("Set chainlock at height %d / core height is %d\n", height, chainLockHeight) } @@ -455,7 +456,7 @@ func LoadTestnet(file string) (*Testnet, error) { if err != nil { return nil, fmt.Errorf("invalid consensus version update height %q: %w", height, err) } - testnet.ConsensusVersionUpdates[int64(height)] = cpUpdate + testnet.ConsensusVersionUpdates[tmmath.MustConvertInt64(height)] = cpUpdate } return testnet, testnet.Validate() diff --git a/types/block.go b/types/block.go index 798c5c5e6..c086c3083 100644 --- a/types/block.go +++ b/types/block.go @@ -45,6 +45,24 @@ const ( MaxOverheadForBlock int64 = 11 ) +// Height is a type for a block height. +type Height int64 + +// NewHeight returns a new Height. It panics if the conversion fails. +func NewHeight[T tmmath.Integer](height T) Height { + return Height(tmmath.MustConvert[T, int64](height)) +} + +// Uint64 converts Height to uint64. It panics if the conversion fails. +func (h Height) Uint64() uint64 { + return tmmath.MustConvertUint64(h) +} + +// Uint64 converts Height to uint64. It panics if the conversion fails. +func (h Height) Int64() int64 { + return tmmath.MustConvertInt64(h) +} + // Block defines the atomic unit of a Tendermint blockchain. type Block struct { mtx sync.Mutex diff --git a/types/block_test.go b/types/block_test.go index bdddf7e92..edeac3de6 100644 --- a/types/block_test.go +++ b/types/block_test.go @@ -23,6 +23,7 @@ import ( "github.com/dashpay/tenderdash/crypto/merkle" tmbytes "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" tmrand "github.com/dashpay/tenderdash/libs/rand" tmtime "github.com/dashpay/tenderdash/libs/time" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" @@ -552,7 +553,7 @@ func TestBlockMaxDataBytes(t *testing.T) { ctx := context.Background() height := int64(math.MaxInt64) stateID := RandStateID() - stateID.Height = uint64(height) + stateID.Height = tmmath.MustConvertUint64(height) commit := randCommit(ctx, t, height, stateID) require.NotNil(t, commit) diff --git a/types/netaddress.go b/types/netaddress.go index 386601fd7..ff749536f 100644 --- a/types/netaddress.go +++ b/types/netaddress.go @@ -11,6 +11,8 @@ import ( "net" "strconv" "time" + + tmmath "github.com/dashpay/tenderdash/libs/math" ) // EmptyNetAddress defines the string representation of an empty NetAddress @@ -46,7 +48,7 @@ func NewNetAddress(id NodeID, addr net.Addr) *NetAddress { } ip := tcpAddr.IP - port := uint16(tcpAddr.Port) + port := tmmath.MustConvertUint16(tcpAddr.Port) na := NewNetAddressIPPort(ip, port) na.ID = id return na diff --git a/types/node_info.go b/types/node_info.go index f7d54296e..86ae4c7bd 100644 --- a/types/node_info.go +++ b/types/node_info.go @@ -11,7 +11,7 @@ import ( tmstrings "github.com/dashpay/tenderdash/internal/libs/strings" tmsync "github.com/dashpay/tenderdash/internal/libs/sync" "github.com/dashpay/tenderdash/internal/p2p/conn" - "github.com/dashpay/tenderdash/libs/math" + tmmath "github.com/dashpay/tenderdash/libs/math" tmp2p "github.com/dashpay/tenderdash/proto/tendermint/p2p" ) @@ -211,7 +211,7 @@ func (info NodeInfo) ToProto() *tmp2p.NodeInfo { } for _, ch := range info.Channels.ToSlice() { - dni.Channels = append(dni.Channels, uint32(ch)) + dni.Channels = append(dni.Channels, tmmath.MustConvertUint32(ch)) } dni.NodeID = string(info.NodeID) @@ -253,7 +253,7 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) { for _, ch := range pb.Channels { // we need to explicitly validate the channel id, to avoid panics when remote host sends invalid channel id - chID, err := math.SafeConvert[uint32, int32](ch) + chID, err := tmmath.SafeConvert[uint32, int32](ch) if err != nil { return NodeInfo{}, fmt.Errorf("failed to convert channel id %d: %v", ch, err) } @@ -307,7 +307,7 @@ func ParseAddressString(addr string) (*NetAddress, error) { return nil, err } - na := NewNetAddressIPPort(ip, uint16(port)) + na := NewNetAddressIPPort(ip, tmmath.MustConvertUint16(port)) na.ID = id return na, nil diff --git a/types/part_set.go b/types/part_set.go index 044a68358..896880b12 100644 --- a/types/part_set.go +++ b/types/part_set.go @@ -173,7 +173,7 @@ type PartSet struct { // CONTRACT: partSize is greater than zero. func NewPartSetFromData(data []byte, partSize uint32) *PartSet { // divide data into 4kb parts. - total := (uint32(len(data)) + partSize - 1) / partSize + total := (tmmath.MustConvertUint32(len(data)) + partSize - 1) / partSize parts := make([]*Part, total) partsBytes := make([][]byte, total) partsBitArray := bits.NewBitArray(int(total)) diff --git a/types/proposal.go b/types/proposal.go index 8d7aefd38..27cce75b2 100644 --- a/types/proposal.go +++ b/types/proposal.go @@ -14,6 +14,7 @@ import ( "github.com/dashpay/tenderdash/crypto" "github.com/dashpay/tenderdash/internal/libs/protoio" tmbytes "github.com/dashpay/tenderdash/libs/bytes" + tmmath "github.com/dashpay/tenderdash/libs/math" tmtime "github.com/dashpay/tenderdash/libs/time" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" ) @@ -196,9 +197,9 @@ func ProposalBlockSignID( func ProposalRequestID(p *Proposal) []byte { requestIDMessage := []byte("dpproposal") heightByteArray := make([]byte, 8) - binary.LittleEndian.PutUint64(heightByteArray, uint64(p.Height)) + binary.LittleEndian.PutUint64(heightByteArray, tmmath.MustConvertUint64(p.Height)) roundByteArray := make([]byte, 4) - binary.LittleEndian.PutUint32(roundByteArray, uint32(p.Round)) + binary.LittleEndian.PutUint32(roundByteArray, tmmath.MustConvertUint32(p.Round)) requestIDMessage = append(requestIDMessage, heightByteArray...) requestIDMessage = append(requestIDMessage, roundByteArray...) @@ -210,9 +211,9 @@ func ProposalRequestID(p *Proposal) []byte { func ProposalRequestIDProto(p *tmproto.Proposal) []byte { requestIDMessage := []byte("dpproposal") heightByteArray := make([]byte, 8) - binary.LittleEndian.PutUint64(heightByteArray, uint64(p.Height)) + binary.LittleEndian.PutUint64(heightByteArray, tmmath.MustConvertUint64(p.Height)) roundByteArray := make([]byte, 4) - binary.LittleEndian.PutUint32(roundByteArray, uint32(p.Round)) + binary.LittleEndian.PutUint32(roundByteArray, tmmath.MustConvertUint32(p.Round)) requestIDMessage = append(requestIDMessage, heightByteArray...) requestIDMessage = append(requestIDMessage, roundByteArray...) diff --git a/types/quorum_sign_data.go b/types/quorum_sign_data.go index d4d01750e..7885e2d0f 100644 --- a/types/quorum_sign_data.go +++ b/types/quorum_sign_data.go @@ -11,6 +11,7 @@ import ( "github.com/dashpay/tenderdash/crypto" tmbytes "github.com/dashpay/tenderdash/libs/bytes" + "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/proto/tendermint/types" ) @@ -247,7 +248,7 @@ func (i *SignItem) UpdateSignHash(reverse bool) { // fmt.Printf("RequestID: %x + ", blsRequestID) // fmt.Printf("MsgHash: %x\n", blsMessageHash) - blsSignHash := bls.BuildSignHash(uint8(llmqType), blsQuorumHash, blsRequestID, blsMessageHash) + blsSignHash := bls.BuildSignHash(math.MustConvertUint8(llmqType), blsQuorumHash, blsRequestID, blsMessageHash) signHash := make([]byte, 32) copy(signHash, blsSignHash[:]) diff --git a/types/test_util.go b/types/test_util.go index 0418d1f08..7523642ef 100644 --- a/types/test_util.go +++ b/types/test_util.go @@ -6,6 +6,7 @@ import ( "math/rand" "github.com/dashpay/tenderdash/crypto" + tmmath "github.com/dashpay/tenderdash/libs/math" tmrand "github.com/dashpay/tenderdash/libs/rand" tmtime "github.com/dashpay/tenderdash/libs/time" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" @@ -19,7 +20,7 @@ func RandStateID() tmproto.StateID { AppHash: tmrand.Bytes(crypto.DefaultAppHashSize), AppVersion: StateIDVersion, CoreChainLockedHeight: rand.Uint32(), //nolint:gosec - Time: uint64(tmtime.Now().UnixMilli()), + Time: tmmath.MustConvertUint64(tmtime.Now().UnixMilli()), } } @@ -40,7 +41,7 @@ func makeCommit( } vote := &Vote{ ValidatorProTxHash: proTxHash, - ValidatorIndex: int32(i), + ValidatorIndex: tmmath.MustConvertInt32(i), Height: height, Round: round, Type: tmproto.PrecommitType, diff --git a/types/validation.go b/types/validation.go index 4e4f39f69..0793df375 100644 --- a/types/validation.go +++ b/types/validation.go @@ -8,6 +8,7 @@ import ( "github.com/dashpay/tenderdash/crypto" "github.com/dashpay/tenderdash/crypto/bls12381" "github.com/dashpay/tenderdash/crypto/ed25519" + tmmath "github.com/dashpay/tenderdash/libs/math" ) // ValidateHash returns an error if the hash is not empty, but its @@ -58,7 +59,7 @@ func checkTimely(timestamp time.Time, recvTime time.Time, sp SynchronyParams, ro // proceed in the case that the chosen value was too small for the given network conditions. // For more information and discussion on this mechanism, see the relevant github issue: // https://github.com/tendermint/spec/issues/371 - maxShift := bits.LeadingZeros64(uint64(sp.MessageDelay)) - 1 + maxShift := bits.LeadingZeros64(tmmath.MustConvertUint64(sp.MessageDelay)) - 1 nShift := int((round / 10)) if nShift > maxShift { diff --git a/types/validator_address.go b/types/validator_address.go index caa74ecd1..42e9a2704 100644 --- a/types/validator_address.go +++ b/types/validator_address.go @@ -11,6 +11,7 @@ import ( "strconv" "strings" + tmmath "github.com/dashpay/tenderdash/libs/math" tmrand "github.com/dashpay/tenderdash/libs/rand" ) @@ -87,7 +88,7 @@ func parseValidatorAddressString(urlString string) (ValidatorAddress, error) { if err != nil { return ValidatorAddress{}, fmt.Errorf("invalid port %q: %w", portString, err) } - address.Port = uint16(port64) + address.Port = tmmath.MustConvertUint16(port64) } return address, nil diff --git a/types/vote.go b/types/vote.go index ea844a1a4..ad9f5ac43 100644 --- a/types/vote.go +++ b/types/vote.go @@ -12,6 +12,7 @@ import ( "github.com/dashpay/tenderdash/crypto" "github.com/dashpay/tenderdash/crypto/bls12381" tmbytes "github.com/dashpay/tenderdash/libs/bytes" + tmmath "github.com/dashpay/tenderdash/libs/math" tmcons "github.com/dashpay/tenderdash/proto/tendermint/consensus" tmproto "github.com/dashpay/tenderdash/proto/tendermint/types" ) @@ -372,9 +373,9 @@ func VoteBlockRequestIDProto(vote *tmproto.Vote) []byte { func heightRoundRequestID(prefix string, height int64, round int32) []byte { reqID := []byte(prefix) heightBytes := make([]byte, 8) - binary.LittleEndian.PutUint64(heightBytes, uint64(height)) + binary.LittleEndian.PutUint64(heightBytes, tmmath.MustConvertUint64(height)) roundBytes := make([]byte, 4) - binary.LittleEndian.PutUint32(roundBytes, uint32(round)) + binary.LittleEndian.PutUint32(roundBytes, tmmath.MustConvertUint32(round)) reqID = append(reqID, heightBytes...) reqID = append(reqID, roundBytes...) return crypto.Checksum(reqID) From 608b253b620c07d1546ac04432d3409da19a0b3d Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 12:07:20 +0100 Subject: [PATCH 20/27] chore: remove deprecated golancci config statements --- .golangci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f3d129c80..f247dc49f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,14 +47,10 @@ issues: linters-settings: dogsled: max-blank-identifiers: 3 - golint: - min-confidence: 0 goconst: min-len: 5 min-occurrences: 5 ignore-tests: true - maligned: - suggest-new: true misspell: locale: US revive: From 7cf54c971b4f409524bdb53d67736a47d52dd555 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:03:10 +0100 Subject: [PATCH 21/27] chore: fix ripemd150 lint --- crypto/secp256k1/secp256k1.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crypto/secp256k1/secp256k1.go b/crypto/secp256k1/secp256k1.go index b24c9eaa6..6a7a97b3a 100644 --- a/crypto/secp256k1/secp256k1.go +++ b/crypto/secp256k1/secp256k1.go @@ -17,7 +17,9 @@ import ( "github.com/dashpay/tenderdash/internal/jsontypes" // necessary for Bitcoin address format - "golang.org/x/crypto/ripemd160" //nolint:staticcheck,deprecated,#nosec:G507 + //nolint:staticcheck + //#nosec:G507 + "golang.org/x/crypto/ripemd160" ) // ------------------------------------- From 80bdc9a9adcf49c9b057e1dd236544c745582897 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 13:58:55 +0100 Subject: [PATCH 22/27] chore: self review --- cmd/tenderdash/commands/reindex_event.go | 3 ++- internal/p2p/conn/connection.go | 10 ++++++++-- internal/p2p/peermanager_test.go | 3 ++- privval/dash_consensus_key.go | 3 ++- privval/secret_connection.go | 9 +++++++-- rpc/client/http/http.go | 6 +++++- rpc/client/local/local.go | 10 +++++++--- test/e2e/app/app.go | 2 +- test/e2e/runner/setup.go | 2 +- types/block.go | 18 ------------------ types/node_info.go | 6 +++--- 11 files changed, 38 insertions(+), 34 deletions(-) diff --git a/cmd/tenderdash/commands/reindex_event.go b/cmd/tenderdash/commands/reindex_event.go index 55de22105..29d8ff7b6 100644 --- a/cmd/tenderdash/commands/reindex_event.go +++ b/cmd/tenderdash/commands/reindex_event.go @@ -18,6 +18,7 @@ import ( "github.com/dashpay/tenderdash/internal/state/indexer/sink/psql" "github.com/dashpay/tenderdash/internal/store" "github.com/dashpay/tenderdash/libs/log" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/libs/os" "github.com/dashpay/tenderdash/rpc/coretypes" "github.com/dashpay/tenderdash/types" @@ -210,7 +211,7 @@ func eventReIndex(cmd *cobra.Command, args eventReIndexArgs) error { for i := range b.Data.Txs { tr := abcitypes.TxResult{ Height: b.Height, - Index: uint32(i), //#nosec:G115 + Index: tmmath.MustConvertUint32(i), Tx: b.Data.Txs[i], Result: *(r.ProcessProposal.TxResults[i]), } diff --git a/internal/p2p/conn/connection.go b/internal/p2p/conn/connection.go index 5abf0b197..aa75c05eb 100644 --- a/internal/p2p/conn/connection.go +++ b/internal/p2p/conn/connection.go @@ -539,7 +539,13 @@ FOR_LOOP: // received" timestamp above, so we can ignore // this message case *tmp2p.Packet_PacketMsg: - channelID := ChannelID(pkt.PacketMsg.ChannelID) + channelID, err := tmmath.SafeConvert[int32, ChannelID](pkt.PacketMsg.ChannelID) + if err != nil { + c.logger.Debug("Connection failed @ recvRoutine: invalid channel ID", + "conn", c, "err", err, "channelID", pkt.PacketMsg.ChannelID) + c.stopForError(ctx, err) + break FOR_LOOP + } channel, ok := c.channelsIdx[channelID] if pkt.PacketMsg.ChannelID < 0 || pkt.PacketMsg.ChannelID > math.MaxUint8 || !ok || channel == nil { err := fmt.Errorf("unknown channel %X", pkt.PacketMsg.ChannelID) @@ -599,7 +605,7 @@ type ChannelStatus struct { // ----------------------------------------------------------------------------- // ChannelID is an arbitrary channel ID. -type ChannelID int32 +type ChannelID uint16 type ChannelDescriptor struct { ID ChannelID diff --git a/internal/p2p/peermanager_test.go b/internal/p2p/peermanager_test.go index 2f201944c..e564dad9a 100644 --- a/internal/p2p/peermanager_test.go +++ b/internal/p2p/peermanager_test.go @@ -1067,7 +1067,7 @@ func TestPeerManager_Dialed_UpgradeNoEvict(t *testing.T) { func TestPeerManager_Accepted(t *testing.T) { ctx := context.TODO() a := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("a", 40))} - b := p2p.NodeAddress{NodeID: types.NodeID(strings.Repeat("b", 40))} + b := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("b", 40))} c := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("c", 40))} d := p2p.NodeAddress{Protocol: "memory", NodeID: types.NodeID(strings.Repeat("d", 40))} @@ -1088,6 +1088,7 @@ func TestPeerManager_Accepted(t *testing.T) { // Accepting a connection from an unknown peer should work and register it. require.NoError(t, peerManager.Accepted(b.NodeID)) + require.Equal(t, "memory", b.Protocol) require.ElementsMatch(t, []types.NodeID{a.NodeID, b.NodeID}, peerManager.Peers()) // Accepting a connection from a peer that's being dialed should work, and diff --git a/privval/dash_consensus_key.go b/privval/dash_consensus_key.go index b9f26f5b1..755378021 100644 --- a/privval/dash_consensus_key.go +++ b/privval/dash_consensus_key.go @@ -9,6 +9,7 @@ import ( "github.com/dashpay/dashd-go/btcjson" tmcrypto "github.com/dashpay/tenderdash/crypto" + tmmath "github.com/dashpay/tenderdash/libs/math" "github.com/dashpay/tenderdash/types" ) @@ -22,7 +23,7 @@ var _ tmcrypto.PrivKey = &dashConsensusPrivateKey{} func (key dashConsensusPrivateKey) Bytes() []byte { quorumType := make([]byte, 8) - binary.LittleEndian.PutUint64(quorumType, uint64(key.quorumType)) //#nosec:G115 + binary.LittleEndian.PutUint64(quorumType, tmmath.MustConvertUint64(key.quorumType)) ourType := key.TypeTag() bytes := make([]byte, len(key.quorumHash)+len(ourType)+8) diff --git a/privval/secret_connection.go b/privval/secret_connection.go index 018312192..de4685fb3 100644 --- a/privval/secret_connection.go +++ b/privval/secret_connection.go @@ -28,6 +28,7 @@ import ( "github.com/dashpay/tenderdash/crypto/encoding" "github.com/dashpay/tenderdash/internal/libs/async" "github.com/dashpay/tenderdash/internal/libs/protoio" + tmmath "github.com/dashpay/tenderdash/libs/math" tmprivval "github.com/dashpay/tenderdash/proto/tendermint/privval" ) @@ -215,8 +216,12 @@ func (sc *SecretConnection) Write(data []byte) (n int, err error) { chunk = data data = nil } - chunkLength := len(chunk) - binary.LittleEndian.PutUint32(frame, uint32(chunkLength)) //#nosec:G115 + chunkLength, err := tmmath.SafeConvert[int, uint32](len(chunk)) + if err != nil { + return fmt.Errorf("invalid chunk len %d: %w", len(chunk), err) + } + + binary.LittleEndian.PutUint32(frame, chunkLength) copy(frame[dataLenSize:], chunk) // encrypt the frame diff --git a/rpc/client/http/http.go b/rpc/client/http/http.go index ccfeaeda2..13219ddf5 100644 --- a/rpc/client/http/http.go +++ b/rpc/client/http/http.go @@ -362,8 +362,12 @@ func (c *baseRPCClient) Genesis(ctx context.Context) (*coretypes.ResultGenesis, func (c *baseRPCClient) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error) { result := new(coretypes.ResultGenesisChunk) + chunkID, err := tmmath.SafeConvert[uint, int64](id) + if err != nil { + return nil, fmt.Errorf("invalid chunk id %d: %w", id, err) + } if err := c.caller.Call(ctx, "genesis_chunked", &coretypes.RequestGenesisChunked{ - Chunk: coretypes.Int64(tmmath.MustConvertInt64(id)), + Chunk: coretypes.Int64(chunkID), }, result); err != nil { return nil, err } diff --git a/rpc/client/local/local.go b/rpc/client/local/local.go index 091cd250e..2e9514d3f 100644 --- a/rpc/client/local/local.go +++ b/rpc/client/local/local.go @@ -12,7 +12,7 @@ import ( rpccore "github.com/dashpay/tenderdash/internal/rpc/core" "github.com/dashpay/tenderdash/libs/bytes" "github.com/dashpay/tenderdash/libs/log" - "github.com/dashpay/tenderdash/libs/math" + tmmath "github.com/dashpay/tenderdash/libs/math" rpcclient "github.com/dashpay/tenderdash/rpc/client" "github.com/dashpay/tenderdash/rpc/coretypes" "github.com/dashpay/tenderdash/types" @@ -155,7 +155,11 @@ func (c *Local) Genesis(ctx context.Context) (*coretypes.ResultGenesis, error) { } func (c *Local) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error) { - return c.env.GenesisChunked(ctx, &coretypes.RequestGenesisChunked{Chunk: coretypes.Int64(math.MustConvertInt64(id))}) + chunkID, err := tmmath.SafeConvert[uint, int64](id) + if err != nil { + return nil, fmt.Errorf("invalid chunk id %d: %w", id, err) + } + return c.env.GenesisChunked(ctx, &coretypes.RequestGenesisChunked{Chunk: coretypes.Int64(chunkID)}) } func (c *Local) Block(ctx context.Context, height *int64) (*coretypes.ResultBlock, error) { @@ -297,7 +301,7 @@ func (c *Local) resubscribe(ctx context.Context, subArgs pubsub.SubscribeArgs) e } attempts++ - timer.Reset((10 << math.MustConvertUint(attempts)) * time.Millisecond) // 10ms -> 20ms -> 40ms + timer.Reset((10 << tmmath.MustConvertUint(attempts)) * time.Millisecond) // 10ms -> 20ms -> 40ms select { case <-timer.C: continue diff --git a/test/e2e/app/app.go b/test/e2e/app/app.go index 949e258f6..081d5e9d2 100644 --- a/test/e2e/app/app.go +++ b/test/e2e/app/app.go @@ -161,7 +161,7 @@ func (app *Application) VerifyVoteExtension(_ context.Context, req *abci.Request } if app.cfg.VoteExtensionDelayMS != 0 { - time.Sleep(time.Duration(app.cfg.VoteExtensionDelayMS) * time.Millisecond) //#nosec G115 + time.Sleep(time.Duration(tmmath.MustConvertInt(app.cfg.VoteExtensionDelayMS)) * time.Millisecond) } app.logger.Info("verified vote extension value", "req", req, "nums", nums) diff --git a/test/e2e/runner/setup.go b/test/e2e/runner/setup.go index b15302408..1598485f4 100644 --- a/test/e2e/runner/setup.go +++ b/test/e2e/runner/setup.go @@ -441,7 +441,7 @@ func MakeAppConfig(node *e2e.Node) ([]byte, error) { if len(node.Testnet.ConsensusVersionUpdates) > 0 { consensusVersionUpdates := map[string]int32{} for height, version := range node.Testnet.ConsensusVersionUpdates { - consensusVersionUpdates[strconv.Itoa(int(height))] = version //#nosec:G115 + consensusVersionUpdates[strconv.Itoa(int(height))] = version } cfg["consensus_version_updates"] = consensusVersionUpdates } diff --git a/types/block.go b/types/block.go index c086c3083..798c5c5e6 100644 --- a/types/block.go +++ b/types/block.go @@ -45,24 +45,6 @@ const ( MaxOverheadForBlock int64 = 11 ) -// Height is a type for a block height. -type Height int64 - -// NewHeight returns a new Height. It panics if the conversion fails. -func NewHeight[T tmmath.Integer](height T) Height { - return Height(tmmath.MustConvert[T, int64](height)) -} - -// Uint64 converts Height to uint64. It panics if the conversion fails. -func (h Height) Uint64() uint64 { - return tmmath.MustConvertUint64(h) -} - -// Uint64 converts Height to uint64. It panics if the conversion fails. -func (h Height) Int64() int64 { - return tmmath.MustConvertInt64(h) -} - // Block defines the atomic unit of a Tendermint blockchain. type Block struct { mtx sync.Mutex diff --git a/types/node_info.go b/types/node_info.go index 86ae4c7bd..de63418ff 100644 --- a/types/node_info.go +++ b/types/node_info.go @@ -253,11 +253,11 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) { for _, ch := range pb.Channels { // we need to explicitly validate the channel id, to avoid panics when remote host sends invalid channel id - chID, err := tmmath.SafeConvert[uint32, int32](ch) + chID, err := tmmath.SafeConvert[uint32, conn.ChannelID](ch) if err != nil { - return NodeInfo{}, fmt.Errorf("failed to convert channel id %d: %v", ch, err) + return NodeInfo{}, fmt.Errorf("invalid channel id %d: %v", ch, err) } - dni.Channels.Append(conn.ChannelID(chID)) + dni.Channels.Append(chID) } return dni, nil From 3732ec0843ad66f831f90c1f3e613572e19654db Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:42:35 +0100 Subject: [PATCH 23/27] chore: fix some tests --- internal/p2p/conn/connection.go | 6 +++--- internal/p2p/peermanager_test.go | 2 +- internal/p2p/transport_mconn.go | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/p2p/conn/connection.go b/internal/p2p/conn/connection.go index aa75c05eb..ee6074ae5 100644 --- a/internal/p2p/conn/connection.go +++ b/internal/p2p/conn/connection.go @@ -539,14 +539,14 @@ FOR_LOOP: // received" timestamp above, so we can ignore // this message case *tmp2p.Packet_PacketMsg: - channelID, err := tmmath.SafeConvert[int32, ChannelID](pkt.PacketMsg.ChannelID) + channelID, err := tmmath.SafeConvertUint16(pkt.PacketMsg.ChannelID) if err != nil { c.logger.Debug("Connection failed @ recvRoutine: invalid channel ID", "conn", c, "err", err, "channelID", pkt.PacketMsg.ChannelID) c.stopForError(ctx, err) break FOR_LOOP } - channel, ok := c.channelsIdx[channelID] + channel, ok := c.channelsIdx[ChannelID(channelID)] if pkt.PacketMsg.ChannelID < 0 || pkt.PacketMsg.ChannelID > math.MaxUint8 || !ok || channel == nil { err := fmt.Errorf("unknown channel %X", pkt.PacketMsg.ChannelID) c.logger.Debug("Connection failed @ recvRoutine", "conn", c, "err", err) @@ -565,7 +565,7 @@ FOR_LOOP: if msgBytes != nil { // c.logger.Trace("Received bytes", "chID", channelID, "msgBytes", msgBytes) // NOTE: This means the reactor.Receive runs in the same thread as the p2p recv routine - c.onReceive(ctx, channelID, msgBytes) + c.onReceive(ctx, ChannelID(channelID), msgBytes) } default: err := fmt.Errorf("unknown message type %v", reflect.TypeOf(packet)) diff --git a/internal/p2p/peermanager_test.go b/internal/p2p/peermanager_test.go index e564dad9a..04485485f 100644 --- a/internal/p2p/peermanager_test.go +++ b/internal/p2p/peermanager_test.go @@ -1088,7 +1088,7 @@ func TestPeerManager_Accepted(t *testing.T) { // Accepting a connection from an unknown peer should work and register it. require.NoError(t, peerManager.Accepted(b.NodeID)) - require.Equal(t, "memory", b.Protocol) + require.Equal(t, p2p.Protocol("memory"), b.Protocol) require.ElementsMatch(t, []types.NodeID{a.NodeID, b.NodeID}, peerManager.Peers()) // Accepting a connection from a peer that's being dialed should work, and diff --git a/internal/p2p/transport_mconn.go b/internal/p2p/transport_mconn.go index 156daf740..2bb9ca73e 100644 --- a/internal/p2p/transport_mconn.go +++ b/internal/p2p/transport_mconn.go @@ -308,6 +308,7 @@ func (c *mConnConnection) Handshake( // into an error. We should remove panics instead. defer func() { if r := recover(); r != nil { + c.logger.Error("recovered from panic", "panic", r) errCh <- fmt.Errorf("recovered from panic: %v", r) } }() From 0fb6f0653fab74904735d7de978397a80a9aebd1 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 14:46:43 +0100 Subject: [PATCH 24/27] chore: fix some errors --- libs/math/safemath.go | 20 ++++++++++++++++++++ privval/secret_connection.go | 2 +- rpc/client/http/http.go | 2 +- types/node_info.go | 4 ++-- types/node_info_test.go | 2 +- 5 files changed, 25 insertions(+), 5 deletions(-) diff --git a/libs/math/safemath.go b/libs/math/safemath.go index 7e25ded92..54f0b7a4f 100644 --- a/libs/math/safemath.go +++ b/libs/math/safemath.go @@ -96,6 +96,26 @@ func SafeConvertUint32[T Integer](a T) (uint32, error) { return uint32(a), nil } +// SafeConvertUint64 takes a int and checks if it overflows. +func SafeConvertUint64[T Integer](a T) (uint64, error) { + return SafeConvert[T, uint64](a) +} + +// SafeConvertInt64 takes a int and checks if it overflows. +func SafeConvertInt64[T Integer](a T) (int64, error) { + return SafeConvert[T, int64](a) +} + +// SafeConvertInt16 takes a int and checks if it overflows. +func SafeConvertInt16[T Integer](a T) (int16, error) { + return SafeConvert[T, int16](a) +} + +// SafeConvertUint16 takes a int and checks if it overflows. +func SafeConvertUint16[T Integer](a T) (uint16, error) { + return SafeConvert[T, uint16](a) +} + type Integer interface { ~int | ~int8 | ~int16 | ~int32 | ~int64 | ~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 } diff --git a/privval/secret_connection.go b/privval/secret_connection.go index de4685fb3..3961eefc1 100644 --- a/privval/secret_connection.go +++ b/privval/secret_connection.go @@ -216,7 +216,7 @@ func (sc *SecretConnection) Write(data []byte) (n int, err error) { chunk = data data = nil } - chunkLength, err := tmmath.SafeConvert[int, uint32](len(chunk)) + chunkLength, err := tmmath.SafeConvertUint32(len(chunk)) if err != nil { return fmt.Errorf("invalid chunk len %d: %w", len(chunk), err) } diff --git a/rpc/client/http/http.go b/rpc/client/http/http.go index 13219ddf5..375dfb631 100644 --- a/rpc/client/http/http.go +++ b/rpc/client/http/http.go @@ -362,7 +362,7 @@ func (c *baseRPCClient) Genesis(ctx context.Context) (*coretypes.ResultGenesis, func (c *baseRPCClient) GenesisChunked(ctx context.Context, id uint) (*coretypes.ResultGenesisChunk, error) { result := new(coretypes.ResultGenesisChunk) - chunkID, err := tmmath.SafeConvert[uint, int64](id) + chunkID, err := tmmath.SafeConvertInt64(id) if err != nil { return nil, fmt.Errorf("invalid chunk id %d: %w", id, err) } diff --git a/types/node_info.go b/types/node_info.go index de63418ff..fc75f213c 100644 --- a/types/node_info.go +++ b/types/node_info.go @@ -253,11 +253,11 @@ func NodeInfoFromProto(pb *tmp2p.NodeInfo) (NodeInfo, error) { for _, ch := range pb.Channels { // we need to explicitly validate the channel id, to avoid panics when remote host sends invalid channel id - chID, err := tmmath.SafeConvert[uint32, conn.ChannelID](ch) + chID, err := tmmath.SafeConvertUint16(ch) if err != nil { return NodeInfo{}, fmt.Errorf("invalid channel id %d: %v", ch, err) } - dni.Channels.Append(chID) + dni.Channels.Append(conn.ChannelID(chID)) } return dni, nil diff --git a/types/node_info_test.go b/types/node_info_test.go index 587b38c9d..7430d533f 100644 --- a/types/node_info_test.go +++ b/types/node_info_test.go @@ -180,7 +180,7 @@ func TestNodeInfoAddChannel(t *testing.T) { require.Empty(t, nodeInfo.Channels) nodeInfo.AddChannel(2) - require.Contains(t, nodeInfo.Channels.ToSlice(), uint16(2)) + require.Contains(t, nodeInfo.Channels.ToSlice(), conn.ChannelID(2)) // adding the same channel again shouldn't be a problem nodeInfo.AddChannel(2) From 0103d09bfb1e26cf818edec3ff45a58dddfbdba1 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:03:50 +0100 Subject: [PATCH 25/27] chore: fix test --- types/node_info_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/node_info_test.go b/types/node_info_test.go index 7430d533f..d7dfcfdf7 100644 --- a/types/node_info_test.go +++ b/types/node_info_test.go @@ -184,7 +184,7 @@ func TestNodeInfoAddChannel(t *testing.T) { // adding the same channel again shouldn't be a problem nodeInfo.AddChannel(2) - require.Contains(t, nodeInfo.Channels.ToSlice(), uint16(2)) + require.Contains(t, nodeInfo.Channels.ToSlice(), conn.ChannelID(2)) } func TestParseAddressString(t *testing.T) { From 08ed97a6aea1742013a6a7125e66b59ec1e2f086 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:15:00 +0100 Subject: [PATCH 26/27] chore: fix another test --- abci/example/counter/counter.go | 3 ++- types/block.go | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/abci/example/counter/counter.go b/abci/example/counter/counter.go index 51a382a19..05735a45c 100644 --- a/abci/example/counter/counter.go +++ b/abci/example/counter/counter.go @@ -139,6 +139,7 @@ func (app *Application) updateCoreChainLock() { if !app.HasCoreChainLocks { return } - app.CurrentCoreChainLockHeight += tmmath.MustConvertUint32(app.CoreChainLockStep) + // this allows negative CoreChainLockStep, but will panic if it goes below 0 + app.CurrentCoreChainLockHeight = tmmath.MustConvertUint32(int64(app.CurrentCoreChainLockHeight) + int64(app.CoreChainLockStep)) app.lastCoreChainLock = tmtypes.NewMockChainLock(app.CurrentCoreChainLockHeight) } diff --git a/types/block.go b/types/block.go index 798c5c5e6..640199e85 100644 --- a/types/block.go +++ b/types/block.go @@ -547,7 +547,13 @@ func (h *Header) StateID() tmproto.StateID { appHash = make([]byte, crypto.DefaultAppHashSize) } - ts := tmmath.MustConvertUint64(h.Time.UnixMilli()) + var ts uint64 + if h.Time.IsZero() { + ts = 0 + } else { + // this will panic if h.Time is before Unix Epoch, but this should never happen + ts = tmmath.MustConvertUint64(h.Time.UnixMilli()) + } return tmproto.StateID{ AppVersion: h.Version.App, From 0e8ac6f1a0c30d37ee858513a8245f4687bfeb87 Mon Sep 17 00:00:00 2001 From: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Date: Mon, 4 Nov 2024 15:26:17 +0100 Subject: [PATCH 27/27] test: fix some tests --- internal/consensus/state_prevoter_test.go | 2 +- light/client.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/consensus/state_prevoter_test.go b/internal/consensus/state_prevoter_test.go index efd8f7ee0..61f820ba6 100644 --- a/internal/consensus/state_prevoter_test.go +++ b/internal/consensus/state_prevoter_test.go @@ -263,7 +263,7 @@ func (suite *PrevoterTestSuite) TestCheckPrevoteMaj23() { { modifier: func(stateData *StateData) { stateData.Proposal.POLRound = -1 - stateData.Votes = suite.makeHeightVoteSetMaj23(validStateData, -1) + stateData.Votes = suite.makeHeightVoteSetMaj23(validStateData, 0) }, want: false, }, diff --git a/light/client.go b/light/client.go index e2e10487e..0e1faeffa 100644 --- a/light/client.go +++ b/light/client.go @@ -520,6 +520,10 @@ func (c *Client) verifyBlockSignatureWithDashCore(_ctx context.Context, newLight quorumType := newLightBlock.ValidatorSet.QuorumType protoVote := newLightBlock.Commit.GetCanonicalVote().ToProto() + // double-check the block height and round + if protoVote.Height < 0 || protoVote.Round < 0 { + return fmt.Errorf("block height %d and round %d cannot be negative", protoVote.Height, protoVote.Round) + } blockSignBytes, err := protoVote.SignBytes(c.chainID) if err != nil { return err