From d6abe70c062b5c77c489ec8a757f4606732b50ab Mon Sep 17 00:00:00 2001 From: Robert Klotzner Date: Thu, 19 Aug 2021 20:07:59 +0200 Subject: [PATCH] Better logs. (#3650) --- polkadot/node/core/approval-voting/src/lib.rs | 2 ++ polkadot/node/network/availability-recovery/src/lib.rs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/polkadot/node/core/approval-voting/src/lib.rs b/polkadot/node/core/approval-voting/src/lib.rs index aae4a630a3..86dbd71485 100644 --- a/polkadot/node/core/approval-voting/src/lib.rs +++ b/polkadot/node/core/approval-voting/src/lib.rs @@ -502,6 +502,8 @@ impl ApprovalState { } struct CurrentlyCheckingSet { + /// Invariant: The contained `Vec` needs to stay sorted as we are using `binary_search_by_key` + /// on it. candidate_hash_map: HashMap>, currently_checking: FuturesUnordered>, } diff --git a/polkadot/node/network/availability-recovery/src/lib.rs b/polkadot/node/network/availability-recovery/src/lib.rs index ea4d484a41..2f9696cdfa 100644 --- a/polkadot/node/network/availability-recovery/src/lib.rs +++ b/polkadot/node/network/availability-recovery/src/lib.rs @@ -300,12 +300,14 @@ impl RequestChunksPhase { if erasure_chunk_hash != anticipated_hash { tracing::debug!( target: LOG_TARGET, + candidate_hash = ?params.candidate_hash, ?validator_index, "Merkle proof mismatch", ); } else { tracing::trace!( target: LOG_TARGET, + candidate_hash = ?params.candidate_hash, ?validator_index, "Received valid chunk.", ); @@ -314,6 +316,7 @@ impl RequestChunksPhase { } else { tracing::debug!( target: LOG_TARGET, + candidate_hash = ?params.candidate_hash, ?validator_index, "Invalid Merkle proof", ); @@ -323,6 +326,7 @@ impl RequestChunksPhase { Err((validator_index, e)) => { tracing::debug!( target: LOG_TARGET, + candidate_hash= ?params.candidate_hash, err = ?e, ?validator_index, "Failure requesting chunk",