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
@@ -907,6 +907,10 @@ async fn handle_network_msg<Context>(
PeerMessage(remote, Versioned::V1(msg)) => {
handle_incoming_peer_message(ctx, runtime, state, remote, msg).await?;
},
UpdatedAuthorityIds(peer_id, authority_ids) => {
gum::trace!(target: LOG_TARGET, ?peer_id, ?authority_ids, "Updated authority ids");
state.peer_ids.insert(peer_id, authority_ids);
},
NewGossipTopology { .. } => {
// impossible!
},
@@ -1131,6 +1131,9 @@ async fn handle_network_msg<Context>(
PeerMessage(remote, Versioned::V1(msg)) => {
process_incoming_peer_message(ctx, state, remote, msg).await;
},
UpdatedAuthorityIds { .. } => {
// The validator side doesn't deal with `AuthorityDiscoveryId`s.
},
}
Ok(())