Skip to content

Commit 699cadf

Browse files
committed
add timeout for da request
1 parent 9673004 commit 699cadf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

block/internal/syncing/syncer.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,12 @@ func (s *Syncer) fetchDAUntilCaughtUp() error {
303303
}
304304

305305
daHeight := s.GetDAHeight()
306-
events, err := s.daRetriever.RetrieveFromDA(s.ctx, daHeight)
306+
307+
// Create a new context with a timeout for the DA call
308+
ctx, cancel := context.WithTimeout(s.ctx, 5*time.Second)
309+
defer cancel()
310+
311+
events, err := s.daRetriever.RetrieveFromDA(ctx, daHeight)
307312
if err != nil {
308313
switch {
309314
case errors.Is(err, coreda.ErrBlobNotFound):

0 commit comments

Comments
 (0)