Skip to content

Commit c40d791

Browse files
authored
Revert "trie/triedb/pathdb: improve error log (ethereum#28177)"
This reverts commit cdfae85.
1 parent 2bce517 commit c40d791

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

trie/triedb/pathdb/difflayer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func (dl *diffLayer) node(owner common.Hash, path []byte, hash common.Hash, dept
114114
if n.Hash != hash {
115115
dirtyFalseMeter.Mark(1)
116116
log.Error("Unexpected trie node in diff layer", "owner", owner, "path", path, "expect", hash, "got", n.Hash)
117-
return nil, newUnexpectedNodeError("diff", hash, n.Hash, owner, path, n.Blob)
117+
return nil, newUnexpectedNodeError("diff", hash, n.Hash, owner, path)
118118
}
119119
dirtyHitMeter.Mark(1)
120120
dirtyNodeHitDepthHist.Update(int64(depth))

trie/triedb/pathdb/disklayer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func (dl *diskLayer) Node(owner common.Hash, path []byte, hash common.Hash) ([]b
150150
if nHash != hash {
151151
diskFalseMeter.Mark(1)
152152
log.Error("Unexpected trie node in disk", "owner", owner, "path", path, "expect", hash, "got", nHash)
153-
return nil, newUnexpectedNodeError("disk", hash, nHash, owner, path, nBlob)
153+
return nil, newUnexpectedNodeError("disk", hash, nHash, owner, path)
154154
}
155155
if dl.cleans != nil && len(nBlob) > 0 {
156156
dl.cleans.Set(key, nBlob)

trie/triedb/pathdb/errors.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"fmt"
2222

2323
"github.com/ethereum/go-ethereum/common"
24-
"github.com/ethereum/go-ethereum/common/hexutil"
2524
)
2625

2726
var (
@@ -47,10 +46,6 @@ var (
4746
errUnexpectedNode = errors.New("unexpected node")
4847
)
4948

50-
func newUnexpectedNodeError(loc string, expHash common.Hash, gotHash common.Hash, owner common.Hash, path []byte, blob []byte) error {
51-
blobHex := "nil"
52-
if len(blob) > 0 {
53-
blobHex = hexutil.Encode(blob)
54-
}
55-
return fmt.Errorf("%w, loc: %s, node: (%x %v), %x!=%x, blob: %s", errUnexpectedNode, loc, owner, path, expHash, gotHash, blobHex)
49+
func newUnexpectedNodeError(loc string, expHash common.Hash, gotHash common.Hash, owner common.Hash, path []byte) error {
50+
return fmt.Errorf("%w, loc: %s, node: (%x %v), %x!=%x", errUnexpectedNode, loc, owner, path, expHash, gotHash)
5651
}

trie/triedb/pathdb/nodebuffer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func (b *nodebuffer) node(owner common.Hash, path []byte, hash common.Hash) (*tr
7171
if n.Hash != hash {
7272
dirtyFalseMeter.Mark(1)
7373
log.Error("Unexpected trie node in node buffer", "owner", owner, "path", path, "expect", hash, "got", n.Hash)
74-
return nil, newUnexpectedNodeError("dirty", hash, n.Hash, owner, path, n.Blob)
74+
return nil, newUnexpectedNodeError("dirty", hash, n.Hash, owner, path)
7575
}
7676
return n, nil
7777
}

0 commit comments

Comments
 (0)