From cf5766177a507e2a71408f7bc835a26666efeadd Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 28 Jul 2025 16:50:39 +0800 Subject: [PATCH] trie: remove the duplicate write for preimage #23001 (#1068) --- trie/database.go | 6 ------ 1 file changed, 6 deletions(-) diff --git a/trie/database.go b/trie/database.go index 43d5051889..86d1b578ed 100644 --- a/trie/database.go +++ b/trie/database.go @@ -686,12 +686,6 @@ func (db *Database) Commit(node common.Hash, report bool) error { // Move all of the accumulated preimages into a write batch if db.preimages != nil { rawdb.WritePreimages(batch, db.preimages) - if batch.ValueSize() > ethdb.IdealBatchSize { - if err := batch.Write(); err != nil { - return err - } - batch.Reset() - } // Since we're going to replay trie Node writes into the clean Cache, flush out // any batched pre-images before continuing. if err := batch.Write(); err != nil {