diff --git a/aggregator/pkg/server.go b/aggregator/pkg/server.go index 4ec6488d0..26e674619 100644 --- a/aggregator/pkg/server.go +++ b/aggregator/pkg/server.go @@ -69,7 +69,7 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t defer cancel() // Ensure the cancel function is called to release resources // Create a channel to signal when the task is done - done := make(chan struct{}) + done := make(chan uint8) agg.logger.Info("Starting bls signature process") go func() { @@ -80,9 +80,11 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t if err != nil { agg.logger.Warnf("BLS aggregation service error: %s", err) + done<- 1 // todo shouldn't we here close the channel with a reply = 1? } else { agg.logger.Info("BLS process succeeded") + done<- 0 } close(done) @@ -94,10 +96,10 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t case <-ctx.Done(): // The context's deadline was exceeded or it was canceled agg.logger.Info("Bls process timed out, operator signature will be lost. Batch may not reach quorum") - case <-done: + case res := <-done: // The task completed successfully - agg.logger.Info("Bls context finished correctly") - *reply = 0 + agg.logger.Info("Bls context finished on time") + *reply = res } return nil