bump golangci to v2 and fixed lints

This commit is contained in:
Pratik Patil 2025-05-22 17:02:11 +05:30
parent 990e128817
commit ef31b7bc03
No known key found for this signature in database
GPG key ID: AFDCA496554874B3
4 changed files with 7 additions and 7 deletions

View file

@ -15,7 +15,6 @@ linters:
- govet
- ineffassign
- mirror
- tenv
- misspell
- reassign
- revive # only certain checks enabled

View file

@ -83,7 +83,7 @@ lint:
lintci-deps:
rm -f ./build/bin/golangci-lint
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v1.63.4
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b ./build/bin v2.1.5
.PHONY: vulncheck

View file

@ -115,10 +115,6 @@ var (
errInvalidNewChain = errors.New("invalid new chain")
)
var (
forkReadyInterval = 3 * time.Minute
)
const (
bodyCacheLimit = 256
blockCacheLimit = 256
@ -849,6 +845,7 @@ func (bc *BlockChain) initializeHistoryPruning(latest uint64) error {
bc.historyPrunePoint.Store(predefinedPoint)
return nil
// nolint:gosimple
case history.KeepPostMerge:
if freezerTail == 0 && latest != 0 {
// This is the case where a user is trying to run with --history.chain

View file

@ -122,10 +122,14 @@ func (cv *ChainView) RawReceipts(number uint64) types.Receipts {
// SharedRange returns the block range shared by two chain views.
func (cv *ChainView) SharedRange(cv2 *ChainView) common.Range[uint64] {
if cv == nil || cv2 == nil {
return common.Range[uint64]{}
}
cv.lock.Lock()
defer cv.lock.Unlock()
if cv == nil || cv2 == nil || !cv.extendNonCanonical() || !cv2.extendNonCanonical() {
if !cv.extendNonCanonical() || !cv2.extendNonCanonical() {
return common.Range[uint64]{}
}
var sharedLen uint64