From 32986bf084f70162442544af4f6e6ca9c8298d42 Mon Sep 17 00:00:00 2001 From: cui Date: Tue, 30 Jun 2026 21:12:06 +0800 Subject: [PATCH] triedb/pathdb: prealloc node map in nodeSet.write (#35232) --- triedb/pathdb/nodes.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/triedb/pathdb/nodes.go b/triedb/pathdb/nodes.go index 62c72c1953..590f7b499d 100644 --- a/triedb/pathdb/nodes.go +++ b/triedb/pathdb/nodes.go @@ -279,7 +279,7 @@ func (s *nodeSet) decode(r *rlp.Stream) error { // write flushes nodes into the provided database batch as a whole. func (s *nodeSet) write(batch ethdb.Batch, clean *fastcache.Cache) int { - nodes := make(map[common.Hash]map[string]*trienode.Node) + nodes := make(map[common.Hash]map[string]*trienode.Node, len(s.storageNodes)+1) if len(s.accountNodes) > 0 { nodes[common.Hash{}] = s.accountNodes }