Skip to content

Commit e6eeeb8

Browse files
committed
hotfix: resolve ambiguity in signature result
`ProcessOperatorSignedTaskResponseV2` would set `*reply` to `0` in all non-timeout scenarios, regardless of errors. Use the `done` channel to report actual result and use that instead.
1 parent c0422f5 commit e6eeeb8

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
@@ -69,7 +69,7 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
6969
defer cancel() // Ensure the cancel function is called to release resources
7070

7171
// Create a channel to signal when the task is done
72-
done := make(chan struct{})
72+
done := make(chan uint8)
7373

7474
agg.logger.Info("Starting bls signature process")
7575
go func() {
@@ -80,9 +80,11 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
8080

8181
if err != nil {
8282
agg.logger.Warnf("BLS aggregation service error: %s", err)
83+
done<- 1
8384
// todo shouldn't we here close the channel with a reply = 1?
8485
} else {
8586
agg.logger.Info("BLS process succeeded")
87+
done<- 0
8688
}
8789

8890
close(done)
@@ -94,10 +96,10 @@ func (agg *Aggregator) ProcessOperatorSignedTaskResponseV2(signedTaskResponse *t
9496
case <-ctx.Done():
9597
// The context's deadline was exceeded or it was canceled
9698
agg.logger.Info("Bls process timed out, operator signature will be lost. Batch may not reach quorum")
97-
case <-done:
99+
case res := <-done:
98100
// The task completed successfully
99-
agg.logger.Info("Bls context finished correctly")
100-
*reply = 0
101+
agg.logger.Info("Bls context finished on time")
102+
*reply = res
101103
}
102104

103105
return nil

0 commit comments

Comments
 (0)