Skip to content

Commit

Permalink
fix(da): submission retry function removed (dymensionxyz#920)
Browse files Browse the repository at this point in the history
  • Loading branch information
srene authored Jun 23, 2024
1 parent a825c28 commit 5a3478b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion config/toml.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace_id = "{{ .BlockManagerConfig.NamespaceID }}"
da_config = "{{ .DAConfig }}"
# Celestia config example:
# da_config = "{\"base_url\":\"http:\/\/127.0.0.1:26658\",\"timeout\":5000000000,\"gas_prices\":0.1,\"auth_token\":\"TOKEN\",\"backoff\":{\"initial_delay\":6000000000,\"max_delay\":6000000000,\"growth_factor\":2},\"retry_attempts\":4,\"retry_delay\":3000000000}"
# da_config = "{\"base_url\":\"http:\/\/127.0.0.1:26658\",\"timeout\":30000000000,\"gas_prices\":0.1,\"auth_token\":\"TOKEN\",\"backoff\":{\"initial_delay\":6000000000,\"max_delay\":6000000000,\"growth_factor\":2},\"retry_attempts\":4,\"retry_delay\":3000000000}"
# Avail config example:
# da_config = "{\"seed\": \"MNEMONIC\", \"api_url\": \"wss://kate.avail.tools/ws\", \"app_id\": 0, \"tip\":10}"
Expand Down
19 changes: 1 addition & 18 deletions da/celestia/celestia.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,24 +527,7 @@ func (c *DataAvailabilityLayerClient) submit(daBlob da.Blob) (uint64, da.Commitm
ctx, cancel := context.WithTimeout(c.ctx, c.config.Timeout)
defer cancel()

/*
TODO: dry out all retries
*/

var height uint64

err = retry.Do(
func() error {
var err error
height, err = c.rpc.Submit(ctx, blobs, openrpc.GasPrice(c.config.GasPrices))
return err
},
retry.Context(c.ctx),
retry.LastErrorOnly(true),
retry.Delay(c.config.RetryDelay),
retry.Attempts(uint(c.config.RetryAttempts)),
retry.DelayType(retry.FixedDelay),
)
height, err := c.rpc.Submit(ctx, blobs, openrpc.GasPrice(c.config.GasPrices))
if err != nil {
return 0, nil, fmt.Errorf("do rpc submit: %w", err)
}
Expand Down

0 comments on commit 5a3478b

Please sign in to comment.