From 4c0029282b064458b14017c7412ecb51bd616b17 Mon Sep 17 00:00:00 2001 From: maskpp Date: Tue, 3 Jun 2025 22:18:43 +0800 Subject: [PATCH] Clone secKeyCache to a new stateTrie instance --- trie/secure_trie.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/trie/secure_trie.go b/trie/secure_trie.go index e78e2d5ab2..3462b03293 100644 --- a/trie/secure_trie.go +++ b/trie/secure_trie.go @@ -17,6 +17,8 @@ package trie import ( + "maps" + "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" @@ -273,7 +275,7 @@ func (t *StateTrie) Copy() *StateTrie { return &StateTrie{ trie: *t.trie.Copy(), db: t.db, - secKeyCache: make(map[common.Hash][]byte), + secKeyCache: maps.Clone(t.secKeyCache), preimages: t.preimages, } }