Skip to content

Commit 6f36329

Browse files
authored
hotfix: resolve ambiguity in signature result (#1763)
2 parents 5b582d0 + 1d3ea5b commit 6f36329

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

aggregator/pkg/server.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
8181
defer cancel() // Ensure the cancel function is called to release resources
8282

8383
// Create a channel to signal when the task is done
84-
done := make(chan struct{})
84+
done := make(chan uint8)
8585

8686
agg.logger.Info("Starting bls signature process")
8787
go func() {
@@ -92,9 +92,11 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
9292

9393
if err != nil {
9494
agg.logger.Warnf("BLS aggregation service error: %s", err)
95+
done<- 1
9596
// todo shouldn't we here close the channel with a reply = 1?
9697
} else {
9798
agg.logger.Info("BLS process succeeded")
99+
done<- 0
98100
}
99101

100102
close(done)
@@ -106,10 +108,10 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
106108
case <-ctx.Done():
107109
// The context's deadline was exceeded or it was canceled
108110
agg.logger.Info("Bls process timed out, operator signature will be lost. Batch may not reach quorum")
109-
case <-done:
111+
case res := <-done:
110112
// The task completed successfully
111-
agg.logger.Info("Bls context finished correctly")
112-
*reply = 0
113+
agg.logger.Info("Bls context finished on time")
114+
*reply = res
113115
}
114116

115117
return nil

0 commit comments

Comments
 (0)