Diagnostics quality of life improvements (#2375)

* Implement `Debug` manually for CandidateHash

This will make candidate hashes printed consistently without the
`CandidateHash(` and `)` decorations.

* Do not print CompressedPov's guts

It can be overwhelming. Better just use the size.

* Log when candidate is generated

* Print para_id and candidate_hash upon receiving a collation
This commit is contained in:
Sergei Shulepov
2021-02-04 10:02:20 +01:00
committed by GitHub
parent 0cb1ccd122
commit 82a20778fd
4 changed files with 25 additions and 2 deletions
+7 -1
View File
@@ -327,7 +327,7 @@ pub mod v1 {
}
/// SCALE and Zstd encoded [`PoV`].
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)]
#[derive(Clone, Encode, Decode, PartialEq, Eq)]
pub struct CompressedPoV(Vec<u8>);
impl CompressedPoV {
@@ -374,6 +374,12 @@ pub mod v1 {
}
}
impl std::fmt::Debug for CompressedPoV {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "CompressedPoV({} bytes)", self.0.len())
}
}
/// Network messages used by the collator protocol subsystem
#[derive(Debug, Clone, Encode, Decode, PartialEq, Eq)]
pub enum CollatorProtocolMessage {