mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 00:17:56 +00:00
Move block announcement protocol config out of Protocol (#12441)
* Move Role(s) to `sc-network-common` * Introduce `NotificationHandshake` type * Move block announce protocol config creation to `ChainSync` * Include block announcement into `notification_protocols` * Apply review comments * Remove unneeded include * Add missing include * Apply review comments
This commit is contained in:
@@ -34,14 +34,10 @@ use crate::{
|
||||
network_state::{
|
||||
NetworkState, NotConnectedPeer as NetworkStateNotConnectedPeer, Peer as NetworkStatePeer,
|
||||
},
|
||||
protocol::{
|
||||
self, message::generic::Roles, NotificationsSink, NotifsHandlerError, PeerInfo, Protocol,
|
||||
Ready,
|
||||
},
|
||||
protocol::{self, NotificationsSink, NotifsHandlerError, PeerInfo, Protocol, Ready},
|
||||
transport, ReputationChange,
|
||||
};
|
||||
|
||||
use codec::Encode as _;
|
||||
use futures::{channel::oneshot, prelude::*};
|
||||
use libp2p::{
|
||||
core::{either::EitherError, upgrade, ConnectedPoint, Executor},
|
||||
@@ -222,19 +218,13 @@ where
|
||||
local_peer_id.to_base58(),
|
||||
);
|
||||
|
||||
let default_notif_handshake_message = Roles::from(¶ms.role).encode();
|
||||
|
||||
let (protocol, peerset_handle, mut known_addresses) = Protocol::new(
|
||||
From::from(¶ms.role),
|
||||
params.chain.clone(),
|
||||
params.protocol_id.clone(),
|
||||
¶ms.fork_id,
|
||||
¶ms.network_config,
|
||||
(0..params.network_config.extra_sets.len())
|
||||
.map(|_| default_notif_handshake_message.clone())
|
||||
.collect(),
|
||||
params.metrics_registry.as_ref(),
|
||||
params.chain_sync,
|
||||
params.block_announce_config,
|
||||
)?;
|
||||
|
||||
// List of multiaddresses that we know in the network.
|
||||
|
||||
Reference in New Issue
Block a user