diff --git a/.golangci.yml b/.golangci.yml index 816f54be94..450d8bce49 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -15,7 +15,6 @@ linters: - govet - ineffassign - mirror - - tenv - misspell - reassign - revive # only certain checks enabled diff --git a/Makefile b/Makefile index dfe8434fbe..4feb824291 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/core/blockchain.go b/core/blockchain.go index 481173827b..5da3a3143a 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -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 diff --git a/core/filtermaps/chain_view.go b/core/filtermaps/chain_view.go index 874ff19e31..0d9ece005e 100644 --- a/core/filtermaps/chain_view.go +++ b/core/filtermaps/chain_view.go @@ -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