mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-23 20:05:49 +00:00
Allow fallback names for protocols (#8682)
* Allow fallback names for protocols * Apply suggestions from code review Co-authored-by: Roman Proskuryakov <humbug@deeptown.org> * Fix some issues * Fix compilation after merging master Co-authored-by: Roman Proskuryakov <humbug@deeptown.org>
This commit is contained in:
@@ -295,6 +295,7 @@ fn good_commit_leads_to_relay() {
|
||||
let _ = sender.unbounded_send(NetworkEvent::NotificationStreamOpened {
|
||||
remote: sender_id.clone(),
|
||||
protocol: GRANDPA_PROTOCOL_NAME.into(),
|
||||
negotiated_fallback: None,
|
||||
role: ObservedRole::Full,
|
||||
});
|
||||
|
||||
@@ -308,6 +309,7 @@ fn good_commit_leads_to_relay() {
|
||||
let _ = sender.unbounded_send(NetworkEvent::NotificationStreamOpened {
|
||||
remote: receiver_id.clone(),
|
||||
protocol: GRANDPA_PROTOCOL_NAME.into(),
|
||||
negotiated_fallback: None,
|
||||
role: ObservedRole::Full,
|
||||
});
|
||||
|
||||
@@ -442,6 +444,7 @@ fn bad_commit_leads_to_report() {
|
||||
let _ = sender.unbounded_send(NetworkEvent::NotificationStreamOpened {
|
||||
remote: sender_id.clone(),
|
||||
protocol: GRANDPA_PROTOCOL_NAME.into(),
|
||||
negotiated_fallback: None,
|
||||
role: ObservedRole::Full,
|
||||
});
|
||||
let _ = sender.unbounded_send(NetworkEvent::NotificationsReceived {
|
||||
|
||||
@@ -690,6 +690,7 @@ pub struct GrandpaParams<Block: BlockT, C, N, SC, VR> {
|
||||
pub fn grandpa_peers_set_config() -> sc_network::config::NonDefaultSetConfig {
|
||||
sc_network::config::NonDefaultSetConfig {
|
||||
notifications_protocol: communication::GRANDPA_PROTOCOL_NAME.into(),
|
||||
fallback_names: Vec::new(),
|
||||
// Notifications reach ~256kiB in size at the time of writing on Kusama and Polkadot.
|
||||
max_notification_size: 1024 * 1024,
|
||||
set_config: sc_network::config::SetConfig {
|
||||
@@ -1134,12 +1135,12 @@ fn local_authority_id(
|
||||
voters: &VoterSet<AuthorityId>,
|
||||
keystore: Option<&SyncCryptoStorePtr>,
|
||||
) -> Option<AuthorityId> {
|
||||
keystore.and_then(|keystore| {
|
||||
keystore.and_then(|keystore| {
|
||||
voters
|
||||
.iter()
|
||||
.find(|(p, _)| {
|
||||
SyncCryptoStore::has_keys(&**keystore, &[(p.to_raw_vec(), AuthorityId::ID)])
|
||||
})
|
||||
.map(|(p, _)| p.clone())
|
||||
.map(|(p, _)| p.clone())
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user