@@ -5,14 +5,12 @@ import (
55 "encoding/hex"
66 "fmt"
77 "math/big"
8- "strings"
98 "sync"
109 "time"
1110
1211 gethtypes "github.com/ethereum/go-ethereum/core/types"
1312
1413 "github.com/prometheus/client_golang/prometheus"
15- retry "github.com/yetanotherco/aligned_layer/core"
1614 "github.com/yetanotherco/aligned_layer/metrics"
1715
1816 sdkclients "github.com/Layr-Labs/eigensdk-go/chainio/clients"
@@ -396,7 +394,7 @@ func (agg *Aggregator) AddNewTask(batchMerkleRoot [32]byte, senderAddress [20]by
396394 quorumNums := eigentypes.QuorumNums {eigentypes .QuorumNum (QUORUM_NUMBER )}
397395 quorumThresholdPercentages := eigentypes.QuorumThresholdPercentages {eigentypes .QuorumThresholdPercentage (QUORUM_THRESHOLD )}
398396
399- err := agg .InitializeNewTaskRetryable (batchIndex , taskCreatedBlock , quorumNums , quorumThresholdPercentages , agg .AggregatorConfig .Aggregator .BlsServiceTaskTimeout )
397+ err := agg .blsAggregationService . InitializeNewTask (batchIndex , taskCreatedBlock , quorumNums , quorumThresholdPercentages , agg .AggregatorConfig .Aggregator .BlsServiceTaskTimeout )
400398 if err != nil {
401399 agg .logger .Fatalf ("BLS aggregation service error when initializing new task: %s" , err )
402400 }
@@ -409,30 +407,6 @@ func (agg *Aggregator) AddNewTask(batchMerkleRoot [32]byte, senderAddress [20]by
409407
410408// |---RETRYABLE---|
411409
412- /*
413- InitializeNewTaskRetryable
414- Initialize a new task in the BLS Aggregation service
415- - Errors:
416- Permanent:
417- - TaskAlreadyInitializedError (Permanent): Task is already intialized in the BLS Aggregation service (https://github.com/Layr-Labs/eigensdk-go/blob/dev/services/bls_aggregation/blsagg.go#L27).
418- Transient:
419- - All others.
420- - Retry times (3 retries): 1 sec, 2 sec, 4 sec
421- */
422- func (agg * Aggregator ) InitializeNewTaskRetryable (batchIndex uint32 , taskCreatedBlock uint32 , quorumNums eigentypes.QuorumNums , quorumThresholdPercentages eigentypes.QuorumThresholdPercentages , timeToExpiry time.Duration ) error {
423- initializeNewTask_func := func () error {
424- err := agg .blsAggregationService .InitializeNewTask (batchIndex , taskCreatedBlock , quorumNums , quorumThresholdPercentages , timeToExpiry )
425- if err != nil {
426- // Task is already initialized
427- if strings .Contains (err .Error (), "already initialized" ) {
428- err = retry.PermanentError {Inner : err }
429- }
430- }
431- return err
432- }
433- return retry .Retry (initializeNewTask_func , retry .MinDelay , retry .RetryFactor , retry .NumRetries , retry .MaxInterval , retry .MaxElapsedTime )
434- }
435-
436410// Long-lived goroutine that periodically checks and removes old Tasks from stored Maps
437411// It runs every GarbageCollectorPeriod and removes all tasks older than GarbageCollectorTasksAge
438412// This was added because each task occupies memory in the maps, and we need to free it to avoid a memory leak
0 commit comments