state: tidy process_queued tracing

Previously, this function was instrumented with a span containing the
parent hash that was the entry to the function.  But it doesn't make
sense to consider the work done by the function as happening in the
context of the supplied parent hash (as distinct from the context of the
hash of the newly arrived block, which is already contained in an outer
span), so this adds noise without conveying extra context.

Instead, use events that occur within the context of the existing spans.
This commit is contained in:
Henry de Valence 2020-11-20 19:54:57 -08:00 committed by teor
parent f0810b028d
commit 36cd76d590
1 changed files with 6 additions and 6 deletions

View File

@ -167,21 +167,21 @@ impl StateService {
/// Attempt to validate and commit all queued blocks whose parents have
/// recently arrived starting from `new_parent`, in breadth-first ordering.
#[instrument(skip(self))]
fn process_queued(&mut self, new_parent: block::Hash) {
let mut new_parents = vec![new_parent];
while let Some(parent) = new_parents.pop() {
let queued_children = self.queued_blocks.dequeue_children(parent);
while let Some(parent_hash) = new_parents.pop() {
let queued_children = self.queued_blocks.dequeue_children(parent_hash);
for QueuedBlock { block, rsp_tx } in queued_children {
let hash = block.hash();
let child_hash = block.hash();
tracing::trace!(?child_hash, "validating queued child");
let result = self
.validate_and_commit(block)
.map(|()| hash)
.map(|()| child_hash)
.map_err(BoxError::from);
let _ = rsp_tx.send(result);
new_parents.push(hash);
new_parents.push(child_hash);
}
}
}