From d7823ae699523fc6c685d298ed74beec43c07ce3 Mon Sep 17 00:00:00 2001 From: Guillaume Ballet <3272758+gballet@users.noreply.github.com> Date: Tue, 26 Sep 2023 21:12:09 +0200 Subject: [PATCH] workaround: disable check for root presence --- core/genesis.go | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/core/genesis.go b/core/genesis.go index 6ea848508270..2ed1ab949187 100644 --- a/core/genesis.go +++ b/core/genesis.go @@ -341,23 +341,23 @@ 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) - if header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) { - if genesis == nil { - genesis = DefaultGenesisBlock() - } - // Ensure the stored genesis matches with the given one. - hash := genesis.ToBlock().Hash() - if hash != stored { - return genesis.Config, hash, &GenesisMismatchError{stored, hash} - } - block, err := genesis.Commit(db, triedb) - if err != nil { - return genesis.Config, hash, err - } - applyOverrides(genesis.Config) - return genesis.Config, block.Hash(), nil - } + // header := rawdb.ReadHeader(db, stored, 0) + // if header.Root != types.EmptyRootHash && !rawdb.HasLegacyTrieNode(db, header.Root) { + // if genesis == nil { + // genesis = DefaultGenesisBlock() + // } + // // Ensure the stored genesis matches with the given one. + // hash := genesis.ToBlock().Hash() + // if hash != stored { + // return genesis.Config, hash, &GenesisMismatchError{stored, hash} + // } + // block, err := genesis.Commit(db, triedb) + // if err != nil { + // return genesis.Config, hash, err + // } + // applyOverrides(genesis.Config) + // return genesis.Config, block.Hash(), nil + // } // Check whether the genesis block is already written. if genesis != nil { hash := genesis.ToBlock().Hash()