Add NetworkBridgeEvent::UpdatedAuthorityIds (#6227)

* Add NetworkBridgeEvent::UpdatedAuthorityIds

* update collator

* informing subsystems

* remove outdated authority data

* docs

* remove accidentally added line

* update docs

* emit event on session change

* emit

* check for update and update

* Update node/network/gossip-support/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/approval-distribution/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/bitfield-distribution/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/bridge/src/rx/mod.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/collator-protocol/src/validator_side/mod.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/collator-protocol/src/collator_side/mod.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/bridge/src/rx/mod.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/subsystem-types/src/messages.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/subsystem-types/src/messages.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/statement-distribution/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/network/statement-distribution/src/lib.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/subsystem-types/src/messages/network_bridge_event.rs

Co-authored-by: Andronik <write@reusable.software>

* Update node/subsystem-types/src/messages.rs

Co-authored-by: Andronik <write@reusable.software>

* fixes

* merge fixes

* make clippy happy again

* fix

---------

Co-authored-by: Andronik <write@reusable.software>
This commit is contained in:
Sergej Sakac
2023-07-21 11:48:15 -07:00
committed by GitHub
parent a200d4c9d7
commit ac253c7139
11 changed files with 123 additions and 3 deletions
@@ -302,6 +302,13 @@ pub enum NetworkBridgeRxMessage {
/// to the index in `canonical_shuffling`
shuffled_indices: Vec<usize>,
},
/// Inform the distribution subsystems about `AuthorityDiscoveryId` key rotations.
UpdatedAuthorityIds {
/// The `PeerId` of the peer that updated its `AuthorityDiscoveryId`s.
peer_id: PeerId,
/// The updated authority discovery keys of the peer.
authority_ids: HashSet<AuthorityDiscoveryId>,
},
}
/// Type of peer reporting
@@ -61,6 +61,9 @@ pub enum NetworkBridgeEvent<M> {
/// Our view has changed.
OurViewChange(OurView),
/// The authority discovery session key has been rotated.
UpdatedAuthorityIds(PeerId, HashSet<AuthorityDiscoveryId>),
}
impl<M> NetworkBridgeEvent<M> {
@@ -101,6 +104,8 @@ impl<M> NetworkBridgeEvent<M> {
NetworkBridgeEvent::PeerViewChange(*peer, view.clone()),
NetworkBridgeEvent::OurViewChange(ref view) =>
NetworkBridgeEvent::OurViewChange(view.clone()),
NetworkBridgeEvent::UpdatedAuthorityIds(ref peer, ref authority_ids) =>
NetworkBridgeEvent::UpdatedAuthorityIds(*peer, authority_ids.clone()),
})
}
}