Skip to content

Commit

Permalink
Merge pull request ethereum#276 from OffchainLabs/fix-pruner-account-…
Browse files Browse the repository at this point in the history
…address-not-available

fix prunning: use correct state root and don't require account address
  • Loading branch information
PlasmaPower authored Dec 27, 2023
2 parents b1622e6 + 1e2855b commit dff302d
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions core/state/pruner/pruner.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,14 +381,7 @@ func dumpRawTrieDescendants(db ethdb.Database, root common.Hash, output *stateBl
output.Put(data.CodeHash, nil)
}
if data.Root != (common.Hash{}) {
// Lookup the preimage of account hash
preimage := tr.GetKey(accountIt.LeafKey())
if preimage == nil {
return errors.New("account address is not available")
}
address := common.BytesToAddress(preimage)

storageTr, err := sdb.OpenStorageTrie(key, address, data.Root)
storageTr, err := trie.NewStateTrie(trie.StorageTrieID(root, key, data.Root), sdb.TrieDB())
if err != nil {
return err
}
Expand Down

0 comments on commit dff302d

Please sign in to comment.