Skip to content

Commit

Permalink
moved hashfunction error log inside verifySignature for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
samlaf committed May 30, 2024
1 parent 6b1dadc commit 546d91d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion services/bls_aggregation/blsagg.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ func (a *BlsAggregatorService) singleTaskAggregatorGoroutineFunc(
// compute the taskResponseDigest using the hash function
taskResponseDigest, err := a.hashFunction(signedTaskResponseDigest.TaskResponse)
if err != nil {
a.logger.Error("Failed to hash task response, skipping.", "taskIndex", taskIndex, "signedTaskResponseDigest", signedTaskResponseDigest, "err", err)
// this error should never happen, because we've already hashed the taskResponse in verifySignature,
// but keeping here in case the verifySignature implementation ever changes or some catastrophic bug happens..
continue
}
// after verifying signature we aggregate its sig and pubkey, and update the signed stake amount
Expand Down Expand Up @@ -392,6 +393,7 @@ func (a *BlsAggregatorService) verifySignature(

taskResponseDigest, err := a.hashFunction(signedTaskResponseDigest.TaskResponse)
if err != nil {
a.logger.Error("Failed to hash task response, skipping.", "taskIndex", taskIndex, "signedTaskResponseDigest", signedTaskResponseDigest, "err", err)
return HashFunctionError(err)
}

Expand Down

0 comments on commit 546d91d

Please sign in to comment.