core, trie, eth, cmd: rework preimage store (#25287)

* core, trie, eth, cmd: rework preimage store

* trie: address comment
This commit is contained in:
rjl493456442
2022-07-27 20:37:04 +02:00
committed by GitHub
parent 54007f5e0a
commit 9d76a9b94f
6 changed files with 127 additions and 84 deletions
+1 -1
View File
@@ -268,7 +268,7 @@ func (pre *Prestate) Apply(vmConfig vm.Config, chainConfig *params.ChainConfig,
}
func MakePreState(db ethdb.Database, accounts core.GenesisAlloc) *state.StateDB {
sdb := state.NewDatabase(db)
sdb := state.NewDatabaseWithConfig(db, &trie.Config{Preimages: true})
statedb, _ := state.New(common.Hash{}, sdb, nil)
for addr, a := range accounts {
statedb.SetCode(addr, a.Code)