From 6139d9c22f32aa468d9efb1a10c5fb2673beb13f Mon Sep 17 00:00:00 2001 From: lmittmann Date: Tue, 10 Dec 2024 12:41:28 +0100 Subject: [PATCH] don't panic if trie type is unknown, return identity instead --- core/state/database.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/state/database.go b/core/state/database.go index faf4954650..aa972990be 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -17,8 +17,6 @@ package state import ( - "fmt" - "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/lru" "github.com/ethereum/go-ethereum/core/rawdb" @@ -274,6 +272,9 @@ func mustCopyTrie(t Trie) Trie { case *trie.VerkleTrie: return t.Copy() default: - panic(fmt.Errorf("unknown trie type %T", t)) + // Rare case: Return the identity if the trie type is not directly + // implemented within go-ethereum. Any copy logic would need to be handled + // by the caller outside go-ethereum. + return t } }