Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polkadot-sdk
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
parity
Mirrored projects
polkadot-sdk
Commits
bdb32563
Commit
bdb32563
authored
4 years ago
by
asynchronous rob
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
more diagnostic logs for approval-voting (#2618)
parent
7966d2b4
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
polkadot/node/core/approval-voting/src/lib.rs
+52
-6
52 additions, 6 deletions
polkadot/node/core/approval-voting/src/lib.rs
polkadot/node/core/approval-voting/src/persisted_entries.rs
+9
-0
9 additions, 0 deletions
polkadot/node/core/approval-voting/src/persisted_entries.rs
with
61 additions
and
6 deletions
polkadot/node/core/approval-voting/src/lib.rs
+
52
−
6
View file @
bdb32563
...
...
@@ -715,6 +715,7 @@ async fn handle_approved_ancestor(
lower_bound
:
BlockNumber
,
)
->
SubsystemResult
<
Option
<
(
Hash
,
BlockNumber
)
>>
{
const
MAX_TRACING_WINDOW
:
usize
=
200
;
const
ABNORMAL_DEPTH_THRESHOLD
:
usize
=
5
;
use
bitvec
::{
order
::
Lsb0
,
vec
::
BitVec
};
...
...
@@ -789,8 +790,53 @@ async fn handle_approved_ancestor(
// ancestry is moving backwards.
all_approved_max
=
Some
((
block_hash
,
target_number
-
i
as
BlockNumber
));
}
}
else
if
bits
.len
()
<=
ABNORMAL_DEPTH_THRESHOLD
{
all_approved_max
=
None
;
}
else
{
all_approved_max
=
None
;
let
unapproved
:
Vec
<
_
>
=
entry
.unapproved_candidates
()
.collect
();
tracing
::
debug!
(
target
:
LOG_TARGET
,
"Block {} is {} blocks deep and has {}/{} candidates approved"
,
block_hash
,
bits
.len
()
-
1
,
unapproved
.len
(),
entry
.candidates
()
.len
(),
);
for
candidate_hash
in
unapproved
{
match
db
.load_candidate_entry
(
&
candidate_hash
)
?
{
None
=>
{
tracing
::
warn!
(
target
:
LOG_TARGET
,
?
candidate_hash
,
"Missing expected candidate in DB"
,
);
continue
;
}
Some
(
c_entry
)
=>
{
match
c_entry
.approval_entry
(
&
block_hash
)
{
None
=>
{
tracing
::
warn!
(
target
:
LOG_TARGET
,
?
candidate_hash
,
?
block_hash
,
"Missing expected approval entry under candidate."
,
);
}
Some
(
a_entry
)
=>
{
let
our_assignment
=
a_entry
.our_assignment
();
tracing
::
debug!
(
target
:
LOG_TARGET
,
?
our_assignment
,
);
}
}
}
}
}
}
}
...
...
@@ -898,7 +944,7 @@ fn schedule_wakeup_action(
};
match
maybe_action
{
Some
(
Action
::
ScheduleWakeup
{
ref
tick
,
..
})
=>
tracing
::
debug
!
(
Some
(
Action
::
ScheduleWakeup
{
ref
tick
,
..
})
=>
tracing
::
trace
!
(
target
:
LOG_TARGET
,
"Scheduling next wakeup at {} for candidate {} under block ({}, tick={})"
,
tick
,
...
...
@@ -906,7 +952,7 @@ fn schedule_wakeup_action(
block_hash
,
block_tick
,
),
None
=>
tracing
::
debug
!
(
None
=>
tracing
::
trace
!
(
target
:
LOG_TARGET
,
"No wakeup needed for candidate {} under block ({}, tick={})"
,
candidate_hash
,
...
...
@@ -1354,7 +1400,7 @@ fn process_wakeup(
let
tranche_now
=
state
.clock
.tranche_now
(
state
.slot_duration_millis
,
block_entry
.slot
());
tracing
::
debug
!
(
tracing
::
trace
!
(
target
:
LOG_TARGET
,
"Processing wakeup at tranche {} for candidate {} under block {}"
,
tranche_now
,
...
...
@@ -1413,7 +1459,7 @@ fn process_wakeup(
.position
(|(
_
,
h
)|
&
candidate_hash
==
h
);
if
let
Some
(
i
)
=
index_in_candidate
{
tracing
::
debug
!
(
tracing
::
trace
!
(
target
:
LOG_TARGET
,
"Launching approval work for candidate {:?} in block {}"
,
(
&
candidate_hash
,
candidate_entry
.candidate_receipt
()
.descriptor.para_id
),
...
...
@@ -1472,7 +1518,7 @@ async fn launch_approval(
let
candidate_hash
=
candidate
.hash
();
tracing
::
debug
!
(
tracing
::
trace
!
(
target
:
LOG_TARGET
,
"Recovering data for candidate {:?}"
,
(
candidate_hash
,
candidate
.descriptor.para_id
),
...
...
@@ -1576,7 +1622,7 @@ async fn launch_approval(
// Validation checked out. Issue an approval command. If the underlying service is unreachable,
// then there isn't anything we can do.
tracing
::
debug
!
(
tracing
::
trace
!
(
target
:
LOG_TARGET
,
"Candidate Valid {:?}"
,
(
candidate_hash
,
para_id
),
...
...
This diff is collapsed.
Click to expand it.
polkadot/node/core/approval-voting/src/persisted_entries.rs
+
9
−
0
View file @
bdb32563
...
...
@@ -323,6 +323,15 @@ impl BlockEntry {
self
.approved_bitfield
.all
()
}
/// Iterate over all unapproved candidates.
pub
fn
unapproved_candidates
(
&
self
)
->
impl
Iterator
<
Item
=
CandidateHash
>
+
'_
{
self
.approved_bitfield
.iter
()
.enumerate
()
.filter_map
(
move
|(
i
,
a
)|
if
*
a
{
Some
(
self
.candidates
[
i
]
.1
)
}
else
{
None
})
}
#[cfg(test)]
pub
fn
block_hash
(
&
self
)
->
Hash
{
self
.block_hash
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment