@@ -21,6 +21,11 @@ import (
2121 "github.com/yetanotherco/aligned_layer/metrics"
2222)
2323
24+ const (
25+ waitForTxConfigMaxInterval = 2 * time .Second
26+ waitForTxConfigNumRetries = 0
27+ )
28+
2429type AvsWriter struct {
2530 * avsregistry.ChainWriter
2631 AvsContractBindings * AvsServiceBindings
@@ -94,13 +99,13 @@ func (w *AvsWriter) SendAggregatedResponse(batchIdentifierHash [32]byte, batchMe
9499 i := 0
95100
96101 // Set Retry config for RespondToTaskV2
97- respondToTaskV2Config := retry .RpcRetryConfig ()
102+ respondToTaskV2Config := retry .EthCallRetryConfig ()
98103 respondToTaskV2Config .MaxElapsedTime = 0
99104
100105 // Set Retry config for WaitForTxRetryable
101- waitForTxConfig := retry .RpcRetryConfig ()
102- waitForTxConfig .MaxInterval = 2 * time . Second
103- waitForTxConfig .NumRetries = 0
106+ waitForTxConfig := retry .EthCallRetryConfig ()
107+ waitForTxConfig .MaxInterval = waitForTxConfigMaxInterval
108+ waitForTxConfig .NumRetries = waitForTxConfigNumRetries
104109 waitForTxConfig .MaxElapsedTime = timeToWaitBeforeBump
105110
106111 respondToTaskV2Func := func () (* types.Receipt , error ) {
@@ -193,8 +198,8 @@ func (w *AvsWriter) checkAggAndBatcherHaveEnoughBalance(tx *types.Transaction, t
193198 respondToTaskFeeLimit := batchState .RespondToTaskFeeLimit
194199 w .logger .Info ("Checking balance against Batch RespondToTaskFeeLimit" , "RespondToTaskFeeLimit" , respondToTaskFeeLimit )
195200 // Note: we compare both Aggregator funds and Batcher balance in Aligned against respondToTaskFeeLimit
196- // Batcher will pay up to respondToTaskFeeLimit, for this he needs that amount of funds in Aligned
197- // Aggregator will pay any extra cost, for this he needs at least respondToTaskFeeLimit in his balance
201+ // Batcher will pay up to respondToTaskFeeLimit, for this he needs that amount of funds in Aligned
202+ // Aggregator will pay any extra cost, for this he needs at least respondToTaskFeeLimit in his balance
198203 return w .compareBalances (respondToTaskFeeLimit , aggregatorAddress , senderAddress )
199204}
200205
0 commit comments