diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dc848bc..ea7652c1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,8 @@ jobs: lint_test: uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.3.1 with: + go-version: '1.23' + go-lint-version: 'v1.60.2' run-unit-tests: true run-integration-tests: true run-lint: true diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b49b58f6..e96ee865 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,6 +12,8 @@ jobs: lint_test: uses: babylonlabs-io/.github/.github/workflows/reusable_go_lint_test.yml@v0.3.1 with: + go-version: '1.23' + go-lint-version: 'v1.60.2' run-unit-tests: true run-integration-tests: true run-lint: true diff --git a/Dockerfile b/Dockerfile index 449db259..dd8a3271 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ## Image for building -FROM golang:1.21-alpine AS build-env +FROM golang:1.23-alpine AS build-env # TARGETPLATFORM should be one of linux/amd64 or linux/arm64. diff --git a/README.md b/README.md index 5eb1348d..d2f369e9 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ There are four vigilante programs: ## Requirements -- Go 1.21 +- Go 1.23 - Package [libzmq](https://github.com/zeromq/libzmq) - [btcd](https://github.com/btcsuite/btcd/tree/master?tab=readme-ov-file#installation) binaries (only for testing) diff --git a/go.mod b/go.mod index 4db3aa96..7456b18f 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,6 @@ module github.com/babylonlabs-io/vigilante -go 1.21 - -toolchain go1.21.4 +go 1.23 require ( cosmossdk.io/errors v1.0.1 @@ -19,7 +17,6 @@ require ( github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-sdk v0.50.6 github.com/cosmos/relayer/v2 v2.5.1 - github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/gogo/protobuf v1.3.3 github.com/golang/mock v1.6.0 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 @@ -118,6 +115,7 @@ require ( github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect github.com/decred/dcrd/crypto/blake256 v1.0.1 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect github.com/decred/dcrd/lru v1.0.0 // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect diff --git a/monitor/monitor.go b/monitor/monitor.go index a6d13824..e3fd7fff 100644 --- a/monitor/monitor.go +++ b/monitor/monitor.go @@ -197,8 +197,10 @@ func (m *Monitor) GetCurrentEpoch() uint64 { func (m *Monitor) VerifyCheckpoint(btcCkpt *checkpointingtypes.RawCheckpoint) error { // check whether the epoch number of the checkpoint equals to the current epoch number if m.GetCurrentEpoch() != btcCkpt.EpochNum { - return errors.Wrapf(types.ErrInvalidEpochNum, fmt.Sprintf("found a checkpoint with epoch %v, but the monitor expects epoch %v", - btcCkpt.EpochNum, m.GetCurrentEpoch())) + return errors.Wrapf(types.ErrInvalidEpochNum, + "found a checkpoint with epoch %v, but the monitor expects epoch %v", + btcCkpt.EpochNum, m.GetCurrentEpoch()) + } // verify BLS sig of the BTC checkpoint err := m.curEpoch.VerifyMultiSig(btcCkpt) @@ -221,8 +223,9 @@ func (m *Monitor) VerifyCheckpoint(btcCkpt *checkpointingtypes.RawCheckpoint) er } // check whether the checkpoint from Babylon has the same BlockHash of the BTC checkpoint if !ckpt.BlockHash.Equal(*btcCkpt.BlockHash) { - return errors.Wrapf(types.ErrInconsistentBlockHash, fmt.Sprintf("Babylon checkpoint's BlockHash %s, BTC checkpoint's BlockHash %s", - ckpt.BlockHash.String(), btcCkpt.BlockHash)) + return errors.Wrapf(types.ErrInconsistentBlockHash, + "Babylon checkpoint's BlockHash %s, BTC checkpoint's BlockHash %s", + ckpt.BlockHash.String(), btcCkpt.BlockHash) } return nil } diff --git a/tools/go.mod b/tools/go.mod index ce29ae53..6f7f46dc 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -1,8 +1,6 @@ module github.com/babylonlabs-io/vigilante/tools -go 1.21 - -toolchain go1.21.4 +go 1.23 require github.com/babylonlabs-io/babylon v0.9.1 diff --git a/types/epoch_info.go b/types/epoch_info.go index b4d74559..7e2a6121 100644 --- a/types/epoch_info.go +++ b/types/epoch_info.go @@ -2,8 +2,6 @@ package types import ( "bytes" - "fmt" - "github.com/babylonlabs-io/babylon/crypto/bls12381" ckpttypes "github.com/babylonlabs-io/babylon/x/checkpointing/types" "github.com/boljen/go-bitmap" @@ -65,10 +63,10 @@ func (ei *EpochInfo) Equal(epochInfo *EpochInfo) bool { func (ei *EpochInfo) VerifyMultiSig(ckpt *ckpttypes.RawCheckpoint) error { signerKeySet, sumPower, err := ei.GetSignersKeySetWithPowerSum(ckpt.Bitmap) if sumPower*3 <= ei.GetTotalPower()*2 { - return errors.Wrapf(ErrInsufficientPower, fmt.Sprintf("expected to be greater than %v, got %v", ei.GetTotalPower()*2/3, sumPower)) + return errors.Wrapf(ErrInsufficientPower, "expected to be greater than %v, got %v", ei.GetTotalPower()*2/3, sumPower) } if err != nil { - return errors.Wrapf(ErrInvalidMultiSig, fmt.Sprintf("failed to get signer set: %s", err.Error())) + return errors.Wrapf(ErrInvalidMultiSig, "failed to get signer set: %s", err.Error()) } msgBytes := ckpt.SignedMsg() valid, err := bls12381.VerifyMultiSig(*ckpt.BlsMultiSig, signerKeySet, msgBytes)