From 354b2c12370774e794fa9ade95f62abd1d7bfe47 Mon Sep 17 00:00:00 2001 From: Samuel Laferriere Date: Thu, 30 May 2024 23:02:01 +0800 Subject: [PATCH] moved hashfunction error log inside verifySignature for consistency --- services/bls_aggregation/blsagg.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/bls_aggregation/blsagg.go b/services/bls_aggregation/blsagg.go index fc70d649..9514bb2b 100644 --- a/services/bls_aggregation/blsagg.go +++ b/services/bls_aggregation/blsagg.go @@ -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 @@ -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) }