mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
fix load genesis (#834)
* fix `SetupGenesisBlockWithOverride` * fix `configOrDefault`
This commit is contained in:
parent
e54781ea02
commit
0144095e64
1 changed files with 8 additions and 1 deletions
|
|
@ -316,7 +316,8 @@ func SetupGenesisBlockWithOverride(db ethdb.Database, triedb *trie.Database, gen
|
||||||
// overwrite triedb IsUsingZktrie config to be safe
|
// overwrite triedb IsUsingZktrie config to be safe
|
||||||
triedb.SetIsUsingZktrie(storedcfg.Scroll.ZktrieEnabled())
|
triedb.SetIsUsingZktrie(storedcfg.Scroll.ZktrieEnabled())
|
||||||
}
|
}
|
||||||
if header.Root != types.EmptyRootHash && !triedb.Initialized(header.Root) {
|
// if header.Root != types.EmptyRootHash && !triedb.Initialized(header.Hash()) {
|
||||||
|
if _, err := state.New(header.Root, state.NewDatabaseWithNodeDB(db, triedb), nil); err != nil {
|
||||||
if genesis == nil {
|
if genesis == nil {
|
||||||
genesis = DefaultGenesisBlock()
|
genesis = DefaultGenesisBlock()
|
||||||
}
|
}
|
||||||
|
|
@ -420,6 +421,12 @@ func (g *Genesis) configOrDefault(ghash common.Hash) *params.ChainConfig {
|
||||||
return params.SepoliaChainConfig
|
return params.SepoliaChainConfig
|
||||||
case ghash == params.GoerliGenesisHash:
|
case ghash == params.GoerliGenesisHash:
|
||||||
return params.GoerliChainConfig
|
return params.GoerliChainConfig
|
||||||
|
case ghash == params.ScrollAlphaGenesisHash:
|
||||||
|
return params.ScrollAlphaChainConfig
|
||||||
|
case ghash == params.ScrollSepoliaGenesisHash:
|
||||||
|
return params.ScrollSepoliaChainConfig
|
||||||
|
case ghash == params.ScrollMainnetGenesisHash:
|
||||||
|
return params.ScrollMainnetChainConfig
|
||||||
default:
|
default:
|
||||||
return params.AllEthashProtocolChanges
|
return params.AllEthashProtocolChanges
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue