Skip to content

Commit

Permalink
fix: use the retryable InitializeNewTask function (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
avilagaston9 authored Nov 19, 2024
1 parent 698de75 commit 131599f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions aggregator/pkg/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,7 @@ func (agg *Aggregator) AddNewTask(batchMerkleRoot [32]byte, senderAddress [20]by
quorumNums := eigentypes.QuorumNums{eigentypes.QuorumNum(QUORUM_NUMBER)}
quorumThresholdPercentages := eigentypes.QuorumThresholdPercentages{eigentypes.QuorumThresholdPercentage(QUORUM_THRESHOLD)}

err := agg.blsAggregationService.InitializeNewTask(batchIndex, taskCreatedBlock, quorumNums, quorumThresholdPercentages, agg.AggregatorConfig.Aggregator.BlsServiceTaskTimeout)
// FIXME(marian): When this errors, should we retry initializing new task? Logging fatal for now.
err := agg.InitializeNewTaskRetryable(batchIndex, taskCreatedBlock, quorumNums, quorumThresholdPercentages, agg.AggregatorConfig.Aggregator.BlsServiceTaskTimeout)
if err != nil {
agg.logger.Fatalf("BLS aggregation service error when initializing new task: %s", err)
}
Expand All @@ -399,7 +398,7 @@ func (agg *Aggregator) AddNewTask(batchMerkleRoot [32]byte, senderAddress [20]by
// |---RETRYABLE---|

/*
InitializeNewTask
InitializeNewTaskRetryable
Initialize a new task in the BLS Aggregation service
- Errors:
Permanent:
Expand All @@ -408,7 +407,7 @@ Initialize a new task in the BLS Aggregation service
- All others.
- Retry times (3 retries): 1 sec, 2 sec, 4 sec
*/
func (agg *Aggregator) InitializeNewTask(batchIndex uint32, taskCreatedBlock uint32, quorumNums eigentypes.QuorumNums, quorumThresholdPercentages eigentypes.QuorumThresholdPercentages, timeToExpiry time.Duration) error {
func (agg *Aggregator) InitializeNewTaskRetryable(batchIndex uint32, taskCreatedBlock uint32, quorumNums eigentypes.QuorumNums, quorumThresholdPercentages eigentypes.QuorumThresholdPercentages, timeToExpiry time.Duration) error {
initializeNewTask_func := func() error {
err := agg.blsAggregationService.InitializeNewTask(batchIndex, taskCreatedBlock, quorumNums, quorumThresholdPercentages, timeToExpiry)
if err != nil {
Expand Down

0 comments on commit 131599f

Please sign in to comment.