@@ -13,6 +13,8 @@ import (
1313 "github.com/yetanotherco/aligned_layer/operator/merkle_tree"
1414)
1515
16+ const BatchDownloadRetryDelay = 5 * time .Second
17+
1618func RequestBatch (req * http.Request , ctx context.Context ) func () (* http.Response , error ) {
1719
1820 req_func := func () (* http.Response , error ) {
@@ -30,20 +32,22 @@ func RequestBatch(req *http.Request, ctx context.Context) func() (*http.Response
3032 return req_func
3133}
3234
33- func RequestBatchRetryable (ctx context.Context , logger logging.Logger , req * http.Request ) (* http.Response , error ) {
35+ func RequestBatchRetryable (ctx context.Context , logger logging.Logger , req * http.Request , config * retry. RetryConfig ) (* http.Response , error ) {
3436
35- return retry .RetryWithData (RequestBatch (req , ctx ), retry . EthCallRetryConfig () )
37+ return retry .RetryWithData (RequestBatch (req , ctx ), config )
3638}
3739
38- func (o * Operator ) getBatchFromDataService (ctx context.Context , batchURL string , expectedMerkleRoot [32 ]byte , maxRetries int , retryDelay time. Duration ) ([]VerificationData , error ) {
40+ func (o * Operator ) getBatchFromDataService (ctx context.Context , batchURL string , expectedMerkleRoot [32 ]byte ) ([]VerificationData , error ) {
3941 o .Logger .Infof ("Getting batch from data service, batchURL: %s" , batchURL )
4042
4143 req , err := http .NewRequestWithContext (ctx , "GET" , batchURL , nil )
4244 if err != nil {
4345 return nil , err
4446 }
4547
46- resp , err := RequestBatchRetryable (ctx , o .Logger , req )
48+ config := retry .EthCallRetryConfig ()
49+ config .InitialInterval = BatchDownloadRetryDelay
50+ resp , err := RequestBatchRetryable (ctx , o .Logger , req , config )
4751 if err != nil {
4852 return nil , err
4953 }
0 commit comments