Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
programskillforverification committed Nov 30, 2024
1 parent 6ad28e9 commit cf45e1a
Show file tree
Hide file tree
Showing 92 changed files with 2,778 additions and 2,465 deletions.
4,029 changes: 2,168 additions & 1,861 deletions Cargo.lock

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions polkadot/node/collation-generation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ impl CollationGenerationSubsystem {
..
}))) => {
if let Err(err) = self.handle_new_activation(activated.map(|v| v.hash), ctx).await {
gum::warn!(target: LOG_TARGET, err = ?err, "failed to handle new activation");
sp_tracing::warn!(target: LOG_TARGET, err = ?err, "failed to handle new activation");
}

false
Expand All @@ -152,7 +152,7 @@ impl CollationGenerationSubsystem {
msg: CollationGenerationMessage::SubmitCollation(params),
}) => {
if let Err(err) = self.handle_submit_collation(params, ctx).await {
gum::error!(target: LOG_TARGET, ?err, "Failed to submit collation");
sp_tracing::error!(target: LOG_TARGET, ?err, "Failed to submit collation");
}

false
Expand Down Expand Up @@ -200,7 +200,7 @@ impl CollationGenerationSubsystem {
{
Some(v) => v,
None => {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
relay_parent = ?relay_parent,
our_para = %config.para_id,
Expand Down Expand Up @@ -384,7 +384,7 @@ impl CollationGenerationSubsystem {
)
.await
{
gum::error!(
sp_tracing::error!(
target: LOG_TARGET,
"Failed to construct and distribute collation: {}",
err
Expand Down Expand Up @@ -555,7 +555,7 @@ async fn construct_and_distribute_receipt(
ccr.to_plain()
} else {
if commitments.core_selector().map_err(Error::CandidateReceiptCheck)?.is_some() {
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?pov_hash,
?relay_parent,
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3354,7 +3354,7 @@ async fn launch_approval<

let candidate_hash = candidate.hash();
let para_id = candidate.descriptor.para_id();
gum::trace!(target: LOG_TARGET, ?candidate_hash, ?para_id, "Recovering data.");
sp_tracing::trace!(target: LOG_TARGET, ?candidate_hash, ?para_id, "Recovering data.");

let timer = metrics.time_recover_and_approve();
sender
Expand Down
18 changes: 9 additions & 9 deletions polkadot/node/core/backing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ async fn handle_active_leaves_update<Context>(
fresh_relay_parent
},
Some((leaf, Err(e))) => {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
leaf_hash = ?leaf.hash,
err = ?e,
Expand Down Expand Up @@ -1166,7 +1166,7 @@ async fn construct_per_relay_parent_state<Context>(
per_session_cache.executor_params(session_index, parent, ctx.sender()).await;
let executor_params = try_runtime_api!(executor_params);

gum::debug!(target: LOG_TARGET, inject_core_index, ?parent, "New state");
sp_tracing::debug!(target: LOG_TARGET, inject_core_index, ?parent, "New state");

let (validator_groups, group_rotation_info) = try_runtime_api!(groups);

Expand Down Expand Up @@ -1615,7 +1615,7 @@ async fn import_statement<Context>(

match rx.await {
Err(oneshot::Canceled) => {
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
"Could not reach the Prospective Parachains subsystem."
);
Expand Down Expand Up @@ -1678,7 +1678,7 @@ async fn post_import_statement_actions<Context>(
rp_state.inject_core_index,
) {
let para_id = backed.candidate().descriptor.para_id();
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
candidate_hash = ?candidate_hash,
relay_parent = ?rp_state.parent,
Expand All @@ -1696,13 +1696,13 @@ async fn post_import_statement_actions<Context>(
// Notify statement distribution of backed candidate.
ctx.send_message(StatementDistributionMessage::Backed(candidate_hash)).await;
} else {
gum::debug!(target: LOG_TARGET, ?candidate_hash, "Cannot get BackedCandidate");
sp_tracing::debug!(target: LOG_TARGET, ?candidate_hash, "Cannot get BackedCandidate");
}
} else {
gum::debug!(target: LOG_TARGET, ?candidate_hash, "Candidate already known");
sp_tracing::debug!(target: LOG_TARGET, ?candidate_hash, "Candidate already known");
}
} else {
gum::debug!(target: LOG_TARGET, "No attested candidate");
sp_tracing::debug!(target: LOG_TARGET, "No attested candidate");
}

issue_new_misbehaviors(ctx, rp_state.parent, &mut rp_state.table);
Expand Down Expand Up @@ -2028,7 +2028,7 @@ async fn handle_second_message<Context>(
let relay_parent = candidate.descriptor().relay_parent();

if candidate.descriptor().persisted_validation_data_hash() != persisted_validation_data.hash() {
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?candidate_hash,
"Candidate backing was asked to second candidate with wrong PVD",
Expand Down Expand Up @@ -2062,7 +2062,7 @@ async fn handle_second_message<Context>(

// Sanity check that candidate is from our assignment.
if !matches!(assigned_paras, Some(paras) if paras.contains(&candidate.descriptor().para_id())) {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
our_assignment_core = ?rp_state.assigned_core,
our_assignment_paras = ?assigned_paras,
Expand Down
22 changes: 11 additions & 11 deletions polkadot/node/core/candidate-validation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ where
match util::runtime::fetch_claim_queue(sender, relay_parent).await {
Ok(maybe_cq) => maybe_cq,
Err(err) => {
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?relay_parent,
?err,
Expand Down Expand Up @@ -564,7 +564,7 @@ async fn update_active_leaves<Sender>(
{
let ancestors = get_block_ancestors(sender, update.activated.as_ref().map(|x| x.hash)).await;
if let Err(err) = validation_backend.update_active_leaves(update, ancestors).await {
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?err,
"cannot update active leaves in validation backend",
Expand All @@ -580,7 +580,7 @@ where
Ok(ProspectiveParachainsMode::Enabled { allowed_ancestry_len, .. }) =>
Some(allowed_ancestry_len),
res => {
gum::warn!(target: LOG_TARGET, ?res, "async backing is disabled");
sp_tracing::warn!(target: LOG_TARGET, ?res, "async backing is disabled");
None
},
}
Expand Down Expand Up @@ -609,7 +609,7 @@ where
match rx.await {
Ok(Ok(x)) => x,
res => {
gum::warn!(target: LOG_TARGET, ?res, "cannot request ancestors");
sp_tracing::warn!(target: LOG_TARGET, ?res, "cannot request ancestors");
vec![]
},
}
Expand Down Expand Up @@ -753,7 +753,7 @@ async fn validate_candidate_exhaustive(
let relay_parent = candidate_receipt.descriptor.relay_parent();
let para_id = candidate_receipt.descriptor.para_id();

gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
?validation_code_hash,
?para_id,
Expand All @@ -765,7 +765,7 @@ async fn validate_candidate_exhaustive(
(PvfExecKind::Backing(_) | PvfExecKind::BackingSystemParas(_), Some(session_index)) => {
let Some(expected_session_index) = maybe_expected_session_index else {
let error = "cannot fetch session index from the runtime";
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?relay_parent,
error,
Expand Down Expand Up @@ -874,7 +874,7 @@ async fn validate_candidate_exhaustive(
Err(ValidationFailed(e.to_string()))
},
Err(e @ ValidationError::ExecutionDeadline) => {
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?para_id,
?e,
Expand All @@ -884,7 +884,7 @@ async fn validate_candidate_exhaustive(
},
Ok(res) =>
if res.head_data.hash() != candidate_receipt.descriptor.para_head() {
gum::info!(target: LOG_TARGET, ?para_id, "Invalid candidate (para_head)");
sp_tracing::info!(target: LOG_TARGET, ?para_id, "Invalid candidate (para_head)");
Ok(ValidationResult::Invalid(InvalidCandidate::ParaHeadHashMismatch))
} else {
let committed_candidate_receipt = CommittedCandidateReceipt {
Expand All @@ -902,7 +902,7 @@ async fn validate_candidate_exhaustive(
if candidate_receipt.commitments_hash !=
committed_candidate_receipt.commitments.hash()
{
gum::info!(
sp_tracing::info!(
target: LOG_TARGET,
?para_id,
"Invalid candidate (commitments hash)"
Expand All @@ -923,7 +923,7 @@ async fn validate_candidate_exhaustive(
) => {
let Some(claim_queue) = maybe_claim_queue else {
let error = "cannot fetch the claim queue from the runtime";
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?relay_parent,
error
Expand All @@ -935,7 +935,7 @@ async fn validate_candidate_exhaustive(
if let Err(err) = committed_candidate_receipt
.check_core_index(&transpose_claim_queue(claim_queue.0))
{
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?err,
candidate_hash = ?candidate_receipt.hash(),
Expand Down
12 changes: 6 additions & 6 deletions polkadot/node/core/prospective-parachains/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ async fn handle_introduce_seconded_candidate(
added.push(*relay_parent);
},
Err(FragmentChainError::CandidateAlreadyKnown) => {
gum::trace!(
sp_tracing::trace!(
target: LOG_TARGET,
?para,
?relay_parent,
Expand All @@ -550,7 +550,7 @@ async fn handle_introduce_seconded_candidate(
added.push(*relay_parent);
},
Err(err) => {
gum::trace!(
sp_tracing::trace!(
target: LOG_TARGET,
?para,
?relay_parent,
Expand All @@ -573,14 +573,14 @@ async fn handle_introduce_seconded_candidate(
}

if added.is_empty() {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
para = ?para,
candidate = ?candidate_hash,
"Newly-seconded candidate cannot be kept under any relay parent",
);
} else {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
?para,
"Added/Kept seconded candidate {:?} on relay parents: {:?}",
Expand Down Expand Up @@ -779,7 +779,7 @@ fn answer_hypothetical_membership_request(
membership.push(*active_leaf);
},
Err(err) => {
gum::trace!(
sp_tracing::trace!(
target: LOG_TARGET,
para = ?para_id,
leaf = ?active_leaf,
Expand All @@ -794,7 +794,7 @@ fn answer_hypothetical_membership_request(

for (candidate, membership) in &response {
if membership.is_empty() {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
para = ?candidate.candidate_para(),
active_leaves = ?view.active_leaves,
Expand Down
8 changes: 4 additions & 4 deletions polkadot/node/core/pvf/src/execute/queue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl Queue {

let Some(job) = queue.remove(index) else { continue };
let _ = job.result_tx.send(Err(ValidationError::ExecutionDeadline));
gum::warn!(
sp_tracing::warn!(
target: LOG_TARGET,
?priority,
exec_kind = ?job.exec_kind,
Expand Down Expand Up @@ -381,7 +381,7 @@ fn handle_to_queue(queue: &mut Queue, to_queue: ToQueue) {
result_tx,
exec_kind,
} = pending_execution_request;
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
validation_code_hash = ?artifact.id.code_hash,
"enqueueing an artifact for execution",
Expand Down Expand Up @@ -791,7 +791,7 @@ impl Unscheduled {
}

fn select_next_priority(&self) -> Priority {
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
unscheduled = ?self.unscheduled.iter().map(|(p, q)| (*p, q.len())).collect::<HashMap<Priority, usize>>(),
counter = ?self.counter,
Expand Down Expand Up @@ -874,7 +874,7 @@ impl Unscheduled {
if self.counter.values().sum::<usize>() >= Self::SCHEDULING_WINDOW_SIZE {
self.reset_counter();
}
gum::debug!(
sp_tracing::debug!(
target: LOG_TARGET,
?priority,
"Job marked as scheduled",
Expand Down
1 change: 1 addition & 0 deletions polkadot/node/network/availability-recovery/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ rand = { workspace = true, default-features = true }
fatality = { workspace = true }
thiserror = { workspace = true }
async-trait = { workspace = true }
sp-tracing = { workspace = true, default-features = true }
gum = { workspace = true, default-features = true }

polkadot-erasure-coding = { workspace = true, default-features = true }
Expand Down
2 changes: 1 addition & 1 deletion polkadot/node/network/availability-recovery/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ pub fn log_error(result: Result<()>) -> std::result::Result<(), FatalError> {
impl JfyiError {
/// Log a `JfyiError`.
pub fn log(self) {
gum::warn!(target: LOG_TARGET, "{}", self);
sp_tracing::warn!(target: LOG_TARGET, "{}", self);
}
}
Loading

0 comments on commit cf45e1a

Please sign in to comment.