mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-25 05:55:42 +00:00
Adding some more logs (#6455)
* Adding some more logs More logs are always better! Joke aside, these logs help to debug certain issues. * Apply suggestions from code review
This commit is contained in:
@@ -326,6 +326,17 @@ impl RunningTask {
|
|||||||
&mut self,
|
&mut self,
|
||||||
validator: &AuthorityDiscoveryId,
|
validator: &AuthorityDiscoveryId,
|
||||||
) -> std::result::Result<ChunkFetchingResponse, TaskError> {
|
) -> std::result::Result<ChunkFetchingResponse, TaskError> {
|
||||||
|
gum::trace!(
|
||||||
|
target: LOG_TARGET,
|
||||||
|
origin = ?validator,
|
||||||
|
relay_parent = ?self.relay_parent,
|
||||||
|
group_index = ?self.group_index,
|
||||||
|
session_index = ?self.session_index,
|
||||||
|
chunk_index = ?self.request.index,
|
||||||
|
candidate_hash = ?self.request.candidate_hash,
|
||||||
|
"Starting chunk request",
|
||||||
|
);
|
||||||
|
|
||||||
let (full_request, response_recv) =
|
let (full_request, response_recv) =
|
||||||
OutgoingRequest::new(Recipient::Authority(validator.clone()), self.request);
|
OutgoingRequest::new(Recipient::Authority(validator.clone()), self.request);
|
||||||
let requests = Requests::ChunkFetchingV1(full_request);
|
let requests = Requests::ChunkFetchingV1(full_request);
|
||||||
@@ -346,13 +357,13 @@ impl RunningTask {
|
|||||||
Err(RequestError::InvalidResponse(err)) => {
|
Err(RequestError::InvalidResponse(err)) => {
|
||||||
gum::warn!(
|
gum::warn!(
|
||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
origin= ?validator,
|
origin = ?validator,
|
||||||
relay_parent = ?self.relay_parent,
|
relay_parent = ?self.relay_parent,
|
||||||
group_index = ?self.group_index,
|
group_index = ?self.group_index,
|
||||||
session_index = ?self.session_index,
|
session_index = ?self.session_index,
|
||||||
chunk_index = ?self.request.index,
|
chunk_index = ?self.request.index,
|
||||||
candidate_hash = ?self.request.candidate_hash,
|
candidate_hash = ?self.request.candidate_hash,
|
||||||
err= ?err,
|
err = ?err,
|
||||||
"Peer sent us invalid erasure chunk data"
|
"Peer sent us invalid erasure chunk data"
|
||||||
);
|
);
|
||||||
Err(TaskError::PeerError)
|
Err(TaskError::PeerError)
|
||||||
@@ -360,13 +371,13 @@ impl RunningTask {
|
|||||||
Err(RequestError::NetworkError(err)) => {
|
Err(RequestError::NetworkError(err)) => {
|
||||||
gum::debug!(
|
gum::debug!(
|
||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
origin= ?validator,
|
origin = ?validator,
|
||||||
relay_parent = ?self.relay_parent,
|
relay_parent = ?self.relay_parent,
|
||||||
group_index = ?self.group_index,
|
group_index = ?self.group_index,
|
||||||
session_index = ?self.session_index,
|
session_index = ?self.session_index,
|
||||||
chunk_index = ?self.request.index,
|
chunk_index = ?self.request.index,
|
||||||
candidate_hash = ?self.request.candidate_hash,
|
candidate_hash = ?self.request.candidate_hash,
|
||||||
err= ?err,
|
err = ?err,
|
||||||
"Some network error occurred when fetching erasure chunk"
|
"Some network error occurred when fetching erasure chunk"
|
||||||
);
|
);
|
||||||
Err(TaskError::PeerError)
|
Err(TaskError::PeerError)
|
||||||
@@ -374,7 +385,7 @@ impl RunningTask {
|
|||||||
Err(RequestError::Canceled(oneshot::Canceled)) => {
|
Err(RequestError::Canceled(oneshot::Canceled)) => {
|
||||||
gum::debug!(
|
gum::debug!(
|
||||||
target: LOG_TARGET,
|
target: LOG_TARGET,
|
||||||
origin= ?validator,
|
origin = ?validator,
|
||||||
relay_parent = ?self.relay_parent,
|
relay_parent = ?self.relay_parent,
|
||||||
group_index = ?self.group_index,
|
group_index = ?self.group_index,
|
||||||
session_index = ?self.session_index,
|
session_index = ?self.session_index,
|
||||||
|
|||||||
@@ -161,6 +161,12 @@ impl Network for Arc<NetworkService<Block, Hash>> {
|
|||||||
let peer_id = match peer {
|
let peer_id = match peer {
|
||||||
Recipient::Peer(peer_id) => Some(peer_id),
|
Recipient::Peer(peer_id) => Some(peer_id),
|
||||||
Recipient::Authority(authority) => {
|
Recipient::Authority(authority) => {
|
||||||
|
gum::trace!(
|
||||||
|
target: LOG_TARGET,
|
||||||
|
?authority,
|
||||||
|
"Searching for peer id to connect to authority",
|
||||||
|
);
|
||||||
|
|
||||||
let mut found_peer_id = None;
|
let mut found_peer_id = None;
|
||||||
// Note: `get_addresses_by_authority_id` searched in a cache, and it thus expected
|
// Note: `get_addresses_by_authority_id` searched in a cache, and it thus expected
|
||||||
// to be very quick.
|
// to be very quick.
|
||||||
@@ -196,6 +202,14 @@ impl Network for Arc<NetworkService<Block, Hash>> {
|
|||||||
Some(peer_id) => peer_id,
|
Some(peer_id) => peer_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
gum::trace!(
|
||||||
|
target: LOG_TARGET,
|
||||||
|
%peer_id,
|
||||||
|
protocol = %req_protocol_names.get_name(protocol),
|
||||||
|
?if_disconnected,
|
||||||
|
"Starting request",
|
||||||
|
);
|
||||||
|
|
||||||
NetworkService::start_request(
|
NetworkService::start_request(
|
||||||
self,
|
self,
|
||||||
peer_id,
|
peer_id,
|
||||||
|
|||||||
Reference in New Issue
Block a user