mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
approval-distribution: Update topology if authorities are discovered later (#2981)
Fixes: https://github.com/paritytech/polkadot-sdk/issues/2138. Especially on restart AuthorithyDiscovery cache is not populated so we create an invalid topology and messages won't be routed correctly for the entire session. This PR proposes to try to fix this by updating the topology as soon as we now the Authority/PeerId mapping, that should impact the situation dramatically. [This issue was hit yesterday](https://grafana.teleport.parity.io/goto/o9q2625Sg?orgId=1), on Westend and resulted in stalling the finality. # TODO - [x] Unit tests - [x] Test impact on versi --------- Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
This commit is contained in:
committed by
GitHub
parent
b57e53dc13
commit
a6952c7469
@@ -1892,7 +1892,9 @@ pub(crate) async fn handle_network_update<Context, R>(
|
||||
?authority_ids,
|
||||
"Updated `AuthorityDiscoveryId`s"
|
||||
);
|
||||
|
||||
topology_storage
|
||||
.get_current_topology_mut()
|
||||
.update_authority_ids(peer, &authority_ids);
|
||||
// Remove the authority IDs which were previously mapped to the peer
|
||||
// but aren't part of the new set.
|
||||
authorities.retain(|a, p| p != &peer || authority_ids.contains(a));
|
||||
|
||||
Reference in New Issue
Block a user