mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
approval votes checking logs (#3233)
* approval-voting: logs for invalid votes * proper errors for assignment checks * proper errors for approval checks
This commit is contained in:
@@ -624,13 +624,29 @@ impl State {
|
||||
if let Some(peer_knowledge) = entry.known_by.get_mut(&peer_id) {
|
||||
peer_knowledge.received.insert(fingerprint);
|
||||
}
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
?peer_id,
|
||||
"Got an `AcceptedDuplicate` assignment",
|
||||
);
|
||||
return;
|
||||
}
|
||||
AssignmentCheckResult::TooFarInFuture => {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
?peer_id,
|
||||
"Got an assignment too far in the future",
|
||||
);
|
||||
modify_reputation(ctx, peer_id, COST_ASSIGNMENT_TOO_FAR_IN_THE_FUTURE).await;
|
||||
return;
|
||||
}
|
||||
AssignmentCheckResult::Bad => {
|
||||
AssignmentCheckResult::Bad(error) => {
|
||||
tracing::info!(
|
||||
target: LOG_TARGET,
|
||||
?peer_id,
|
||||
%error,
|
||||
"Got a bad assignment from peer",
|
||||
);
|
||||
modify_reputation(ctx, peer_id, COST_INVALID_MESSAGE).await;
|
||||
return;
|
||||
}
|
||||
@@ -844,11 +860,12 @@ impl State {
|
||||
peer_knowledge.received.insert(fingerprint.clone());
|
||||
}
|
||||
}
|
||||
ApprovalCheckResult::Bad => {
|
||||
ApprovalCheckResult::Bad(error) => {
|
||||
modify_reputation(ctx, peer_id, COST_INVALID_MESSAGE).await;
|
||||
tracing::info!(
|
||||
target: LOG_TARGET,
|
||||
?peer_id,
|
||||
%error,
|
||||
"Got a bad approval from peer",
|
||||
);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user