From db9687363f3b44bcedf5d80c081a9cf24d35a65f Mon Sep 17 00:00:00 2001 From: Mohammed Alduhamshi <189298855+Mohammed-Alanazisa@users.noreply.github.com> Date: Fri, 18 Apr 2025 21:25:49 +0300 Subject: [PATCH] Revert "core/filtermaps: make ChainView thread safe (#31671)" This reverts commit 4c9e7d1b187c1b42b7f3218724ad61d1ef9c9019. --- core/filtermaps/chain_view.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/core/filtermaps/chain_view.go b/core/filtermaps/chain_view.go index d6f0a727bf..a8cf53b1c0 100644 --- a/core/filtermaps/chain_view.go +++ b/core/filtermaps/chain_view.go @@ -17,8 +17,6 @@ package filtermaps import ( - "sync" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/log" @@ -41,7 +39,6 @@ type blockchain interface { // of the underlying blockchain, it should only possess the block headers // and receipts up until the expected chain view head. type ChainView struct { - lock sync.Mutex chain blockchain headNumber uint64 hashes []common.Hash // block hashes starting backwards from headNumber until first canonical hash @@ -150,9 +147,6 @@ func (cv *ChainView) extendNonCanonical() bool { // blockHash returns the given block hash without doing the head number check. func (cv *ChainView) blockHash(number uint64) common.Hash { - cv.lock.Lock() - defer cv.lock.Unlock() - if number+uint64(len(cv.hashes)) <= cv.headNumber { hash := cv.chain.GetCanonicalHash(number) if !cv.extendNonCanonical() {