Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Consolidate subsystem spans so they are all children of the leaf-activated root span #6458

Merged
merged 104 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
7786864
Pass the PerLeafSpan as mutable reference to handle_new_head function
bredamatt Dec 20, 2022
ed87d46
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Dec 20, 2022
538a7ac
cargo +nightly fmt --all
bredamatt Dec 20, 2022
cfd4249
Add mock span for test
bredamatt Dec 21, 2022
926c7e6
cargo +nightly fmt --all
bredamatt Dec 21, 2022
3739d88
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Dec 21, 2022
97502e2
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Dec 21, 2022
dbd38ba
add new-blocks-hashes to span
bredamatt Dec 21, 2022
baba907
ref span in match statement, set span to disabled if not passed
bredamatt Dec 22, 2022
0202014
remove second match clause, make handle_new_head_span mutable
bredamatt Dec 22, 2022
f51e2c1
cargo +nightly fmt --all
bredamatt Dec 22, 2022
e7aa6de
improve tag on error and warning
bredamatt Dec 22, 2022
20bd43a
add imported blocks and info span
bredamatt Dec 22, 2022
e06f1c0
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Dec 22, 2022
eb283d9
cargo +nightly fmt --all
bredamatt Dec 22, 2022
2506e14
Improve error for imported_blocks_and_info trace
bredamatt Dec 22, 2022
67838d9
format tags on get_header_span
bredamatt Dec 22, 2022
59ecc9e
add lost-to-finality tag
bredamatt Dec 22, 2022
c799dc4
add missing bracket
bredamatt Dec 22, 2022
241bc18
- Add bitfield child span
bredamatt Jan 3, 2023
a478d34
- fix update-bitfield span tag
bredamatt Jan 3, 2023
3251f88
- Fix type conversion to u64
bredamatt Jan 3, 2023
c5eb910
- Cargo fmt
bredamatt Jan 3, 2023
582da10
- Test add_follows_from
bredamatt Jan 3, 2023
a81a7fc
- Revert as relationship between spans not working correctly
bredamatt Jan 3, 2023
bec69fc
- use drop to test if parent-child relationship can be re-established
bredamatt Jan 3, 2023
c4e6f4f
- remove bitfield span, check if parent-child relationship can be ree…
bredamatt Jan 4, 2023
123a5a5
- Remove dangling bitfield span which is not used, to see if parent-c…
bredamatt Jan 4, 2023
e8a4c70
Another dangling bitfield span
bredamatt Jan 4, 2023
6c4636a
cargo fmt
bredamatt Jan 4, 2023
f477139
- add imported blocks and info span
bredamatt Jan 4, 2023
fd32807
add tags before moving block_header to push scope
bredamatt Jan 4, 2023
94a4e47
- Add db-insertion span
bredamatt Jan 4, 2023
1ce0495
cargo fmt
bredamatt Jan 4, 2023
93878c6
fix types
bredamatt Jan 4, 2023
b3d74d4
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Jan 5, 2023
86e5ffc
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Jan 23, 2023
02230fe
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Jan 24, 2023
9f47eb3
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Jan 30, 2023
5c83c4c
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Jan 31, 2023
02d3d73
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 1, 2023
6dc83f9
* Pass mutable reference to span in handle_new_head
bredamatt Feb 1, 2023
a7eccdf
* Pass mutable reference to jaeger::Span in stead of PerLeafSpan
bredamatt Feb 1, 2023
9c07ac1
*Pass optional_span (optional argument) to determine_new_blocks util …
bredamatt Feb 1, 2023
363833e
* Add num-candidates int tag to block_import_span
bredamatt Feb 1, 2023
e9fbb2a
* Add head tag to cache_session_span
bredamatt Feb 1, 2023
6453bf4
* Create PerLeafSpan in handle_from_overseer (this is required to est…
bredamatt Feb 2, 2023
e671271
* Add candidate-import-span as child of block-import-span
bredamatt Feb 2, 2023
d8266f9
* Fix num-candidate tag to bitvec-len tag in candidate-import-span
bredamatt Feb 2, 2023
9f6078b
*Fix imported_blocKs_and_info span to create new-block-span as not de…
bredamatt Feb 2, 2023
75d4481
Consider the future::select! block
bredamatt Feb 6, 2023
d6cbd94
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 9, 2023
54e99ce
Use HashMap<Hash, jaeger::PerLeafSpan>
bredamatt Feb 9, 2023
596efa1
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 10, 2023
aaec541
Remove Stage 9
bredamatt Feb 10, 2023
ede3417
Add missing spans
bredamatt Feb 12, 2023
0ab2c78
cargo +nightly fmt --all
bredamatt Feb 12, 2023
0b08042
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 12, 2023
a7a8379
Remove optional span argument for determine_new_blocks
bredamatt Feb 12, 2023
7d9783f
* Remove no-longer needed default PerLeafSpan implementation
bredamatt Feb 13, 2023
06e448f
Remove unnecessary span
bredamatt Feb 13, 2023
9eca698
Remove another excessively spammy span
bredamatt Feb 13, 2023
c96022f
Add missing spans from State in import tests
bredamatt Feb 14, 2023
a61a21b
Use functional approach to get spans
bredamatt Feb 14, 2023
ae4e614
- Add functional approach for the approval-voting span
bredamatt Feb 15, 2023
7383ea2
Replace for hash_set in hash_set_iter with map closure
bredamatt Feb 16, 2023
a92d891
cargo +nightly fmt --all
bredamatt Feb 16, 2023
bb03a5b
Change from unconsumed `map` to `.for_each`
bredamatt Feb 16, 2023
43a47e9
cargo +nightly fmt --all
bredamatt Feb 16, 2023
a6d618f
Refactor add_para_id to validation_result_span
bredamatt Feb 16, 2023
4613d8b
cargo +nightly fmt --all
bredamatt Feb 16, 2023
73eff41
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 16, 2023
424838f
Remove duplicate tag
bredamatt Feb 16, 2023
13fbc82
Add missing tag to handle-approved-ancestor span
bredamatt Feb 16, 2023
b128549
Refactor span pruning to only invoke retain once
bredamatt Feb 20, 2023
9bffea4
Typo in span name
bredamatt Feb 20, 2023
bda1fd7
- Replace unwrap_or with unwrap_or_else due to lazy evaluation of tra…
bredamatt Feb 21, 2023
2ad9795
Add approval-distribution spans
bredamatt Feb 22, 2023
ae04669
- Add unwrap_or_else on note-approved-in-chain-selection
bredamatt Feb 22, 2023
58676a3
cargo +nightly fmt --all
bredamatt Feb 22, 2023
cbb38c6
- Add traceID tags were necessary in approval-voting and availability…
bredamatt Feb 23, 2023
495739c
Remove schedule-wakeup span as it will duplicate spans on existing wa…
bredamatt Feb 23, 2023
9af3b09
Remove a couple of warnings related to mutability
bredamatt Feb 23, 2023
e7706c0
Fix failing tests in availability distribution
bredamatt Feb 23, 2023
e3db7ee
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 24, 2023
35ac7bd
Add traceID tag to launch-approval and validation-result
bredamatt Feb 24, 2023
20ca68a
Reshuffle the validation and validation result spans to where more ap…
bredamatt Feb 24, 2023
aa601b9
- Add tranche and should-trigger tag to process-wakeup span
bredamatt Feb 24, 2023
75ade4f
cargo fmt
bredamatt Feb 24, 2023
b12d381
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 27, 2023
f05fa73
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Feb 28, 2023
209e1c9
- Adjustments after PR comments
bredamatt Feb 28, 2023
8bb2773
Move span pruning after other pruning logic
bredamatt Feb 28, 2023
3614167
Remove DerefMut - no longer needed
bredamatt Mar 1, 2023
c86dfb4
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Mar 1, 2023
d5a4e4c
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Mar 8, 2023
7e8af24
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Mar 10, 2023
4ec2c2d
Relabel request-chunk spans
bredamatt Mar 10, 2023
2b49b79
- Fix typo in span label
bredamatt Mar 10, 2023
cc9f7c9
Add new approval-voting span pruning logic
bredamatt Mar 10, 2023
7542161
Undo removal of !
bredamatt Mar 10, 2023
405e8c8
cargo fmt
bredamatt Mar 10, 2023
6fa18c2
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Mar 20, 2023
559b73b
Merge branch 'master' of github.com:paritytech/polkadot into bredamat…
bredamatt Mar 31, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 11 additions & 10 deletions node/core/approval-voting/src/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,25 +329,30 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
finalized_number: &Option<BlockNumber>,
) -> SubsystemResult<Vec<BlockImportedCandidates>> {
const MAX_HEADS_LOOK_BACK: BlockNumber = MAX_FINALITY_LAG;

let mut span = jaeger::Span::new(head, "approval-checking-import");
let _handle_new_head_span = state
.spans
.get(&head)
.map(|span| span.child("handle-new-head"))
.unwrap_or_else(|| jaeger::Span::new(head, "handle-new-head"))
.with_string_tag("head", format!("{:?}", head))
.with_stage(jaeger::Stage::ApprovalChecking);

let header = {
let (h_tx, h_rx) = oneshot::channel();
ctx.send_message(ChainApiMessage::BlockHeader(head, h_tx)).await;

match h_rx.await? {
Err(e) => {
gum::debug!(
target: LOG_TARGET,
"Chain API subsystem temporarily unreachable {}",
e,
);

// May be a better way of handling errors here.
return Ok(Vec::new())
},
Ok(None) => {
gum::warn!(target: LOG_TARGET, "Missing header for new head {}", head);
// May be a better way of handling warnings here.
return Ok(Vec::new())
},
Ok(Some(h)) => h,
Expand All @@ -363,7 +368,6 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
?e,
"Could not cache session info when processing head.",
);

return Ok(Vec::new())
},
Ok(Some(a @ SessionWindowUpdate::Advanced { .. })) => {
Expand Down Expand Up @@ -391,8 +395,6 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
.map_err(|e| SubsystemError::with_origin("approval-voting", e))
.await?;

span.add_uint_tag("new-blocks", new_blocks.len() as u64);

if new_blocks.is_empty() {
return Ok(Vec::new())
}
Expand Down Expand Up @@ -473,6 +475,7 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
);
(block_tick, no_show_duration)
};

let needed_approvals = session_info.needed_approvals;
let validator_group_lens: Vec<usize> =
session_info.validator_groups.iter().map(|v| v.len()).collect();
Expand Down Expand Up @@ -507,11 +510,9 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
result.len(),
);
}

result
}
};

// If all bits are already set, then send an approve message.
if approved_bitfield.count_ones() == approved_bitfield.len() {
ctx.send_message(ChainSelectionMessage::Approved(block_hash)).await;
Expand Down Expand Up @@ -602,7 +603,6 @@ pub(crate) async fn handle_new_head<Context, B: Backend>(
);

ctx.send_unbounded_message(ApprovalDistributionMessage::NewBlocks(approval_meta));

Ok(imported_candidates)
}

Expand Down Expand Up @@ -661,6 +661,7 @@ pub(crate) mod tests {
assignment_criteria: Box::new(MockAssignmentCriteria),
db,
db_config: TEST_CONFIG,
spans: HashMap::new(),
}
}

Expand Down
Loading