another workaround to force verkle at creation

This commit is contained in:
Guillaume Ballet 2024-02-01 07:25:32 +01:00
parent c3b9b375cc
commit 9be95a24f4
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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()
}