mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 03:58:04 +00:00
Additional logging for polkadot network protocols (#2684)
* Additional logging for polkadot network protocols * Additional log * Update node/network/bitfield-distribution/src/lib.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com> * Update node/network/availability-distribution/src/responder.rs * Added additional chunk info * Added additional peer info Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -101,6 +101,11 @@ impl Requester {
|
||||
where
|
||||
Context: SubsystemContext,
|
||||
{
|
||||
tracing::trace!(
|
||||
target: LOG_TARGET,
|
||||
?update,
|
||||
"Update fetching heads"
|
||||
);
|
||||
let ActiveLeavesUpdate {
|
||||
activated,
|
||||
deactivated,
|
||||
@@ -126,6 +131,11 @@ impl Requester {
|
||||
Err(err) => return Ok(Some(err)),
|
||||
Ok(cores) => cores,
|
||||
};
|
||||
tracing::trace!(
|
||||
target: LOG_TARGET,
|
||||
occupied_cores = ?cores,
|
||||
"Query occupied core"
|
||||
);
|
||||
if let Some(err) = self.add_cores(ctx, leaf, cores).await? {
|
||||
return Ok(Some(err));
|
||||
}
|
||||
|
||||
@@ -74,6 +74,15 @@ where
|
||||
|
||||
let result = chunk.is_some();
|
||||
|
||||
tracing::trace!(
|
||||
target: LOG_TARGET,
|
||||
hash = ?req.payload.candidate_hash,
|
||||
index = ?req.payload.index,
|
||||
peer = ?req.peer,
|
||||
has_data = ?chunk.is_some(),
|
||||
"Serving chunk",
|
||||
);
|
||||
|
||||
let response = match chunk {
|
||||
None => v1::AvailabilityFetchingResponse::NoSuchChunk,
|
||||
Some(chunk) => v1::AvailabilityFetchingResponse::Chunk(chunk.into()),
|
||||
@@ -99,5 +108,14 @@ where
|
||||
))
|
||||
.await;
|
||||
|
||||
rx.await.map_err(|e| Error::QueryChunkResponseChannel(e))
|
||||
rx.await.map_err(|e| {
|
||||
tracing::trace!(
|
||||
target: LOG_TARGET,
|
||||
?validator_index,
|
||||
?candidate_hash,
|
||||
error = ?e,
|
||||
"Error retrieving chunk",
|
||||
);
|
||||
Error::QueryChunkResponseChannel(e)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user