Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
Mirrored projects
polkadot
Commits
6dfdeabf
Unverified
Commit
6dfdeabf
authored
Jul 26, 2021
by
Koute
Committed by
GitHub
Jul 26, 2021
Browse files
Do not leak active head data in statement distribution (#3519)
parent
34ad3ab3
Pipeline
#148988
passed with stages
in 37 minutes and 19 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
node/network/statement-distribution/src/lib.rs
View file @
6dfdeabf
...
...
@@ -1847,6 +1847,16 @@ impl StatementDistribution {
FromOverseer
::
Signal
(
OverseerSignal
::
ActiveLeaves
(
ActiveLeavesUpdate
{
activated
,
deactivated
}))
=>
{
let
_timer
=
metrics
.time_active_leaves_update
();
for
deactivated
in
deactivated
{
if
active_heads
.remove
(
&
deactivated
)
.is_some
()
{
tracing
::
trace!
(
target
:
LOG_TARGET
,
hash
=
?
deactivated
,
"Deactivating leaf"
,
);
}
}
for
activated
in
activated
{
let
relay_parent
=
activated
.hash
;
let
span
=
PerLeafSpan
::
new
(
activated
.span
,
"statement-distribution"
);
...
...
@@ -1862,18 +1872,6 @@ impl StatementDistribution {
active_heads
.entry
(
relay_parent
)
.or_insert
(
ActiveHeadData
::
new
(
session_info
.validators
.clone
(),
session_index
,
span
));
active_heads
.retain
(|
h
,
_
|
{
let
live
=
!
deactivated
.contains
(
h
);
if
!
live
{
tracing
::
trace!
(
target
:
LOG_TARGET
,
hash
=
?
h
,
"Deactivating leaf"
,
);
}
live
});
}
}
FromOverseer
::
Signal
(
OverseerSignal
::
BlockFinalized
(
..
))
=>
{
...
...
Write
Preview
Supports
Markdown
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!
Cancel
Please
register
or
sign in
to comment