Prepare for network protocol version upgrades (#5084)

* explicitly tag network requests with version

* fmt

* make PeerSet more aware of versioning

* some generalization of the network bridge to support upgrades

* walk back some renaming

* walk back some version stuff

* extract version from fallback

* remove V1 from NetworkBridgeUpdate

* add accidentally-removed timer

* implement focusing for versioned messages

* fmt

* fix up network bridge & tests

* remove inaccurate version check in bridge

* remove some TODO [now]s

* fix fallout in statement distribution

* fmt

* fallout in gossip-support

* fix fallout in collator-protocol

* fix fallout in bitfield-distribution

* fix fallout in approval-distribution

* fmt

* use never!

* fmt
This commit is contained in:
asynchronous rob
2022-04-21 11:34:59 -05:00
committed by GitHub
parent 203441981f
commit fc4b04db20
45 changed files with 942 additions and 594 deletions
@@ -75,15 +75,21 @@ impl<N: Network, AD: AuthorityDiscovery> Service<N, AD> {
);
// ask the network to connect to these nodes and not disconnect
// from them until removed from the set
//
// for peer-set management, the default should be used regardless of
// the negotiated version.
if let Err(e) = network_service
.set_reserved_peers(peer_set.into_protocol_name(), newly_requested)
.set_reserved_peers(peer_set.into_default_protocol_name(), newly_requested)
.await
{
gum::warn!(target: LOG_TARGET, err = ?e, "AuthorityDiscoveryService returned an invalid multiaddress");
}
// the addresses are known to be valid
//
// for peer-set management, the default should be used regardless of
// the negotiated version.
let _ = network_service
.remove_from_peers_set(peer_set.into_protocol_name(), peers_to_remove)
.remove_from_peers_set(peer_set.into_default_protocol_name(), peers_to_remove)
.await;
network_service