Skip to content

Commit

Permalink
hotfix: resolve ambiguity in signature result (yetanotherco#1763)
Browse files Browse the repository at this point in the history
  • Loading branch information
MauroToscano authored Feb 10, 2025
2 parents 5b582d0 + 1d3ea5b commit 6f36329
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions aggregator/pkg/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,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() {
Expand All @@ -92,9 +92,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)
Expand All @@ -106,10 +108,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
Expand Down

0 comments on commit 6f36329

Please sign in to comment.