diff --git a/eth/api_debug.go b/eth/api_debug.go index ef47cac833..dc9f568146 100644 --- a/eth/api_debug.go +++ b/eth/api_debug.go @@ -231,7 +231,7 @@ func (api *DebugAPI) StorageRangeAt(ctx context.Context, blockNrOrHash rpc.Block func storageRangeAt(statedb *state.StateDB, root common.Hash, address common.Address, start []byte, maxResult int) (StorageRangeResult, error) { storageRoot := statedb.GetStorageRoot(address) - if storageRoot == types.EmptyRootHash { + if storageRoot == types.EmptyRootHash || storageRoot == (common.Hash{}) { return StorageRangeResult{}, nil // empty storage } id := trie.StorageTrieID(root, crypto.Keccak256Hash(address.Bytes()), storageRoot) diff --git a/internal/ethapi/api.go b/internal/ethapi/api.go index 896c71642d..38a7924124 100644 --- a/internal/ethapi/api.go +++ b/internal/ethapi/api.go @@ -693,7 +693,7 @@ func (s *BlockChainAPI) GetProof(ctx context.Context, address common.Address, st if len(keys) > 0 { var storageTrie state.Trie - if storageRoot != types.EmptyRootHash { + if storageRoot != types.EmptyRootHash && storageRoot != (common.Hash{}) { id := trie.StorageTrieID(header.Root, crypto.Keccak256Hash(address.Bytes()), storageRoot) st, err := trie.NewStateTrie(id, statedb.Database().TrieDB()) if err != nil {