mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 09:57:56 +00:00
Improve logging (#2669)
* Improve logging * Review feedback * Fix some warning and some further logging changes
This commit is contained in:
@@ -279,7 +279,7 @@ async fn distribute_collation(
|
||||
if !state.view.contains(&relay_parent) {
|
||||
tracing::warn!(
|
||||
target: LOG_TARGET,
|
||||
relay_parent = %relay_parent,
|
||||
?relay_parent,
|
||||
"distribute collation message parent is outside of our view",
|
||||
);
|
||||
|
||||
@@ -299,7 +299,7 @@ async fn distribute_collation(
|
||||
tracing::warn!(
|
||||
target: LOG_TARGET,
|
||||
para_id = %id,
|
||||
relay_parent = %relay_parent,
|
||||
?relay_parent,
|
||||
"looks like no core is assigned to {} at {}", id, relay_parent,
|
||||
);
|
||||
|
||||
@@ -451,24 +451,32 @@ async fn advertise_collation(
|
||||
|
||||
match (state.collations.get_mut(&relay_parent), should_advertise) {
|
||||
(None, _) => {
|
||||
tracing::trace!(
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
relay_parent = ?relay_parent,
|
||||
?relay_parent,
|
||||
peer_id = %peer,
|
||||
"No collation to advertise.",
|
||||
);
|
||||
return
|
||||
},
|
||||
(_, false) => {
|
||||
tracing::trace!(
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
relay_parent = ?relay_parent,
|
||||
?relay_parent,
|
||||
peer_id = %peer,
|
||||
"Not advertising collation as we already advertised it to this validator.",
|
||||
);
|
||||
return
|
||||
}
|
||||
(Some(collation), true) => collation.status.advance_to_advertised(),
|
||||
(Some(collation), true) => {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
?relay_parent,
|
||||
peer_id = %peer,
|
||||
"Advertising collation.",
|
||||
);
|
||||
collation.status.advance_to_advertised()
|
||||
},
|
||||
}
|
||||
|
||||
let wire_message = protocol_v1::CollatorProtocolMessage::AdvertiseCollation(relay_parent, collating_on);
|
||||
|
||||
@@ -299,7 +299,7 @@ where
|
||||
Context: SubsystemContext<Message = CollatorProtocolMessage>
|
||||
{
|
||||
if !state.view.contains(&relay_parent) {
|
||||
tracing::trace!(
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
peer_id = %peer_id,
|
||||
para_id = %para_id,
|
||||
@@ -387,6 +387,11 @@ where
|
||||
|
||||
match msg {
|
||||
Declare(id) => {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
peer_id = ?origin,
|
||||
"Declared as collator",
|
||||
);
|
||||
state.known_collators.insert(origin.clone(), id);
|
||||
state.peer_views.entry(origin).or_default();
|
||||
}
|
||||
@@ -395,12 +400,22 @@ where
|
||||
state.advertisements.entry(origin.clone()).or_default().insert((para_id, relay_parent));
|
||||
|
||||
if let Some(collator) = state.known_collators.get(&origin) {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
peer_id = ?origin,
|
||||
%para_id,
|
||||
?relay_parent,
|
||||
"Received advertise collation",
|
||||
);
|
||||
|
||||
notify_candidate_selection(ctx, collator.clone(), relay_parent, para_id).await;
|
||||
} else {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
peer_id = ?origin,
|
||||
"advertise collation received from an unknown collator",
|
||||
%para_id,
|
||||
?relay_parent,
|
||||
"Advertise collation received from an unknown collator",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user