From 2933d349f39a9011c0cfe64b9cc18d2c8ca3f7ef Mon Sep 17 00:00:00 2001 From: asynchronous rob Date: Wed, 19 Jul 2023 13:55:43 -0500 Subject: [PATCH] send network messages on main protocol name (#7515) --- node/network/bridge/src/network.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/node/network/bridge/src/network.rs b/node/network/bridge/src/network.rs index 5e733b44dd1c..cfff97a7eb2d 100644 --- a/node/network/bridge/src/network.rs +++ b/node/network/bridge/src/network.rs @@ -68,8 +68,11 @@ pub(crate) fn send_message( // list. The message payload can be quite large. If the underlying // network used `Bytes` this would not be necessary. let last_peer = peers.pop(); - // optimization: generate the protocol name once. - let protocol_name = protocol_names.get_name(peer_set, version); + + // We always send messages on the "main" name even when a negotiated + // fallback is used. The libp2p implementation handles the fallback + // under the hood. + let protocol_name = protocol_names.get_main_name(peer_set); peers.into_iter().for_each(|peer| { net.write_notification(peer, protocol_name.clone(), message.clone()); });