From c0c31ce7e70827b227af9f3083ce46bab60ae000 Mon Sep 17 00:00:00 2001 From: "Wonyong Kim(Ryan Kim)" Date: Fri, 10 Mar 2023 10:01:49 +0900 Subject: [PATCH] fix(trie): remove locking on updating preimage of zk trie See https://github.com/scroll-tech/go-ethereum/pull/205 for details. --- trie/zk_trie_database.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/trie/zk_trie_database.go b/trie/zk_trie_database.go index 7c2a00c56e..455cd87e8c 100644 --- a/trie/zk_trie_database.go +++ b/trie/zk_trie_database.go @@ -69,12 +69,10 @@ func (l *ZktrieDatabase) Get(key []byte) ([]byte, error) { func (l *ZktrieDatabase) UpdatePreimage(preimage []byte, hashField *big.Int) { db := l.db if db.preimages != nil { // Ugly direct check but avoids the below write lock - db.lock.Lock() // we must copy the input key preimages := make(map[common.Hash][]byte) preimages[common.BytesToHash(hashField.Bytes())] = common.CopyBytes(preimage) db.preimages.insertPreimage(preimages) - db.lock.Unlock() } }