Enable async backing by default for Rococo/Westend (#3162)

This change is mainly for people running the local variants. They can
directly start with async backing.

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
Co-authored-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
This commit is contained in:
Bastian Köcher
2024-02-02 20:51:56 +01:00
committed by GitHub
parent 4d78c6eb89
commit e0674cb3ad
4 changed files with 73 additions and 19 deletions
@@ -202,7 +202,10 @@ impl CandidateStorage {
/// Note that an existing candidate has been backed.
pub fn mark_backed(&mut self, candidate_hash: &CandidateHash) {
if let Some(entry) = self.by_candidate_hash.get_mut(candidate_hash) {
gum::trace!(target: LOG_TARGET, ?candidate_hash, "Candidate marked as backed");
entry.state = CandidateState::Backed;
} else {
gum::trace!(target: LOG_TARGET, ?candidate_hash, "Candidate not found while marking as backed");
}
}
@@ -607,6 +607,14 @@ fn answer_get_backable_candidate(
let Some(child_hash) =
tree.select_child(&required_path, |candidate| storage.is_backed(candidate))
else {
gum::trace!(
target: LOG_TARGET,
?required_path,
para_id = ?para,
%relay_parent,
"Could not find any backable candidate",
);
let _ = tx.send(None);
return
};
@@ -621,6 +629,14 @@ fn answer_get_backable_candidate(
return
};
gum::trace!(
target: LOG_TARGET,
?relay_parent,
candidate_hash = ?child_hash,
?candidate_relay_parent,
"Found backable candidate",
);
let _ = tx.send(Some((child_hash, candidate_relay_parent)));
}