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
ad3f3fb0
Unverified
Commit
ad3f3fb0
authored
Feb 26, 2021
by
Andronik Ordian
Committed by
GitHub
Feb 26, 2021
Browse files
validator_discovery: some logs to help identify authority discovery issues (#2533)
parent
950447e1
Pipeline
#126084
passed with stages
in 34 minutes and 36 seconds
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
node/network/bridge/src/validator_discovery.rs
View file @
ad3f3fb0
...
@@ -264,6 +264,8 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
...
@@ -264,6 +264,8 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
if
let
Some
(
addresses
)
=
result
{
if
let
Some
(
addresses
)
=
result
{
// We might have several `PeerId`s per `AuthorityId`
// We might have several `PeerId`s per `AuthorityId`
multiaddr_to_add
.extend
(
addresses
.into_iter
()
.take
(
MAX_ADDR_PER_PEER
));
multiaddr_to_add
.extend
(
addresses
.into_iter
()
.take
(
MAX_ADDR_PER_PEER
));
}
else
{
tracing
::
debug!
(
target
:
LOG_TARGET
,
"Authority Discovery couldn't resolve {:?}"
,
authority
);
}
}
}
}
...
@@ -282,6 +284,9 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
...
@@ -282,6 +284,9 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
}
}
// clean up revoked requests states
// clean up revoked requests states
//
// note that the `.rev()` here is important to guarantee `swap_remove`
// doesn't invalidate unprocessed `revoked_indices`
for
to_revoke
in
revoked_indices
.into_iter
()
.rev
()
{
for
to_revoke
in
revoked_indices
.into_iter
()
.rev
()
{
drop
(
state
.non_revoked_discovery_requests
.swap_remove
(
to_revoke
));
drop
(
state
.non_revoked_discovery_requests
.swap_remove
(
to_revoke
));
}
}
...
@@ -289,9 +294,15 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
...
@@ -289,9 +294,15 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
// multiaddresses to remove
// multiaddresses to remove
let
mut
multiaddr_to_remove
=
HashSet
::
new
();
let
mut
multiaddr_to_remove
=
HashSet
::
new
();
for
id
in
revoked_validators
.into_iter
()
{
for
id
in
revoked_validators
.into_iter
()
{
let
result
=
authority_discovery_service
.get_addresses_by_authority_id
(
id
)
.await
;
let
result
=
authority_discovery_service
.get_addresses_by_authority_id
(
id
.clone
()
)
.await
;
if
let
Some
(
addresses
)
=
result
{
if
let
Some
(
addresses
)
=
result
{
multiaddr_to_remove
.extend
(
addresses
.into_iter
());
multiaddr_to_remove
.extend
(
addresses
.into_iter
());
}
else
{
tracing
::
debug!
(
target
:
LOG_TARGET
,
"Authority Discovery couldn't resolve {:?} on cleanup, a leak is possible"
,
id
,
);
}
}
}
}
...
...
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