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

ignore irrelevant approvals in logs #3859

Merged
merged 3 commits into from
Oct 3, 2021
Merged
Changes from all commits
Commits
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
17 changes: 14 additions & 3 deletions node/core/approval-voting/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1288,10 +1288,21 @@ async fn handle_approved_ancestor(
);
},
Some(a_entry) => {
let n_assignments = a_entry.n_assignments();
let n_approvals = c_entry.approvals().count_ones();

let status = || {
let n_assignments = a_entry.n_assignments();

// Take the approvals, filtered by the assignments
// for this block.
let n_approvals = c_entry
.approvals()
.iter()
.by_val()
.enumerate()
.filter(|(i, approved)| {
*approved && a_entry.is_assigned(ValidatorIndex(*i as _))
})
.count();

format!(
"{}/{}/{}",
n_assignments,
Expand Down