From 6d7b22c07293b081f9014dd72f4dfea0aaea042b Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Thu, 1 Feb 2024 07:25:32 +0100 Subject: [PATCH] another workaround to force verkle at creation --- core/blockchain.go | 1 + core/genesis.go | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/blockchain.go b/core/blockchain.go index 0d43cb989074..a97bfb20c1aa 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -242,6 +242,7 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis triedb := trie.NewDatabaseWithConfig(db, &trie.Config{ Cache: cacheConfig.TrieCleanLimit, Preimages: cacheConfig.Preimages, + Verkle: true, }) // Setup the genesis block, commit the provided genesis specification // to database if the genesis block is not present yet, or load the diff --git a/core/genesis.go b/core/genesis.go index 1262d350f26c..c8a4bc5952d9 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -342,8 +342,7 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen // We have the genesis block in database(perhaps in ancient database) // but the corresponding state is missing. header := rawdb.ReadHeader(db, stored, 0) - notverkle := genesis == nil || genesis.Config == nil || genesis.Config.PragueTime == nil || !genesis.Config.IsPrague(big.NewInt(0), genesis.Timestamp) - if notverkle && header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) { + if !triedb.IsVerkle() && header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) { if genesis == nil { genesis = DefaultGenesisBlock() }