mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-29 12:37:25 +00:00
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:
@@ -771,23 +771,23 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() {
|
||||
// notify of peers and view
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
NetworkBridgeEvent::PeerConnected(peer_a.clone(), ObservedRole::Full, None),
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(peer_a.clone(), ObservedRole::Full, 1, None),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full, None),
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(peer_b.clone(), ObservedRole::Full, 1, None),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -795,7 +795,7 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -830,13 +830,13 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_a.clone(),
|
||||
protocol_v1::StatementDistributionMessage::Statement(
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::Statement(
|
||||
hash_a,
|
||||
statement.clone().into(),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -861,9 +861,9 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() {
|
||||
AllMessages::NetworkBridge(
|
||||
NetworkBridgeMessage::SendValidationMessage(
|
||||
recipients,
|
||||
protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
Versioned::V1(protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
protocol_v1::StatementDistributionMessage::Statement(r, s)
|
||||
),
|
||||
)),
|
||||
)
|
||||
) => {
|
||||
assert_eq!(recipients, vec![peer_b.clone()]);
|
||||
@@ -964,10 +964,11 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
// notify of peers and view
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_a.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Alice.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -976,10 +977,11 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_b.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Bob.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -987,10 +989,11 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_c.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Charlie.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -998,15 +1001,20 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
NetworkBridgeEvent::PeerConnected(peer_bad.clone(), ObservedRole::Full, None),
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_bad.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
None,
|
||||
),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -1014,21 +1022,21 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_c.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_bad.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -1066,10 +1074,12 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_a.clone(),
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(metadata.clone()),
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::LargeStatement(
|
||||
metadata.clone(),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -1084,7 +1094,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1102,10 +1112,12 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_c.clone(),
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(metadata.clone()),
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::LargeStatement(
|
||||
metadata.clone(),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -1114,10 +1126,12 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
// Malicious peer:
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_bad.clone(),
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(metadata.clone()),
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::LargeStatement(
|
||||
metadata.clone(),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -1133,7 +1147,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1153,7 +1167,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1174,7 +1188,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1209,7 +1223,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1230,7 +1244,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1277,9 +1291,9 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
|
||||
AllMessages::NetworkBridge(
|
||||
NetworkBridgeMessage::SendValidationMessage(
|
||||
mut recipients,
|
||||
protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
Versioned::V1(protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(meta)
|
||||
),
|
||||
)),
|
||||
)
|
||||
) => {
|
||||
gum::debug!(
|
||||
@@ -1463,10 +1477,11 @@ fn share_prioritizes_backing_group() {
|
||||
for (peer, pair) in dummy_peers.clone().into_iter().zip(dummy_pairs) {
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer,
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([pair.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -1475,7 +1490,7 @@ fn share_prioritizes_backing_group() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer, view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -1485,10 +1500,11 @@ fn share_prioritizes_backing_group() {
|
||||
// notify of peers and view
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_a.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Alice.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -1496,10 +1512,11 @@ fn share_prioritizes_backing_group() {
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_b.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Bob.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -1507,10 +1524,11 @@ fn share_prioritizes_backing_group() {
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_c.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Charlie.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -1518,17 +1536,23 @@ fn share_prioritizes_backing_group() {
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
NetworkBridgeEvent::PeerConnected(peer_bad.clone(), ObservedRole::Full, None),
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_bad.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
None,
|
||||
),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_other_group.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Dave.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -1537,7 +1561,7 @@ fn share_prioritizes_backing_group() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -1545,28 +1569,28 @@ fn share_prioritizes_backing_group() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_b.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_c.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_bad.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_other_group.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -1614,9 +1638,9 @@ fn share_prioritizes_backing_group() {
|
||||
AllMessages::NetworkBridge(
|
||||
NetworkBridgeMessage::SendValidationMessage(
|
||||
mut recipients,
|
||||
protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
Versioned::V1(protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(meta)
|
||||
),
|
||||
)),
|
||||
)
|
||||
) => {
|
||||
gum::debug!(
|
||||
@@ -1746,10 +1770,11 @@ fn peer_cant_flood_with_large_statements() {
|
||||
// notify of peers and view
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer_a.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
Some(HashSet::from([Sr25519Keyring::Alice.public().into()])),
|
||||
),
|
||||
),
|
||||
@@ -1758,7 +1783,7 @@ fn peer_cant_flood_with_large_statements() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer_a.clone(), view![hash_a]),
|
||||
),
|
||||
})
|
||||
@@ -1795,11 +1820,13 @@ fn peer_cant_flood_with_large_statements() {
|
||||
for _ in 0..MAX_LARGE_STATEMENTS_PER_SENDER + 1 {
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_a.clone(),
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(
|
||||
metadata.clone(),
|
||||
Versioned::V1(
|
||||
protocol_v1::StatementDistributionMessage::LargeStatement(
|
||||
metadata.clone(),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -1819,7 +1846,7 @@ fn peer_cant_flood_with_large_statements() {
|
||||
)) => {
|
||||
let reqs = reqs.pop().unwrap();
|
||||
let outgoing = match reqs {
|
||||
Requests::StatementFetching(outgoing) => outgoing,
|
||||
Requests::StatementFetchingV1(outgoing) => outgoing,
|
||||
_ => panic!("Unexpected request"),
|
||||
};
|
||||
let req = outgoing.payload;
|
||||
@@ -1949,14 +1976,19 @@ fn handle_multiple_seconded_statements() {
|
||||
for peer in all_peers.iter() {
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
NetworkBridgeEvent::PeerConnected(peer.clone(), ObservedRole::Full, None),
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerConnected(
|
||||
peer.clone(),
|
||||
ObservedRole::Full,
|
||||
1,
|
||||
None,
|
||||
),
|
||||
),
|
||||
})
|
||||
.await;
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerViewChange(peer.clone(), view![relay_parent_hash]),
|
||||
),
|
||||
})
|
||||
@@ -1991,7 +2023,7 @@ fn handle_multiple_seconded_statements() {
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::NewGossipTopology(gossip_topology),
|
||||
),
|
||||
})
|
||||
@@ -2027,13 +2059,13 @@ fn handle_multiple_seconded_statements() {
|
||||
// `PeerA` sends a `Seconded` message
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_a.clone(),
|
||||
protocol_v1::StatementDistributionMessage::Statement(
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::Statement(
|
||||
relay_parent_hash,
|
||||
statement.clone().into(),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -2065,9 +2097,9 @@ fn handle_multiple_seconded_statements() {
|
||||
AllMessages::NetworkBridge(
|
||||
NetworkBridgeMessage::SendValidationMessage(
|
||||
recipients,
|
||||
protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
Versioned::V1(protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
protocol_v1::StatementDistributionMessage::Statement(r, s)
|
||||
),
|
||||
)),
|
||||
)
|
||||
) => {
|
||||
assert!(!recipients.contains(&peer_b));
|
||||
@@ -2079,13 +2111,13 @@ fn handle_multiple_seconded_statements() {
|
||||
// `PeerB` sends a `Seconded` message: valid but known
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_b.clone(),
|
||||
protocol_v1::StatementDistributionMessage::Statement(
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::Statement(
|
||||
relay_parent_hash,
|
||||
statement.clone().into(),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -2130,13 +2162,13 @@ fn handle_multiple_seconded_statements() {
|
||||
// `PeerA` sends a `Valid` message
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_a.clone(),
|
||||
protocol_v1::StatementDistributionMessage::Statement(
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::Statement(
|
||||
relay_parent_hash,
|
||||
statement.clone().into(),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
@@ -2167,9 +2199,9 @@ fn handle_multiple_seconded_statements() {
|
||||
AllMessages::NetworkBridge(
|
||||
NetworkBridgeMessage::SendValidationMessage(
|
||||
recipients,
|
||||
protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
Versioned::V1(protocol_v1::ValidationProtocol::StatementDistribution(
|
||||
protocol_v1::StatementDistributionMessage::Statement(r, s)
|
||||
),
|
||||
)),
|
||||
)
|
||||
) => {
|
||||
assert!(!recipients.contains(&peer_b));
|
||||
@@ -2181,13 +2213,13 @@ fn handle_multiple_seconded_statements() {
|
||||
// `PeerB` sends a `Valid` message
|
||||
handle
|
||||
.send(FromOverseer::Communication {
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdateV1(
|
||||
msg: StatementDistributionMessage::NetworkBridgeUpdate(
|
||||
NetworkBridgeEvent::PeerMessage(
|
||||
peer_b.clone(),
|
||||
protocol_v1::StatementDistributionMessage::Statement(
|
||||
Versioned::V1(protocol_v1::StatementDistributionMessage::Statement(
|
||||
relay_parent_hash,
|
||||
statement.clone().into(),
|
||||
),
|
||||
)),
|
||||
),
|
||||
),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user