From 7a70dd51ae0ca239b3b0bec1db59477bbf2bc4e5 Mon Sep 17 00:00:00 2001 From: Vlad <13818348+walldiss@users.noreply.github.com> Date: Wed, 30 Oct 2024 20:44:41 +0100 Subject: [PATCH] fix(DASer): Log sampling errors in DASer (#3889) --- das/worker.go | 24 +++++++++++++----------- share/availability/light/availability.go | 5 ----- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/das/worker.go b/das/worker.go index 88ca387211..0acd4b41a6 100644 --- a/das/worker.go +++ b/das/worker.go @@ -127,18 +127,20 @@ func (w *worker) sample(ctx context.Context, timeout time.Duration, height uint6 w.metrics.observeSample(ctx, h, time.Since(start), w.state.jobType, err) if err != nil { - if !errors.Is(err, context.Canceled) { - log.Debugw( - "failed to sample header", - "type", w.state.jobType, - "height", h.Height(), - "hash", h.Hash(), - "square width", len(h.DAH.RowRoots), - "data root", h.DAH.String(), - "err", err, - "finished (s)", time.Since(start), - ) + if errors.Is(err, context.Canceled) { + return err } + + log.Errorw( + "failed to sample header", + "type", w.state.jobType, + "height", h.Height(), + "hash", h.Hash(), + "square width", len(h.DAH.RowRoots), + "data root", h.DAH.String(), + "err", err, + "finished (s)", time.Since(start), + ) return err } diff --git a/share/availability/light/availability.go b/share/availability/light/availability.go index def56d346b..2619da3f5c 100644 --- a/share/availability/light/availability.go +++ b/share/availability/light/availability.go @@ -97,7 +97,6 @@ func (la *ShareAvailability) SharesAvailable(ctx context.Context, header *header } if err := dah.ValidateBasic(); err != nil { - log.Errorw("DAH validation failed", "error", err) return err } @@ -141,10 +140,6 @@ func (la *ShareAvailability) SharesAvailable(ctx context.Context, header *header // if any of the samples failed, return an error if len(failedSamples) > 0 { - log.Errorw("availability validation failed", - "root", dah.String(), - "failed_samples", failedSamples, - ) return share.ErrNotAvailable } return nil