Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small logging fixes for slashing #1558

Merged
merged 3 commits into from
Jun 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/unreleased/bug-fixes/1558-fix-slash-logging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Fixes the slash rate output in the query_slashes client
command and some redundancy in misbehavior reporting logs.
([#1558](https://github.com/anoma/namada/pull/1558))
4 changes: 1 addition & 3 deletions apps/src/lib/client/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1512,9 +1512,7 @@ pub async fn query_slashes<C: namada::ledger::queries::Client + Sync>(
writeln!(
w,
"Slash epoch {}, type {}, rate {}",
slash.epoch,
slash.r#type,
slash.r#type.get_slash_rate(&params)
slash.epoch, slash.r#type, slash.rate
)
.unwrap();
}
Expand Down
6 changes: 4 additions & 2 deletions apps/src/lib/node/ledger/shell/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -593,11 +593,13 @@ where
}
};
tracing::info!(
"Slashing {} for {} in epoch {}, block height {}",
"Slashing {} for {} in epoch {}, block height {} (current \
epoch = {})",
validator,
slash_type,
evidence_epoch,
evidence_height
evidence_height,
current_epoch
);
if let Err(err) = slash(
&mut self.wl_storage,
Expand Down
7 changes: 0 additions & 7 deletions proof_of_stake/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3003,13 +3003,6 @@ pub fn slash<S>(
where
S: StorageRead + StorageWrite,
{
tracing::info!(
"Slashing validator {} on new evidence from epoch {} (current epoch = \
{})",
validator,
evidence_epoch,
current_epoch
);
let evidence_block_height: u64 = evidence_block_height.into();
let slash = Slash {
epoch: evidence_epoch,
Expand Down