diff --git a/core/state/database.go b/core/state/database.go index 86a32b1459..72fa215730 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -46,9 +46,6 @@ type Database interface { // OpenStorageTrie opens the storage trie of an account. OpenStorageTrie(stateRoot common.Hash, address common.Address, root common.Hash) (Trie, error) - // OpenStorageTrieWithAddrHash opens the storage trie of an account - OpenStorageTrieWithAddrHash(stateRoot common.Hash, addrHash common.Hash, root common.Hash) (Trie, error) - // CopyTrie returns an independent copy of the given trie. CopyTrie(Trie) Trie @@ -191,16 +188,6 @@ func (db *cachingDB) OpenStorageTrie(stateRoot common.Hash, address common.Addre return tr, nil } -// OpenStorageTrieWithAddrHash opens the storage trie of an account. -// arbitrum: the method is readded to not require address which is not available in pruner dumpRawTrieDescendants -func (db *cachingDB) OpenStorageTrieWithAddrHash(stateRoot common.Hash, addrHash common.Hash, root common.Hash) (Trie, error) { - tr, err := trie.NewStateTrie(trie.StorageTrieID(stateRoot, addrHash, root), db.triedb) - if err != nil { - return nil, err - } - return tr, nil -} - // CopyTrie returns an independent copy of the given trie. func (db *cachingDB) CopyTrie(t Trie) Trie { switch t := t.(type) { diff --git a/core/state/pruner/pruner.go b/core/state/pruner/pruner.go index 5c92dc0c89..1e959bd13d 100644 --- a/core/state/pruner/pruner.go +++ b/core/state/pruner/pruner.go @@ -381,7 +381,7 @@ func dumpRawTrieDescendants(db ethdb.Database, root common.Hash, output *stateBl output.Put(data.CodeHash, nil) } if data.Root != (common.Hash{}) { - storageTr, err := sdb.OpenStorageTrieWithAddrHash(key, common.BytesToHash(accountIt.LeafKey()), data.Root) + storageTr, err := trie.NewStateTrie(trie.StorageTrieID(root, key, data.Root), sdb.TrieDB()) if err != nil { return err } diff --git a/light/trie.go b/light/trie.go index 3820b386b4..4967cc74e5 100644 --- a/light/trie.go +++ b/light/trie.go @@ -59,10 +59,6 @@ func (db *odrDatabase) OpenStorageTrie(stateRoot common.Hash, address common.Add return &odrTrie{db: db, id: StorageTrieID(db.id, address, root)}, nil } -func (db *odrDatabase) OpenStorageTrieWithAddrHash(stateRoot common.Hash, addrHash common.Hash, root common.Hash) (state.Trie, error) { - return nil, errors.New("OpenStorageTrieWithAddrHash is not implemented for odrDatabase") -} - func (db *odrDatabase) CopyTrie(t state.Trie) state.Trie { switch t := t.(type) { case *odrTrie: