Skip to content

Commit

Permalink
chore(pusher): logging address of shallow receipt (#4393)
Browse files Browse the repository at this point in the history
  • Loading branch information
istae authored Oct 11, 2023
1 parent 5d00652 commit 8b150cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/pusher/pusher.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (s *Service) checkReceipt(receipt *pushsync.Receipt, loggerV1 log.Logger) e
if po < d && s.attempts.try(addr) {
s.metrics.ShallowReceiptDepth.WithLabelValues(strconv.Itoa(int(po))).Inc()
s.metrics.ShallowReceipt.Inc()
return fmt.Errorf("pusher: shallow receipt depth %d, want at least %d: %w", po, d, ErrShallowReceipt)
return fmt.Errorf("pusher: shallow receipt depth %d, want at least %d, chunk_address %s: %w", po, d, addr, ErrShallowReceipt)
}
loggerV1.Debug("chunk pushed", "chunk_address", addr, "peer_address", peer, "proximity_order", po)
s.metrics.ReceiptDepth.WithLabelValues(strconv.Itoa(int(po))).Inc()
Expand Down
7 changes: 5 additions & 2 deletions pkg/sharky/shard.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,11 @@ func (sh *shard) offset(slot uint32) int64 {

// read reads loc.Length bytes to the buffer from the blob slot loc.Slot
func (sh *shard) read(r read) error {
_, err := sh.file.ReadAt(r.buf, sh.offset(r.slot))
return err
n, err := sh.file.ReadAt(r.buf, sh.offset(r.slot))
if err != nil {
return fmt.Errorf("read %d: %w", n, err)
}
return nil
}

// write writes loc.Length bytes to the buffer from the blob slot loc.Slot
Expand Down

0 comments on commit 8b150cf

Please sign in to comment.