Skip to content

Commit

Permalink
fix: dymint uses uncapped backoff delay for submitting batches (#304)
Browse files Browse the repository at this point in the history
Authored by: Michael Tsitrin <[email protected]>
  • Loading branch information
omritoptix authored Apr 23, 2023
1 parent 522ad5f commit c217bda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions block/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const (
defaultDABlockTime = 30 * time.Second
DABatchRetryDelay = 20 * time.Second
SLBatchRetryDelay = 10 * time.Second
maxDelay = 1 * time.Minute
)

const (
Expand Down Expand Up @@ -748,7 +749,7 @@ func (m *Manager) submitBatchToSL(batch *types.Batch, resultSubmitToDA *da.Resul
return err
}
return nil
}, retry.Context(m.batchRetryCtx), retry.LastErrorOnly(true), retry.Delay(SLBatchRetryDelay))
}, retry.Context(m.batchRetryCtx), retry.LastErrorOnly(true), retry.Delay(SLBatchRetryDelay), retry.MaxDelay(maxDelay))
// Panic if we failed not due to context cancellation
m.batchRetryMu.Lock()
if err != nil && m.batchRetryCtx.Err() == nil {
Expand All @@ -767,7 +768,7 @@ func (m *Manager) submitBatchToDA(ctx context.Context, batch *types.Batch) (*da.
return fmt.Errorf("failed to submit batch to DA layer: %s", res.Message)
}
return nil
}, retry.Context(ctx), retry.LastErrorOnly(true), retry.Delay(DABatchRetryDelay))
}, retry.Context(ctx), retry.LastErrorOnly(true), retry.Delay(DABatchRetryDelay), retry.MaxDelay(maxDelay))
if err != nil {
return nil, err
}
Expand Down
1 change: 1 addition & 0 deletions da/celestia/celestia.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (c *DataAvailabilityLayerClient) Init(config []byte, kvStore store.KVStore,
func (c *DataAvailabilityLayerClient) Start() error {
c.logger.Info("starting Celestia Data Availability Layer Client", "baseURL", c.config.BaseURL)
var err error
//TODO: add * time.Second for the timeout
c.client, err = cnc.NewClient(c.config.BaseURL, cnc.WithTimeout(c.config.Timeout))
return err
}
Expand Down

0 comments on commit c217bda

Please sign in to comment.