Skip to content

Commit 78ce58b

Browse files
turmelclemAlenar
authored andcommitted
feat(aggregator): improve logging when single signature authentication fail
1 parent 229c9e7 commit 78ce58b

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

mithril-aggregator/src/tools/single_signature_authenticator.rs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,29 +40,33 @@ impl SingleSignatureAuthenticator {
4040
);
4141
true
4242
}
43-
Err(_error) => {
43+
Err(current_stake_distribution_error) => {
4444
// Signers may detect epoch changes before the aggregator and send
4545
// new signatures using the next epoch stake distribution
46-
if self
46+
match self
4747
.multi_signer
4848
.verify_single_signature_for_next_stake_distribution(
4949
signed_message,
5050
single_signature,
5151
)
5252
.await
53-
.is_ok()
5453
{
55-
debug!(
56-
self.logger, "Single signature party authenticated for next stake distribution";
57-
"party_id" => &single_signature.party_id,
58-
);
59-
true
60-
} else {
61-
debug!(
62-
self.logger, "Single signature party not authenticated";
63-
"party_id" => &single_signature.party_id,
64-
);
65-
false
54+
Ok(_) => {
55+
debug!(
56+
self.logger, "Single signature party authenticated for next stake distribution";
57+
"party_id" => &single_signature.party_id,
58+
);
59+
true
60+
}
61+
Err(next_stake_distribution_error) => {
62+
debug!(
63+
self.logger, "Single signature party not authenticated";
64+
"party_id" => &single_signature.party_id,
65+
"current_stake_distribution_error" => ?current_stake_distribution_error,
66+
"next_stake_distribution_error" => ?next_stake_distribution_error,
67+
);
68+
false
69+
}
6670
}
6771
}
6872
};

0 commit comments

Comments
 (0)