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
@@ -201,7 +201,7 @@ impl RequestFromBackers {
sender
.send_message(
NetworkBridgeMessage::SendRequests(
vec![Requests::AvailableDataFetching(req)],
vec![Requests::AvailableDataFetchingV1(req)],
IfDisconnected::ImmediateError,
)
.into(),
@@ -325,7 +325,7 @@ impl RequestChunksFromValidators {
let (req, res) =
OutgoingRequest::new(Recipient::Authority(validator), raw_request.clone());
requests.push(Requests::ChunkFetching(req));
requests.push(Requests::ChunkFetchingV1(req));
params.metrics.on_chunk_request_issued();
let timer = params.metrics.time_chunk_request();
@@ -292,7 +292,7 @@ impl TestState {
i += 1;
assert_matches!(
req,
Requests::ChunkFetching(req) => {
Requests::ChunkFetchingV1(req) => {
assert_eq!(req.payload.candidate_hash, candidate_hash);
let validator_index = req.payload.index.0 as usize;
@@ -341,7 +341,7 @@ impl TestState {
assert_matches!(
requests.pop().unwrap(),
Requests::AvailableDataFetching(req) => {
Requests::AvailableDataFetchingV1(req) => {
assert_eq!(req.payload.candidate_hash, candidate_hash);
let validator_index = self.validator_authority_id
.iter()