@@ -6,11 +6,8 @@ import (
66 "fmt"
77 "net/http"
88 "net/rpc"
9- "strings"
109 "time"
1110
12- "github.com/Layr-Labs/eigensdk-go/crypto/bls"
13- eigentypes "github.com/Layr-Labs/eigensdk-go/types"
1411 retry "github.com/yetanotherco/aligned_layer/core"
1512 "github.com/yetanotherco/aligned_layer/core/types"
1613)
@@ -72,7 +69,7 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
7269
7370 agg .logger .Info ("Starting bls signature process" )
7471 go func () {
75- err := agg .ProcessNewSignature (
72+ err := agg .blsAggregationService . ProcessNewSignature (
7673 context .Background (), taskIndex , signedTaskResponse .BatchIdentifierHash ,
7774 & signedTaskResponse .BlsSignature , signedTaskResponse .OperatorId ,
7875 )
@@ -99,9 +96,6 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
9996 * reply = 0
10097 }
10198
102- agg .AggregatorConfig .BaseConfig .Logger .Info ("- Unlocked Resources: Task response processing finished" )
103- agg .taskMutex .Unlock ()
104-
10599 return nil
106100}
107101
@@ -112,42 +106,12 @@ func (agg *Aggregator) ServerRunning(_ *struct{}, reply *int64) error {
112106 return nil
113107}
114108
115- // |---RETRYABLE---|
116-
117- /*
118- - Errors:
119- Permanent:
120- - SignatureVerificationError: Verification of the sigature within the BLS Aggregation Service failed. (https://github.com/Layr-Labs/eigensdk-go/blob/dev/services/bls_aggregation/blsagg.go#L42).
121- Transient:
122- - All others.
123- - Retry times (3 retries): 12 sec (1 Blocks), 24 sec (2 Blocks), 48 sec (4 Blocks)
124- - NOTE: TaskNotFound errors from the BLS Aggregation service are Transient errors as block reorg's may lead to these errors being thrown.
125- */
126- func (agg * Aggregator ) ProcessNewSignature (ctx context.Context , taskIndex uint32 , taskResponse interface {}, blsSignature * bls.Signature , operatorId eigentypes.Bytes32 ) error {
127- processNewSignature_func := func () error {
128- err := agg .blsAggregationService .ProcessNewSignature (
129- ctx , taskIndex , taskResponse ,
130- blsSignature , operatorId ,
131- )
132- if err != nil {
133- if strings .Contains (err .Error (), "Failed to verify signature" ) {
134- err = retry.PermanentError {Inner : err }
135- }
136- }
137- return err
138- }
139-
140- return retry .Retry (processNewSignature_func , retry .MinDelayChain , retry .RetryFactor , retry .NumRetries , retry .MaxIntervalChain , retry .MaxElapsedTime )
141- }
142-
143109func (agg * Aggregator ) GetTaskIndex (batchIdentifierHash [32 ]byte ) (uint32 , error ) {
144110 getTaskIndex_func := func () (uint32 , error ) {
145111 agg .taskMutex .Lock ()
146- agg .AggregatorConfig .BaseConfig .Logger .Info ("- Locked Resources: Starting processing of Response" )
147112 taskIndex , ok := agg .batchesIdxByIdentifierHash [batchIdentifierHash ]
113+ agg .taskMutex .Unlock ()
148114 if ! ok {
149- agg .taskMutex .Unlock ()
150- agg .logger .Info ("- Unlocked Resources: Task not found in the internal map" )
151115 return taskIndex , fmt .Errorf ("Task not found in the internal map" )
152116 } else {
153117 return taskIndex , nil
0 commit comments