Skip to content

Commit

Permalink
workaround: disable check for root presence
Browse files Browse the repository at this point in the history
  • Loading branch information
gballet committed Sep 26, 2023
1 parent 3e6b005 commit d7823ae
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions core/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d7823ae

Please sign in to comment.