Skip to content

Commit

Permalink
fix(das): Only debug log sampled header if it was actually successful (
Browse files Browse the repository at this point in the history
…#1295)

Self explanatory

Co-authored-by: Viacheslav <viacheslavgonkivskyi@gmail.com>
  • Loading branch information
renaynay and vgonkivs authored Nov 1, 2022
1 parent 9c996a7 commit f5f5adb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions das/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,13 @@ func (w *worker) run(
}
w.setResult(curr, err)
metrics.observeSample(ctx, h, time.Since(startSample), err)
log.Debugw("sampled header", "height", h.Height, "hash", h.Hash(),
"square width", len(h.DAH.RowsRoots), "data root", h.DAH.Hash(), "finished (s)", time.Since(startSample))
if err != nil {
log.Debugw("failed to sampled header", "height", h.Height, "hash", h.Hash(),
"square width", len(h.DAH.RowsRoots), "data root", h.DAH.Hash(), "err", err)
} else {
log.Debugw("sampled header", "height", h.Height, "hash", h.Hash(),
"square width", len(h.DAH.RowsRoots), "data root", h.DAH.Hash(), "finished (s)", time.Since(startSample))
}
}

if w.state.Curr > w.state.From {
Expand Down

0 comments on commit f5f5adb

Please sign in to comment.