Skip to content

Commit

Permalink
fix(DASer): Log sampling errors in DASer (#3889)
Browse files Browse the repository at this point in the history
  • Loading branch information
walldiss authored Oct 30, 2024
1 parent 30cd2a6 commit 7a70dd5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
24 changes: 13 additions & 11 deletions das/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
5 changes: 0 additions & 5 deletions share/availability/light/availability.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 7a70dd5

Please sign in to comment.