@@ -23,8 +23,11 @@ import (
2323)
2424
2525const (
26- waitForTxConfigMaxInterval = 2 * time .Second
27- waitForTxConfigNumRetries = 0
26+ waitForTxMaxInterval = 2 * time .Second
27+ waitForTxNumRetries = 0
28+ respondToTaskV2NumRetries uint64 = 0
29+ respondToTaskV2MaxInterval = time .Millisecond * 500
30+ respondToTaskV2MaxElapsedTime = 0
2831)
2932
3033type AvsWriter struct {
@@ -111,12 +114,14 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
111114
112115 // Set Retry config for RespondToTaskV2
113116 respondToTaskV2Config := retry .EthCallRetryConfig ()
114- respondToTaskV2Config .MaxElapsedTime = 0
117+ respondToTaskV2Config .NumRetries = respondToTaskV2NumRetries
118+ respondToTaskV2Config .MaxInterval = respondToTaskV2MaxInterval
119+ respondToTaskV2Config .MaxElapsedTime = respondToTaskV2MaxElapsedTime
115120
116121 // Set Retry config for WaitForTxRetryable
117122 waitForTxConfig := retry .EthCallRetryConfig ()
118- waitForTxConfig .MaxInterval = waitForTxConfigMaxInterval
119- waitForTxConfig .NumRetries = waitForTxConfigNumRetries
123+ waitForTxConfig .MaxInterval = waitForTxMaxInterval
124+ waitForTxConfig .NumRetries = waitForTxNumRetries
120125 waitForTxConfig .MaxElapsedTime = timeToWaitBeforeBump
121126
122127 var sentTxs []* types.Transaction
@@ -185,7 +190,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
185190 }
186191 sentTxs = append (sentTxs , realTx )
187192
188- w .logger .Infof ("Transaction sent, waiting for receipt" , "merkle root" , batchMerkleRootHashString )
193+ w .logger .Infof ("Transaction sent, waiting for receipt" , "merkle root" , batchMerkleRootHashString )
189194 receipt , err := utils .WaitForTransactionReceiptRetryable (w .Client , w .ClientFallback , realTx .Hash (), waitForTxConfig )
190195
191196 if receipt != nil {
@@ -204,7 +209,7 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
204209 return nil , fmt .Errorf ("transaction failed" )
205210 }
206211
207- // This just retries the bump of a fee in case of a timeout
212+ // This just retries the bump of a fee in case of a timeout
208213 // The wait is done before on WaitForTransactionReceiptRetryable, and all the functions are retriable,
209214 // so this retry doesn't need to wait more time
210215 return retry .RetryWithData (respondToTaskV2Func , respondToTaskV2Config )
0 commit comments