diff --git a/node-data/src/message.rs b/node-data/src/message.rs index 09b3216236..1f1441af1e 100644 --- a/node-data/src/message.rs +++ b/node-data/src/message.rs @@ -129,7 +129,10 @@ impl Message { Payload::Validation(v) => v.sign_info().signer, Payload::Ratification(r) => r.sign_info().signer, msg => { - warn!("Calling get_signer for {msg:?}"); + warn!( + "Calling get_signer for payload: {:?}", + msg.variant_name() + ); return None; } }; @@ -439,6 +442,24 @@ impl Payload { _ => {} } } + + fn variant_name(&self) -> &'static str { + match self { + Payload::Block(_) => "Block", + Payload::Candidate(_) => "Candidate", + Payload::Empty => "Empty", + Payload::GetBlocks(_) => "GetBlocks", + Payload::GetMempool(_) => "GetMempool", + Payload::GetResource(_) => "GetResource", + Payload::Inv(_) => "Inv", + Payload::Quorum(_) => "Quorum", + Payload::Ratification(_) => "Ratification", + Payload::Transaction(_) => "Transaction", + Payload::Validation(_) => "Validation", + Payload::ValidationQuorum(_) => "ValidationQuorum", + Payload::ValidationResult(_) => "ValidationResult", + } + } } impl From for Payload { diff --git a/node/src/network.rs b/node/src/network.rs index 4af87e0ef4..03e7a46c59 100644 --- a/node/src/network.rs +++ b/node/src/network.rs @@ -212,7 +212,7 @@ impl crate::Network for Kadcast { let mut encoded = vec![]; msg.write(&mut encoded).map_err(|err| { - error!("could not encode message {msg:?}: {err}"); + error!("could not encode message (version: {:?}, topics: {:?}, header: {:?}): {err}", msg.version(), msg.topic(), msg.header); anyhow::anyhow!("failed to broadcast: {err}") })?;