Skip to content

Commit

Permalink
pass config into GetTaskIndex
Browse files Browse the repository at this point in the history
  • Loading branch information
PatStiles committed Nov 21, 2024
1 parent 59dc08f commit 32f2ea3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aggregator/pkg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
// If that's the case, we won't know about the task at this point
// so we make GetTaskIndex retryable, waiting for some seconds,
// before trying to fetch the task again from the map.
taskIndex, err := agg.GetTaskIndexRetryable(signedTaskResponse.BatchIdentifierHash)
taskIndex, err := agg.GetTaskIndexRetryable(signedTaskResponse.BatchIdentifierHash, retry.EthCallRetryConfig())

if err != nil {
agg.logger.Warn("Task not found in the internal map, operator signature will be lost. Batch may not reach quorum")
Expand Down Expand Up @@ -117,7 +117,7 @@ Checks Internal mapping for Signed Task Response, returns its TaskIndex.
TODO: We should refactor the retry duration considering extending it to a larger time or number of retries, at least somewhere between 1 and 2 blocks
*/
func (agg *Aggregator) GetTaskIndexRetryable(batchIdentifierHash [32]byte) (uint32, error) {
func (agg *Aggregator) GetTaskIndexRetryable(batchIdentifierHash [32]byte, config *retry.RetryConfig) (uint32, error) {
getTaskIndex_func := func() (uint32, error) {
agg.taskMutex.Lock()
taskIndex, ok := agg.batchesIdxByIdentifierHash[batchIdentifierHash]
Expand All @@ -129,5 +129,5 @@ func (agg *Aggregator) GetTaskIndexRetryable(batchIdentifierHash [32]byte) (uint
}
}

return retry.RetryWithData(getTaskIndex_func, retry.EthCallRetryConfig())
return retry.RetryWithData(getTaskIndex_func, config)
}

0 comments on commit 32f2ea3

Please sign in to comment.