mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-08 05:27:27 +00:00
Make sure validator discovery works with a delayed peer to validator mapping (#1886)
* Make sure validator discovery works with a delayed peer to validator mapping Currently the implementation checks on connect of a peer if this peer is a validator by asking the authority discovery. It can now happen that the authority discovery is not yet aware that a given peer is an authority. This can for example happen on start up of the node. This pr changes the behavior, to make it possible to later associate a peer to a validator id. Instead of just storing the connected validators, we now store all connected peers with a vector of associated validator ids. When we get a request to connect to a given given set of validators, we start by checking the connected peers. If we didn't find a validator id in the connected peers, we ask the authority discovery for the peerid of a given authority id. When the returned peerid is part of our connected peers set, we cache and return the authority id. * Update node/network/bridge/Cargo.toml Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> * Update node/network/bridge/src/validator_discovery.rs Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com> * Update `Cargo.lock` Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
//! The Network Bridge Subsystem - protocol multiplexer for Polkadot.
|
||||
|
||||
#![deny(unused_crate_dependencies, unused_results)]
|
||||
#![deny(unused_crate_dependencies)]
|
||||
#![warn(missing_docs)]
|
||||
|
||||
|
||||
@@ -703,7 +703,7 @@ where
|
||||
PeerSet::Collation => &mut collation_peers,
|
||||
};
|
||||
|
||||
validator_discovery.on_peer_disconnected(&peer, &mut authority_discovery_service).await;
|
||||
validator_discovery.on_peer_disconnected(&peer);
|
||||
|
||||
if peer_map.remove(&peer).is_some() {
|
||||
let res = match peer_set {
|
||||
|
||||
Reference in New Issue
Block a user