Skip to content

Commit

Permalink
fix: add more check
Browse files Browse the repository at this point in the history
  • Loading branch information
will@2012 committed Jun 13, 2024
1 parent d5e4c6c commit c0c8a64
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions triedb/pathdb/difflayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ func (dl *diffLayer) node(owner common.Hash, path []byte, hash common.Hash, dept

diffHashCacheMissMeter.Mark(1)
persistLayer := dl.originDiskLayer()
if persistLayer != nil {
if hash != (common.Hash{}) && persistLayer != nil {
blob, rhash, nloc, err := persistLayer.node(owner, path, hash, depth+1)
if err != nil || rhash != hash {
// This is a bad case with a very low probability.
Expand All @@ -248,7 +248,8 @@ func (dl *diffLayer) node(owner common.Hash, path []byte, hash common.Hash, dept
}
}
diffHashCacheSlowPathMeter.Mark(1)
log.Debug("Retry difflayer due to origin is nil", "owner", owner, "path", path, "hash", hash.String())
log.Debug("Retry difflayer due to origin is nil or hash is empty",
"owner", owner, "path", path, "query_hash", hash.String(), "disk_layer_is_empty", persistLayer == nil)
return dl.intervalNode(owner, path, hash, 0)
}

Expand Down

0 comments on commit c0c8a64

Please sign in to comment.