mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 08:15:41 +00:00
validator_discovery: pass PeerSet to the request (#2372)
* validator_discovery: pass PeerSet to the request * validator_discovery: track PeerSet of connected peers * validator_discovery: fix tests * validator_discovery: fix long line * some fixes * some validator_discovery logs * log validator discovery request * Also connect to validators on `DistributePoV`. * validator_discovery: store the whole state per peer_set * bump spec versions in kusama, polkadot and westend * Correcting doc. * validator_discovery: bump channel capacity * pov-distribution: some cleanup * this should fix the test, but it does not * I just got some brain damage while fixing this Why are you even reading this??? * wrap long line * address some review nits Co-authored-by: Robert Klotzner <robert.klotzner@gmx.at>
This commit is contained in:
@@ -244,10 +244,18 @@ where
|
||||
|
||||
Action::ConnectToValidators {
|
||||
validator_ids,
|
||||
peer_set,
|
||||
connected,
|
||||
} => {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
peer_set = ?peer_set,
|
||||
ids = ?validator_ids,
|
||||
"Received a validator connection request",
|
||||
);
|
||||
let (ns, ads) = validator_discovery.on_request(
|
||||
validator_ids,
|
||||
peer_set,
|
||||
connected,
|
||||
bridge.network_service,
|
||||
bridge.authority_discovery_service,
|
||||
@@ -257,11 +265,6 @@ where
|
||||
},
|
||||
|
||||
Action::ReportPeer(peer, rep) => {
|
||||
tracing::debug!(
|
||||
target: LOG_TARGET,
|
||||
peer = ?peer,
|
||||
"Peer sent us an invalid request",
|
||||
);
|
||||
bridge.network_service.report_peer(peer, rep).await?
|
||||
}
|
||||
|
||||
@@ -296,7 +299,11 @@ where
|
||||
PeerSet::Collation => &mut collation_peers,
|
||||
};
|
||||
|
||||
validator_discovery.on_peer_connected(&peer, &mut bridge.authority_discovery_service).await;
|
||||
validator_discovery.on_peer_connected(
|
||||
peer.clone(),
|
||||
peer_set,
|
||||
&mut bridge.authority_discovery_service,
|
||||
).await;
|
||||
|
||||
match peer_map.entry(peer.clone()) {
|
||||
hash_map::Entry::Occupied(_) => continue,
|
||||
@@ -358,7 +365,7 @@ where
|
||||
PeerSet::Collation => &mut collation_peers,
|
||||
};
|
||||
|
||||
validator_discovery.on_peer_disconnected(&peer);
|
||||
validator_discovery.on_peer_disconnected(&peer, peer_set);
|
||||
|
||||
if peer_map.remove(&peer).is_some() {
|
||||
match peer_set {
|
||||
|
||||
Reference in New Issue
Block a user