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
@@ -85,7 +85,7 @@ impl ChunkResponse {
impl IsRequest for ChunkFetchingRequest {
type Response = ChunkFetchingResponse;
const PROTOCOL: Protocol = Protocol::ChunkFetching;
const PROTOCOL: Protocol = Protocol::ChunkFetchingV1;
}
/// Request the advertised collation at that relay-parent.
@@ -107,7 +107,7 @@ pub enum CollationFetchingResponse {
impl IsRequest for CollationFetchingRequest {
type Response = CollationFetchingResponse;
const PROTOCOL: Protocol = Protocol::CollationFetching;
const PROTOCOL: Protocol = Protocol::CollationFetchingV1;
}
/// Request the advertised collation at that relay-parent.
@@ -130,7 +130,7 @@ pub enum PoVFetchingResponse {
impl IsRequest for PoVFetchingRequest {
type Response = PoVFetchingResponse;
const PROTOCOL: Protocol = Protocol::PoVFetching;
const PROTOCOL: Protocol = Protocol::PoVFetchingV1;
}
/// Request the entire available data for a candidate.
@@ -162,7 +162,7 @@ impl From<Option<AvailableData>> for AvailableDataFetchingResponse {
impl IsRequest for AvailableDataFetchingRequest {
type Response = AvailableDataFetchingResponse;
const PROTOCOL: Protocol = Protocol::AvailableDataFetching;
const PROTOCOL: Protocol = Protocol::AvailableDataFetchingV1;
}
/// Request for fetching a large statement via request/response.
@@ -188,7 +188,7 @@ pub enum StatementFetchingResponse {
impl IsRequest for StatementFetchingRequest {
type Response = StatementFetchingResponse;
const PROTOCOL: Protocol = Protocol::StatementFetching;
const PROTOCOL: Protocol = Protocol::StatementFetchingV1;
}
/// A dispute request.
@@ -213,5 +213,5 @@ pub enum DisputeResponse {
impl IsRequest for DisputeRequest {
type Response = DisputeResponse;
const PROTOCOL: Protocol = Protocol::DisputeSending;
const PROTOCOL: Protocol = Protocol::DisputeSendingV1;
}