Repository: mintlayer/mintlayer-core
Pull request #639 (2023-01-18 16:09:41)

Enable p2p test that was disabled before


Patch:
diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml
index 74629f72b..c4a0744f3 100644
--- a/p2p/Cargo.toml
+++ b/p2p/Cargo.toml
@@ -45,13 +45,13 @@ p2p-backend-test-suite = { path = "backend-test-suite" }
 portpicker = "0.1"
 
 [[test]]
-name = "backend_tcp"
+name = "backend_mock_tcp"
 harness = false
 
 [[test]]
-name = "backend_channels"
+name = "backend_mock_channels"
 harness = false
 
 [[test]]
-name = "backend_noise"
+name = "backend_mock_noise"
 harness = false
diff --git a/p2p/src/lib.rs b/p2p/src/lib.rs
index a9ff10690..e13d72b3a 100644
--- a/p2p/src/lib.rs
+++ b/p2p/src/lib.rs
@@ -42,9 +42,9 @@ use crate::{
     error::{ConversionError, P2pError},
     event::{PeerManagerEvent, SyncEvent},
     net::{
-        default_backend::{
+        mock::{
             transport::{NoiseEncryptionAdapter, NoiseTcpTransport},
-            DefaultNetworkingService,
+            MockService,
         },
         ConnectivityService, NetworkingService, SyncingMessagingService,
     },
@@ -64,7 +64,7 @@ struct P2p<T: NetworkingService> {
 
 impl<T> P2p<T>
 where
-    T: 'static + NetworkingService + Send,
+    T: 'static + NetworkingService,
     T::ConnectivityHandle: ConnectivityService<T>,
     T::SyncingMessagingHandle: SyncingMessagingService<T>,
 {
@@ -157,10 +157,10 @@ pub async fn make_p2p(
     mempool_handle: mempool::MempoolHandle,
 ) -> Result<Box<dyn P2pInterface>> {
     let stream_adapter = NoiseEncryptionAdapter::gen_new();
-    let base_transport = net::default_backend::transport::TcpTransportSocket::new();
+    let base_transport = net::mock::transport::TcpTransportSocket::new();
     let transport = NoiseTcpTransport::new(stream_adapter, base_transport);
 
-    let p2p = P2p::<DefaultNetworkingService<NoiseTcpTransport>>::new(
+    let p2p = P2p::<MockService<NoiseTcpTransport>>::new(
         transport,
         chain_config,
         p2p_config,
diff --git a/p2p/src/net/default_backend/backend.rs b/p2p/src/net/mock/backend.rs
similarity index 93%
rename from p2p/src/net/default_backend/backend.rs
rename to p2p/src/net/mock/backend.rs
index 24b7da57e..97550c9eb 100644
--- a/p2p/src/net/default_backend/backend.rs
+++ b/p2p/src/net/mock/backend.rs
@@ -13,7 +13,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-//! Networking backend
+//! Mock networking backend
 //!
 //! Every connected peer gets unique ID (generated locally from a counter).
 
@@ -39,16 +39,16 @@ use crate::{
     error::{DialError, P2pError, PeerError, PublishError},
     message::{self, PeerManagerRequest, PeerManagerResponse, SyncRequest, SyncResponse},
     net::{
-        default_backend::{
+        mock::{
             constants::ANNOUNCEMENT_MAX_SIZE,
             peer, request_manager,
             transport::{TransportListener, TransportSocket},
             types::{
-                Command, ConnectivityEvent, Event, Message, PeerEvent, PeerId, RequestId,
-                SyncingEvent,
+                Command, ConnectivityEvent, Message, MockEvent, MockPeerId, MockPeerInfo,
+                MockRequestId, PeerEvent, SyncingEvent,
             },
         },
-        types::{PeerInfo, PubSubTopic},
+        types::PubSubTopic,
         Announcement,
     },
 };
@@ -58,14 +58,14 @@ use super::{peer::PeerRole, transport::TransportAddress, types::HandshakeNonce};
 /// Active peer data
 struct PeerContext {
     subscriptions: BTreeSet<PubSubTopic>,
-    tx: mpsc::Sender<Event>,
+    tx: mpsc::Sender<MockEvent>,
 }
 
 /// Pending peer data (until handshake message is received)
 struct PendingPeerContext<A> {
     address: A,
     peer_role: PeerRole,
-    tx: mpsc::Sender<Event>,
+    tx: mpsc::Sender<MockEvent>,
 }
 
 pub struct Backend<T: TransportSocket> {
@@ -85,16 +85,16 @@ pub struct Backend<T: TransportSocket> {
     cmd_rx: mpsc::Receiver<Command<T>>,
 
     /// Active peers
-    peers: HashMap<PeerId, PeerContext>,
+    peers: HashMap<MockPeerId, PeerContext>,
 
     /// Pending connections
-    pending: HashMap<PeerId, PendingPeerContext<T::Address>>,
+    pending: HashMap<MockPeerId, PendingPeerContext<T::Address>>,
 
     /// RX channel for receiving events from peers
     #[allow(clippy::type_complexity)]
     peer_chan: (
-        mpsc::Sender<(PeerId, PeerEvent)>,
-        mpsc::Receiver<(PeerId, PeerEvent)>,
+        mpsc::Sender<(MockPeerId, PeerEvent)>,
+        mpsc::Receiver<(MockPeerId, PeerEvent)>,
     ),
 
     /// TX channel for sending events to the frontend
@@ -153,7 +153,7 @@ where
 
                 self.create_peer(
                     socket,
-                    PeerId::new(),
+                    MockPeerId::new(),
                     PeerRole::Outbound { handshake_nonce },
                     address,
                 )
@@ -173,10 +173,10 @@ where
     }
 
     /// Disconnect remote peer by id
-    async fn disconnect_peer(&mut self, peer_id: &PeerId) -> crate::Result<()> {
+    async fn disconnect_peer(&mut self, peer_id: &MockPeerId) -> crate::Result<()> {
         self.request_mgr.unregister_peer(peer_id);
         if let Some(context) = self.peers.remove(peer_id) {
-            context.tx.send(Event::Disconnect).await.map_err(P2pError::from)
+            context.tx.send(MockEvent::Disconnect).await.map_err(P2pError::from)
         } else {
             // TODO: Think about error handling. Currently we simply follow the libp2p behaviour.
             log::error!("{peer_id} peer doesn't exist");
@@ -187,8 +187,8 @@ where
     /// Sends a request to the remote peer.
     async fn send_request(
         &mut self,
-        request_id: RequestId,
-        peer_id: PeerId,
+        request_id: MockRequestId,
+        peer_id: MockPeerId,
         request: message::Request,
     ) -> crate::Result<()> {
         let peer = self
@@ -197,7 +197,7 @@ where
             .ok_or(P2pError::PeerError(PeerError::PeerDoesntExist))?;
 
         let request = self.request_mgr.make_request(request_id, request)?;
-        peer.tx.send(Event::SendMessage(request)).await.map_err(P2pError::from)?;
+        peer.tx.send(MockEvent::SendMessage(request)).await.map_err(P2pError::from)?;
 
         Ok(())
     }
@@ -205,7 +205,7 @@ where
     /// Send response to a request
     async fn send_response(
         &mut self,
-        request_id: RequestId,
+        request_id: MockRequestId,
         response: message::Response,
     ) -> crate::Result<()> {
         log::trace!("try to send response to request, request id {request_id}");
@@ -216,7 +216,7 @@ where
                 .get_mut(&peer_id)
                 .ok_or(P2pError::PeerError(PeerError::PeerDoesntExist))?
                 .tx
-                .send(Event::SendMessage(response))
+                .send(MockEvent::SendMessage(response))
                 .await
                 .map_err(P2pError::from);
         }
@@ -238,7 +238,7 @@ where
             .filter(|(_, peer)| peer.subscriptions.contains(&topic))
             .map(|(id, peer)| {
                 peer.tx
-                    .send(Event::SendMessage(Box::new(Message::Announcement {
+                    .send(MockEvent::SendMessage(Box::new(Message::Announcement {
                         announcement: announcement.clone(),
                     })))
                     .inspect_err(move |e| {
@@ -256,8 +256,8 @@ where
     /// Handle incoming request
     async fn handle_incoming_request(
         &mut self,
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         request: message::Request,
     ) -> crate::Result<()> {
         log::trace!("request received from peer {peer_id}, request id {request_id}");
@@ -298,8 +298,8 @@ where
     /// Handle incoming response
     async fn handle_incoming_response(
         &mut self,
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         response: message::Response,
     ) -> crate::Result<()> {
         log::trace!("response received from peer {peer_id}, request id {request_id}");
@@ -337,7 +337,7 @@ where
 
     async fn handle_announcement(
         &mut self,
-        peer_id: PeerId,
+        peer_id: MockPeerId,
         announcement: Announcement,
     ) -> crate::Result<()> {
         let size = announcement.encode().len();
@@ -373,7 +373,7 @@ where
 
                     self.create_peer(
                         stream,
-                        PeerId::new(),
+                        MockPeerId::new(),
                         PeerRole::Inbound,
                         address,
                     )?;
@@ -402,7 +402,7 @@ where
     fn create_peer(
         &mut self,
         socket: T::Stream,
-        remote_peer_id: PeerId,
+        remote_peer_id: MockPeerId,
         peer_role: PeerRole,
         address: T::Address,
     ) -> crate::Result<()> {
@@ -488,7 +488,11 @@ where
         Ok(false)
     }
 
-    async fn handle_peer_event(&mut self, peer_id: PeerId, event: PeerEvent) -> crate::Result<()> {
+    async fn handle_peer_event(
+        &mut self,
+        peer_id: MockPeerId,
+        event: PeerEvent,
+    ) -> crate::Result<()> {
         match event {
             PeerEvent::PeerInfoReceived {
                 network,
@@ -516,7 +520,7 @@ where
                         self.conn_tx
                             .send(ConnectivityEvent::OutboundAccepted {
                                 address,
-                                peer_info: PeerInfo {
+                                peer_info: MockPeerInfo {
                                     peer_id,
                                     network,
                                     version,
@@ -532,7 +536,7 @@ where
                         self.conn_tx
                             .send(ConnectivityEvent::InboundAccepted {
                                 address: address.clone(),
-                                peer_info: PeerInfo {
+                                peer_info: MockPeerInfo {
                                     peer_id,
                                     network,
                                     version,
@@ -569,7 +573,7 @@ where
         Ok(())
     }
 
-    async fn handle_message(&mut self, peer_id: PeerId, message: Message) -> crate::Result<()> {
+    async fn handle_message(&mut self, peer_id: MockPeerId, message: Message) -> crate::Result<()> {
         match message {
             Message::Handshake(_) => {
                 log::error!("peer {peer_id} sent handshaking message");
diff --git a/p2p/src/net/default_backend/constants.rs b/p2p/src/net/mock/constants.rs
similarity index 100%
rename from p2p/src/net/default_backend/constants.rs
rename to p2p/src/net/mock/constants.rs
diff --git a/p2p/src/net/default_backend/mod.rs b/p2p/src/net/mock/mod.rs
similarity index 85%
rename from p2p/src/net/default_backend/mod.rs
rename to p2p/src/net/mock/mod.rs
index 73d14fe5c..b484963e3 100644
--- a/p2p/src/net/default_backend/mod.rs
+++ b/p2p/src/net/mock/mod.rs
@@ -33,54 +33,54 @@ use crate::{
     error::{P2pError, PublishError},
     message::{self, PeerManagerRequest, PeerManagerResponse, SyncRequest, SyncResponse},
     net::{
-        default_backend::{
+        mock::{
             constants::ANNOUNCEMENT_MAX_SIZE,
             transport::{TransportListener, TransportSocket},
-            types::{PeerId, RequestId},
+            types::{MockPeerId, MockPeerInfo, MockRequestId},
         },
-        types::{ConnectivityEvent, PubSubTopic, SyncingEvent},
+        types::{ConnectivityEvent, PeerInfo, PubSubTopic, SyncingEvent},
         ConnectivityService, NetworkingService, SyncingMessagingService,
     },
 };
 
 #[derive(Debug)]
-pub struct DefaultNetworkingService<T: TransportSocket>(PhantomData<T>);
+pub struct MockService<T: TransportSocket>(PhantomData<T>);
 
 #[derive(Debug)]
-pub struct ConnectivityHandle<S: NetworkingService, T: TransportSocket> {
+pub struct MockConnectivityHandle<S: NetworkingService, T: TransportSocket> {
     /// The local addresses of a network service provider.
     local_addresses: Vec<S::Address>,
 
-    /// TX channel for sending commands to default_backend backend
+    /// TX channel for sending commands to mock backend
     cmd_tx: mpsc::Sender<types::Command<T>>,
 
-    /// RX channel for receiving connectivity events from default_backend backend
+    /// RX channel for receiving connectivity events from mock backend
     conn_rx: mpsc::Receiver<types::ConnectivityEvent<T>>,
 
     _marker: PhantomData<fn() -> S>,
 }
 
-pub struct PubSubHandle<S, T>
+pub struct MockPubSubHandle<S, T>
 where
     S: NetworkingService,
     T: TransportSocket,
 {
-    /// TX channel for sending commands to default_backend backend
+    /// TX channel for sending commands to mock backend
     _cmd_tx: mpsc::Sender<types::Command<T>>,
 
-    /// RX channel for receiving pubsub events from default_backend backend
+    /// RX channel for receiving pubsub events from mock backend
     _pubsub_rx: mpsc::Receiver<types::PubSubEvent<T>>,
 
     _marker: PhantomData<fn() -> S>,
 }
 
 #[derive(Debug)]
-pub struct SyncingMessagingHandle<S, T>
+pub struct MockSyncingMessagingHandle<S, T>
 where
     S: NetworkingService,
     T: TransportSocket,
 {
-    /// TX channel for sending commands to default_backend backend
+    /// TX channel for sending commands to mock backend
     cmd_tx: mpsc::Sender<types::Command<T>>,
 
     /// RX channel for receiving syncing events
@@ -88,15 +88,32 @@ where
     _marker: PhantomData<fn() -> S>,
 }
 
+impl<T> TryInto<PeerInfo<T>> for MockPeerInfo
+where
+    T: NetworkingService<PeerId = MockPeerId>,
+{
+    type Error = P2pError;
+
+    fn try_into(self) -> Result<PeerInfo<T>, Self::Error> {
+        Ok(PeerInfo {
+            peer_id: self.peer_id,
+            magic_bytes: self.network,
+            version: self.version,
+            agent: None,
+            subscriptions: self.subscriptions,
+        })
+    }
+}
+
 #[async_trait]
-impl<T: TransportSocket> NetworkingService for DefaultNetworkingService<T> {
+impl<T: TransportSocket> NetworkingService for MockService<T> {
     type Transport = T;
     type Address = T::Address;
     type BannableAddress = T::BannableAddress;
-    type PeerId = PeerId;
-    type PeerRequestId = RequestId;
-    type ConnectivityHandle = ConnectivityHandle<Self, T>;
-    type SyncingMessagingHandle = SyncingMessagingHandle<Self, T>;
+    type PeerId = MockPeerId;
+    type PeerRequestId = MockRequestId;
+    type ConnectivityHandle = MockConnectivityHandle<Self, T>;
+    type SyncingMessagingHandle = MockSyncingMessagingHandle<Self, T>;
 
     async fn start(
         transport: Self::Transport,
@@ -143,9 +160,11 @@ impl<T: TransportSocket> NetworkingService for DefaultNetworkingService<T> {
 }
 
 #[async_trait]
-impl<S, T> ConnectivityService<S> for ConnectivityHandle<S, T>
+impl<S, T> ConnectivityService<S> for MockConnectivityHandle<S, T>
 where
-    S: NetworkingService<Address = T::Address, PeerId = PeerId, PeerRequestId = RequestId> + Send,
+    S: NetworkingService<Address = T::Address, PeerId = MockPeerId, PeerRequestId = MockRequestId>
+        + Send,
+    MockPeerInfo: TryInto<PeerInfo<S>, Error = P2pError>,
     T: TransportSocket,
 {
     async fn connect(&mut self, address: S::Address) -> crate::Result<()> {
@@ -184,7 +203,7 @@ where
         peer_id: S::PeerId,
         request: PeerManagerRequest,
     ) -> crate::Result<S::PeerRequestId> {
-        let request_id = RequestId::new();
+        let request_id = MockRequestId::new();
 
         self.cmd_tx
             .send(types::Command::SendRequest {
@@ -241,7 +260,7 @@ where
                 receiver_address,
             } => Ok(ConnectivityEvent::InboundAccepted {
                 address,
-                peer_info,
+                peer_info: peer_info.try_into()?,
                 receiver_address,
             }),
             types::ConnectivityEvent::OutboundAccepted {
@@ -250,7 +269,7 @@ where
                 receiver_address,
             } => Ok(ConnectivityEvent::OutboundAccepted {
                 address,
-                peer_info,
+                peer_info: peer_info.try_into()?,
                 receiver_address,
             }),
             types::ConnectivityEvent::ConnectionError { address, error } => {
@@ -270,9 +289,9 @@ where
 }
 
 #[async_trait]
-impl<S, T> SyncingMessagingService<S> for SyncingMessagingHandle<S, T>
+impl<S, T> SyncingMessagingService<S> for MockSyncingMessagingHandle<S, T>
 where
-    S: NetworkingService<PeerId = PeerId, PeerRequestId = RequestId> + Send,
+    S: NetworkingService<PeerId = MockPeerId, PeerRequestId = MockRequestId> + Send,
     T: TransportSocket,
 {
     async fn send_request(
@@ -280,7 +299,7 @@ where
         peer_id: S::PeerId,
         request: SyncRequest,
     ) -> crate::Result<S::PeerRequestId> {
-        let request_id = RequestId::new();
+        let request_id = MockRequestId::new();
 
         self.cmd_tx
             .send(types::Command::SendRequest {
@@ -365,7 +384,7 @@ mod tests {
     use crate::error::DialError;
     use crate::testing_utils::{TestTransportChannel, TestTransportMaker, TestTransportTcp};
     use crate::{
-        net::default_backend::transport::{MpscChannelTransport, TcpTransportSocket},
+        net::mock::transport::{MockChannelTransport, TcpTransportSocket},
         testing_utils::TestTransportNoise,
     };
     use common::primitives::semver::SemVer;
@@ -379,7 +398,7 @@ mod tests {
         let config = Arc::new(common::chain::config::create_mainnet());
         let p2p_config: Arc<config::P2pConfig> = Arc::new(Default::default());
 
-        let (mut conn1, _) = DefaultNetworkingService::<T>::start(
+        let (mut conn1, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -388,7 +407,7 @@ mod tests {
         .await
         .unwrap();
 
-        let (conn2, _) = DefaultNetworkingService::<T>::start(
+        let (conn2, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -407,7 +426,7 @@ mod tests {
         }) = conn1.poll_next().await
         {
             assert_eq!(address, conn2.local_addresses().await.unwrap()[0]);
-            assert_eq!(&peer_info.network, config.magic_bytes());
+            assert_eq!(&peer_info.magic_bytes, config.magic_bytes());
             assert_eq!(peer_info.version, SemVer::new(0, 1, 0));
             assert_eq!(peer_info.agent, None);
             assert_eq!(
@@ -426,7 +445,7 @@ mod tests {
 
     #[tokio::test]
     async fn connect_to_remote_channels() {
-        connect_to_remote::<TestTransportChannel, MpscChannelTransport>().await;
+        connect_to_remote::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
@@ -442,7 +461,7 @@ mod tests {
         let config = Arc::new(common::chain::config::create_mainnet());
         let p2p_config: Arc<config::P2pConfig> = Arc::new(Default::default());
 
-        let (mut conn1, _) = DefaultNetworkingService::<T>::start(
+        let (mut conn1, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -451,7 +470,7 @@ mod tests {
         .await
         .unwrap();
 
-        let (mut conn2, _) = DefaultNetworkingService::<T>::start(
+        let (mut conn2, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -468,7 +487,7 @@ mod tests {
                 peer_info,
                 receiver_address: _,
             } => {
-                assert_eq!(peer_info.network, *config.magic_bytes());
+                assert_eq!(peer_info.magic_bytes, *config.magic_bytes());
                 assert_eq!(
                     peer_info.version,
                     common::primitives::semver::SemVer::new(0, 1, 0),
@@ -486,7 +505,7 @@ mod tests {
 
     #[tokio::test]
     async fn accept_incoming_channels() {
-        accept_incoming::<TestTransportChannel, MpscChannelTransport>().await;
+        accept_incoming::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
@@ -502,7 +521,7 @@ mod tests {
         let config = Arc::new(common::chain::config::create_mainnet());
         let p2p_config: Arc<config::P2pConfig> = Arc::new(Default::default());
 
-        let (mut conn1, _) = DefaultNetworkingService::<T>::start(
+        let (mut conn1, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -510,7 +529,7 @@ mod tests {
         )
         .await
         .unwrap();
-        let (mut conn2, _) = DefaultNetworkingService::<T>::start(
+        let (mut conn2, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             config,
@@ -543,7 +562,7 @@ mod tests {
 
     #[tokio::test]
     async fn disconnect_channels() {
-        disconnect::<TestTransportChannel, MpscChannelTransport>().await;
+        disconnect::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
@@ -559,7 +578,7 @@ mod tests {
         let config = Arc::new(common::chain::config::create_mainnet());
         let p2p_config: Arc<config::P2pConfig> = Arc::new(Default::default());
 
-        let (mut conn1, _) = DefaultNetworkingService::<T>::start(
+        let (mut conn1, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -568,7 +587,7 @@ mod tests {
         .await
         .unwrap();
 
-        let (conn2, _) = DefaultNetworkingService::<T>::start(
+        let (conn2, _) = MockService::<T>::start(
             A::make_transport(),
             vec![A::make_address()],
             Arc::clone(&config),
@@ -609,7 +628,7 @@ mod tests {
         }) = conn1.poll_next().await
         {
             assert_eq!(address, conn2.local_addresses().await.unwrap()[0]);
-            assert_eq!(&peer_info.network, config.magic_bytes());
+            assert_eq!(&peer_info.magic_bytes, config.magic_bytes());
             assert_eq!(peer_info.version, SemVer::new(0, 1, 0));
             assert_eq!(peer_info.agent, None);
             assert_eq!(
@@ -628,7 +647,7 @@ mod tests {
 
     #[tokio::test]
     async fn self_connect_channels() {
-        self_connect::<TestTransportChannel, MpscChannelTransport>().await;
+        self_connect::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
diff --git a/p2p/src/net/default_backend/peer.rs b/p2p/src/net/mock/peer.rs
similarity index 94%
rename from p2p/src/net/default_backend/peer.rs
rename to p2p/src/net/mock/peer.rs
index ad34d5921..07ccd2127 100644
--- a/p2p/src/net/default_backend/peer.rs
+++ b/p2p/src/net/mock/peer.rs
@@ -24,9 +24,9 @@ use crate::{
     config::P2pConfig,
     error::{P2pError, ProtocolError},
     net::{
-        default_backend::{
+        mock::{
             transport::TransportSocket,
-            types::{self, Event, PeerEvent, PeerId},
+            types::{self, MockEvent, MockPeerId, PeerEvent},
         },
         types::Role,
     },
@@ -54,7 +54,7 @@ impl From<PeerRole> for Role {
 
 pub struct Peer<T: TransportSocket> {
     /// Peer ID of the remote node
-    peer_id: PeerId,
+    peer_id: MockPeerId,
 
     /// Chain config
     chain_config: Arc<ChainConfig>,
@@ -71,10 +71,10 @@ pub struct Peer<T: TransportSocket> {
     receiver_address: Option<PeerAddress>,
 
     /// TX channel for communicating with backend
-    tx: mpsc::Sender<(PeerId, PeerEvent)>,
+    tx: mpsc::Sender<(MockPeerId, PeerEvent)>,
 
     /// RX channel for receiving commands from backend
-    rx: mpsc::Receiver<Event>,
+    rx: mpsc::Receiver<MockEvent>,
 }
 
 impl<T> Peer<T>
@@ -83,14 +83,14 @@ where
 {
     #![allow(clippy::too_many_arguments)]
     pub fn new(
-        peer_id: PeerId,
+        peer_id: MockPeerId,
         peer_role: PeerRole,
         chain_config: Arc<ChainConfig>,
         p2p_config: Arc<P2pConfig>,
         socket: T::Stream,
         receiver_address: Option<PeerAddress>,
-        tx: mpsc::Sender<(PeerId, PeerEvent)>,
-        rx: mpsc::Receiver<Event>,
+        tx: mpsc::Sender<(MockPeerId, PeerEvent)>,
+        rx: mpsc::Receiver<MockEvent>,
     ) -> Self {
         let socket = BufferedTranscoder::new(socket);
 
@@ -210,8 +210,8 @@ where
         loop {
             tokio::select! {
                 event = self.rx.recv() => match event.ok_or(P2pError::ChannelClosed)? {
-                    Event::Disconnect => return Ok(()),
-                    Event::SendMessage(message) => self.socket.send(*message).await?,
+                    MockEvent::Disconnect => return Ok(()),
+                    MockEvent::SendMessage(message) => self.socket.send(*message).await?,
                 },
                 event = self.socket.recv() => match event {
                     Err(err) => {
@@ -244,9 +244,9 @@ mod tests {
     use crate::{
         message,
         net::{
-            default_backend::{
+            mock::{
                 transport::{
-                    MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket, TransportListener,
+                    MockChannelTransport, NoiseTcpTransport, TcpTransportSocket, TransportListener,
                 },
                 types,
             },
@@ -266,7 +266,7 @@ mod tests {
         let p2p_config = Arc::new(P2pConfig::default());
         let (tx1, mut rx1) = mpsc::channel(16);
         let (_tx2, rx2) = mpsc::channel(16);
-        let peer_id2 = PeerId::new();
+        let peer_id2 = MockPeerId::new();
 
         let mut peer = Peer::<T>::new(
             peer_id2,
@@ -321,7 +321,7 @@ mod tests {
 
     #[tokio::test]
     async fn handshake_inbound_channels() {
-        handshake_inbound::<TestTransportChannel, MpscChannelTransport>().await;
+        handshake_inbound::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
@@ -339,7 +339,7 @@ mod tests {
         let p2p_config = Arc::new(P2pConfig::default());
         let (tx1, mut rx1) = mpsc::channel(16);
         let (_tx2, rx2) = mpsc::channel(16);
-        let peer_id3 = PeerId::new();
+        let peer_id3 = MockPeerId::new();
 
         let mut peer = Peer::<T>::new(
             peer_id3,
@@ -398,7 +398,7 @@ mod tests {
 
     #[tokio::test]
     async fn handshake_outbound_channels() {
-        handshake_outbound::<TestTransportChannel, MpscChannelTransport>().await;
+        handshake_outbound::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
@@ -416,7 +416,7 @@ mod tests {
         let p2p_config = Arc::new(P2pConfig::default());
         let (tx1, _rx1) = mpsc::channel(16);
         let (_tx2, rx2) = mpsc::channel(16);
-        let peer_id3 = PeerId::new();
+        let peer_id3 = MockPeerId::new();
 
         let mut peer = Peer::<T>::new(
             peer_id3,
@@ -456,7 +456,7 @@ mod tests {
 
     #[tokio::test]
     async fn handshake_different_network_channels() {
-        handshake_different_network::<TestTransportChannel, MpscChannelTransport>().await;
+        handshake_different_network::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
@@ -474,7 +474,7 @@ mod tests {
         let p2p_config = Arc::new(P2pConfig::default());
         let (tx1, _rx1) = mpsc::channel(16);
         let (_tx2, rx2) = mpsc::channel(16);
-        let peer_id2 = PeerId::new();
+        let peer_id2 = MockPeerId::new();
 
         let mut peer = Peer::<T>::new(
             peer_id2,
@@ -493,7 +493,7 @@ mod tests {
         assert!(socket2.recv().now_or_never().is_none());
         socket2
             .send(types::Message::Request {
-                request_id: types::RequestId::new(),
+                request_id: types::MockRequestId::new(),
                 request: message::Request::HeaderListRequest(message::HeaderListRequest::new(
                     Locator::new(vec![]),
                 )),
@@ -514,7 +514,7 @@ mod tests {
 
     #[tokio::test]
     async fn invalid_handshake_message_channels() {
-        invalid_handshake_message::<TestTransportChannel, MpscChannelTransport>().await;
+        invalid_handshake_message::<TestTransportChannel, MockChannelTransport>().await;
     }
 
     #[tokio::test]
diff --git a/p2p/src/net/default_backend/request_manager.rs b/p2p/src/net/mock/request_manager.rs
similarity index 85%
rename from p2p/src/net/default_backend/request_manager.rs
rename to p2p/src/net/mock/request_manager.rs
index b4841e687..2100cbb26 100644
--- a/p2p/src/net/default_backend/request_manager.rs
+++ b/p2p/src/net/mock/request_manager.rs
@@ -27,17 +27,17 @@
 use crate::{
     error::{P2pError, PeerError},
     message,
-    net::default_backend::types,
+    net::mock::types,
 };
 use std::collections::{hash_map::Entry, HashMap, HashSet};
 
 #[derive(Debug, Default)]
 pub struct RequestManager {
     /// Active ephemeral IDs
-    ephemerals: HashMap<types::PeerId, HashSet<types::RequestId>>,
+    ephemerals: HashMap<types::MockPeerId, HashSet<types::MockRequestId>>,
 
     /// Ephemeral requests IDs which are mapped to remote peer ID/request ID pair
-    ephemeral: HashMap<types::RequestId, (types::PeerId, types::RequestId)>,
+    ephemeral: HashMap<types::MockRequestId, (types::MockPeerId, types::MockRequestId)>,
 }
 
 impl RequestManager {
@@ -48,7 +48,7 @@ impl RequestManager {
     /// Register peer to the request manager
     ///
     /// Initialize peer context and allocate request ID slice for the peer
-    pub fn register_peer(&mut self, peer_id: types::PeerId) -> crate::Result<()> {
+    pub fn register_peer(&mut self, peer_id: types::MockPeerId) -> crate::Result<()> {
         match self.ephemerals.entry(peer_id) {
             Entry::Occupied(_) => Err(P2pError::PeerError(PeerError::PeerAlreadyExists)),
             Entry::Vacant(entry) => {
@@ -59,7 +59,7 @@ impl RequestManager {
     }
 
     /// Unregister peer from the request manager
-    pub fn unregister_peer(&mut self, peer_id: &types::PeerId) {
+    pub fn unregister_peer(&mut self, peer_id: &types::MockPeerId) {
         if let Some(ephemerals) = self.ephemerals.remove(peer_id) {
             ephemerals.iter().for_each(|id| {
                 self.ephemeral.remove(id);
@@ -70,7 +70,7 @@ impl RequestManager {
     /// Create new outgoing request
     pub fn make_request(
         &mut self,
-        request_id: types::RequestId,
+        request_id: types::MockRequestId,
         request: message::Request,
     ) -> crate::Result<Box<types::Message>> {
         Ok(Box::new(types::Message::Request {
@@ -85,9 +85,9 @@ impl RequestManager {
     /// of the remote node and return all information to the caller.
     pub fn make_response(
         &mut self,
-        request_id: &types::RequestId,
+        request_id: &types::MockRequestId,
         response: message::Response,
-    ) -> Option<(types::PeerId, Box<types::Message>)> {
+    ) -> Option<(types::MockPeerId, Box<types::Message>)> {
         if let Some((peer_id, request_id)) = self.ephemeral.remove(request_id) {
             return Some((
                 peer_id,
@@ -108,15 +108,15 @@ impl RequestManager {
     // TODO: Use different type in result so it's not possible to mixup ephemeral and real request ids.
     pub fn register_request(
         &mut self,
-        peer_id: &types::PeerId,
-        request_id: &types::RequestId,
-    ) -> crate::Result<types::RequestId> {
+        peer_id: &types::MockPeerId,
+        request_id: &types::MockRequestId,
+    ) -> crate::Result<types::MockRequestId> {
         let peer_ephemerals = self
             .ephemerals
             .get_mut(peer_id)
             .ok_or(P2pError::PeerError(PeerError::PeerDoesntExist))?;
 
-        let ephemeral_id = types::RequestId::new();
+        let ephemeral_id = types::MockRequestId::new();
 
         peer_ephemerals.insert(ephemeral_id);
         self.ephemeral.insert(ephemeral_id, (*peer_id, *request_id));
diff --git a/p2p/src/net/default_backend/transport/impls/channel.rs b/p2p/src/net/mock/transport/impls/channel.rs
similarity index 85%
rename from p2p/src/net/default_backend/transport/impls/channel.rs
rename to p2p/src/net/mock/transport/impls/channel.rs
index 8f8acb00d..244b19940 100644
--- a/p2p/src/net/default_backend/transport/impls/channel.rs
+++ b/p2p/src/net/mock/transport/impls/channel.rs
@@ -35,7 +35,7 @@ use tokio::{
 use crate::{
     error::DialError,
     net::{
-        default_backend::transport::{
+        mock::transport::{
             traits::TransportAddress, PeerStream, TransportListener, TransportSocket,
         },
         AsBannableAddress,
@@ -51,7 +51,7 @@ impl TransportAddress for Address {
         PeerAddress::Ip4(PeerAddressIp4 {
             // Address of the first "host" will be 0.0.0.1
             ip: std::net::Ipv4Addr::from(*self).into(),
-            // There is only one "port" in MpscChannelTransport per "host", use arbitrary value
+            // There is only one "port" in MockChannelTransport per "host", use arbitrary value
             port: 10000,
         })
     }
@@ -74,30 +74,28 @@ static CONNECTIONS: Lazy<Mutex<BTreeMap<Address, UnboundedSender<IncomingConnect
 
 static NEXT_ADDRESS: AtomicU32 = AtomicU32::new(1);
 
-/// Creating new transport is like attaching new "host" to the network.
-/// New unique address is registered for the new "host".
-/// Unlike TCP only one active bind is allowed at any moment to keep things simple
-/// (so there is only one port per host).
-///
-/// This transport should only be used in tests.
+// Creating new transport is like attaching new "host" to the network.
+// New unique address is registered for the new "host".
+// Unlike TCP only one active bind is allowed at any moment to keep things simple
+// (so there is only one port per host).
 #[derive(Debug)]
-pub struct MpscChannelTransport {
+pub struct MockChannelTransport {
     local_address: Address,
 }
 
-impl MpscChannelTransport {
+impl MockChannelTransport {
     pub fn new() -> Self {
         let local_address = NEXT_ADDRESS.fetch_add(1, Ordering::Relaxed);
-        MpscChannelTransport { local_address }
+        MockChannelTransport { local_address }
     }
 }
 
 #[async_trait]
-impl TransportSocket for MpscChannelTransport {
+impl TransportSocket for MockChannelTransport {
     type Address = Address;
     type BannableAddress = Address;
-    type Listener = ChannelListener;
-    type Stream = ChannelStream;
+    type Listener = MockChannelListener;
+    type Stream = ChannelMockStream;
 
     async fn bind(&self, addresses: Vec<Self::Address>) -> Result<Self::Listener> {
         // It's not possible to bind to random address
@@ -154,14 +152,14 @@ impl TransportSocket for MpscChannelTransport {
     }
 }
 
-pub struct ChannelListener {
+pub struct MockChannelListener {
     address: Address,
     receiver: UnboundedReceiver<IncomingConnection>,
 }
 
 #[async_trait]
-impl TransportListener<ChannelStream, Address> for ChannelListener {
-    async fn accept(&mut self) -> Result<(ChannelStream, Address)> {
+impl TransportListener<ChannelMockStream, Address> for MockChannelListener {
+    async fn accept(&mut self) -> Result<(ChannelMockStream, Address)> {
         let (remote_address, response_sender) =
             self.receiver.recv().await.ok_or(P2pError::ChannelClosed)?;
 
@@ -177,7 +175,7 @@ impl TransportListener<ChannelStream, Address> for ChannelListener {
     }
 }
 
-impl Drop for ChannelListener {
+impl Drop for MockChannelListener {
     fn drop(&mut self) {
         let old_entry =
             CONNECTIONS.lock().expect("Connections mutex is poisoned").remove(&self.address);
@@ -185,9 +183,9 @@ impl Drop for ChannelListener {
     }
 }
 
-pub type ChannelStream = DuplexStream;
+pub type ChannelMockStream = tokio::io::DuplexStream;
 
-impl PeerStream for ChannelStream {}
+impl PeerStream for ChannelMockStream {}
 
 impl AsBannableAddress for Address {
     type BannableAddress = Address;
@@ -202,15 +200,15 @@ mod tests {
     use super::*;
     use crate::{
         message::{BlockListRequest, SyncRequest},
-        net::default_backend::{
+        net::mock::{
             transport::BufferedTranscoder,
-            types::{Message, RequestId},
+            types::{Message, MockRequestId},
         },
     };
 
     #[tokio::test]
     async fn send_recv() {
-        let transport = MpscChannelTransport::new();
+        let transport = MockChannelTransport::new();
         let address = ZERO_ADDRESS;
         let mut server = transport.bind(vec![address]).await.unwrap();
         let peer_fut = transport.connect(server.local_addresses().unwrap()[0]);
@@ -219,7 +217,7 @@ mod tests {
         let server_stream = server_res.unwrap().0;
         let peer_stream = peer_res.unwrap();
 
-        let request_id = RequestId::new();
+        let request_id = MockRequestId::new();
         let request = SyncRequest::BlockListRequest(BlockListRequest::new(vec![]));
         let mut peer_stream = BufferedTranscoder::new(peer_stream);
         peer_stream
diff --git a/p2p/src/net/default_backend/transport/impls/mod.rs b/p2p/src/net/mock/transport/impls/mod.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/impls/mod.rs
rename to p2p/src/net/mock/transport/impls/mod.rs
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/identity.rs b/p2p/src/net/mock/transport/impls/stream_adapter/identity.rs
similarity index 94%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/identity.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/identity.rs
index 2f260dd6c..6f9574f22 100644
--- a/p2p/src/net/default_backend/transport/impls/stream_adapter/identity.rs
+++ b/p2p/src/net/mock/transport/impls/stream_adapter/identity.rs
@@ -15,7 +15,7 @@
 
 use futures::future::{ready, BoxFuture};
 
-use crate::net::{default_backend::transport::PeerStream, types::Role};
+use crate::net::{mock::transport::PeerStream, types::Role};
 
 use super::StreamAdapter;
 
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/mod.rs b/p2p/src/net/mock/transport/impls/stream_adapter/mod.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/mod.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/mod.rs
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/noise.rs b/p2p/src/net/mock/transport/impls/stream_adapter/noise.rs
similarity index 97%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/noise.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/noise.rs
index f6ef1c669..57f884874 100644
--- a/p2p/src/net/default_backend/transport/impls/stream_adapter/noise.rs
+++ b/p2p/src/net/mock/transport/impls/stream_adapter/noise.rs
@@ -21,7 +21,7 @@ use tokio::time::timeout;
 
 use crate::{
     error::P2pError,
-    net::{default_backend::transport::PeerStream, types::Role},
+    net::{mock::transport::PeerStream, types::Role},
 };
 
 use super::StreamAdapter;
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/traits.rs b/p2p/src/net/mock/transport/impls/stream_adapter/traits.rs
similarity index 94%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/traits.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/traits.rs
index e29579634..5e18ac80d 100644
--- a/p2p/src/net/default_backend/transport/impls/stream_adapter/traits.rs
+++ b/p2p/src/net/mock/transport/impls/stream_adapter/traits.rs
@@ -16,7 +16,7 @@
 use futures::future::BoxFuture;
 
 use crate::{
-    net::{default_backend::transport::PeerStream, types::Role},
+    net::{mock::transport::PeerStream, types::Role},
     Result,
 };
 
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/wrapped_listener.rs b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/wrapped_listener.rs
similarity index 98%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/wrapped_listener.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/wrapped_listener.rs
index 0ee067ada..05eb9c8d5 100644
--- a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/wrapped_listener.rs
+++ b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/wrapped_listener.rs
@@ -21,7 +21,7 @@ use futures::{
 
 use crate::{
     net::{
-        default_backend::transport::{
+        mock::transport::{
             impls::stream_adapter::traits::StreamAdapter, TransportListener, TransportSocket,
         },
         types::Role,
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/wrapped_socket.rs b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/wrapped_socket.rs
similarity index 96%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/wrapped_socket.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/wrapped_socket.rs
index e32670763..e0b0e5010 100644
--- a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/wrapped_socket.rs
+++ b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/wrapped_socket.rs
@@ -17,7 +17,7 @@ use async_trait::async_trait;
 use futures::future::BoxFuture;
 
 use crate::net::{
-    default_backend::transport::{impls::stream_adapter::traits::StreamAdapter, TransportSocket},
+    mock::transport::{impls::stream_adapter::traits::StreamAdapter, TransportSocket},
     types::Role,
 };
 
diff --git a/p2p/src/net/default_backend/transport/impls/tcp.rs b/p2p/src/net/mock/transport/impls/tcp.rs
similarity index 97%
rename from p2p/src/net/default_backend/transport/impls/tcp.rs
rename to p2p/src/net/mock/transport/impls/tcp.rs
index 535ff9d39..c21ab2ee3 100644
--- a/p2p/src/net/default_backend/transport/impls/tcp.rs
+++ b/p2p/src/net/mock/transport/impls/tcp.rs
@@ -22,7 +22,7 @@ use tokio::net::{TcpListener, TcpStream};
 use crate::{
     config::DEFAULT_BIND_PORT,
     net::{
-        default_backend::transport::{
+        mock::transport::{
             traits::TransportAddress, PeerStream, TransportListener, TransportSocket,
         },
         AsBannableAddress,
@@ -164,9 +164,9 @@ mod tests {
     };
 
     use super::*;
-    use crate::net::default_backend::{
+    use crate::net::mock::{
         transport::BufferedTranscoder,
-        types::{Message, RequestId},
+        types::{Message, MockRequestId},
     };
 
     #[tokio::test]
@@ -179,7 +179,7 @@ mod tests {
         let server_stream = server_res.unwrap().0;
         let peer_stream = peer_res.unwrap();
 
-        let request_id = RequestId::new();
+        let request_id = MockRequestId::new();
         let request = SyncRequest::BlockListRequest(BlockListRequest::new(vec![]));
         let mut peer_stream = BufferedTranscoder::new(peer_stream);
         peer_stream
@@ -210,7 +210,7 @@ mod tests {
         let server_stream = server_res.unwrap().0;
         let peer_stream = peer_res.unwrap();
 
-        let id_1 = RequestId::new();
+        let id_1 = MockRequestId::new();
         let request = SyncRequest::BlockListRequest(BlockListRequest::new(vec![]));
         let mut peer_stream = BufferedTranscoder::new(peer_stream);
         peer_stream
@@ -221,7 +221,7 @@ mod tests {
             .await
             .unwrap();
 
-        let id_2 = RequestId::new();
+        let id_2 = MockRequestId::new();
         peer_stream
             .send(Message::Request {
                 request_id: id_2,
diff --git a/p2p/src/net/default_backend/transport/message_codec.rs b/p2p/src/net/mock/transport/message_codec.rs
similarity index 97%
rename from p2p/src/net/default_backend/transport/message_codec.rs
rename to p2p/src/net/mock/transport/message_codec.rs
index 74c2d76de..63afd44d6 100644
--- a/p2p/src/net/default_backend/transport/message_codec.rs
+++ b/p2p/src/net/mock/transport/message_codec.rs
@@ -20,7 +20,7 @@ use serialization::{DecodeAll, Encode};
 use tokio::io::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
 use tokio_util::codec::{Decoder, Encoder};
 
-use crate::{constants::MAX_MESSAGE_SIZE, net::default_backend::types::Message, P2pError, Result};
+use crate::{constants::MAX_MESSAGE_SIZE, net::mock::types::Message, P2pError, Result};
 
 struct EncoderDecoder {}
 
diff --git a/p2p/src/net/default_backend/transport/mod.rs b/p2p/src/net/mock/transport/mod.rs
similarity index 93%
rename from p2p/src/net/default_backend/transport/mod.rs
rename to p2p/src/net/mock/transport/mod.rs
index cf7adc38a..dafbf351a 100644
--- a/p2p/src/net/default_backend/transport/mod.rs
+++ b/p2p/src/net/mock/transport/mod.rs
@@ -20,7 +20,7 @@ mod traits;
 use impls::{channel, stream_adapter, tcp};
 
 pub use self::{
-    channel::{ChannelListener, ChannelStream, MpscChannelTransport},
+    channel::{ChannelMockStream, MockChannelListener, MockChannelTransport},
     message_codec::BufferedTranscoder,
     stream_adapter::{
         identity::IdentityStreamAdapter, noise::NoiseEncryptionAdapter,
diff --git a/p2p/src/net/default_backend/transport/traits/address.rs b/p2p/src/net/mock/transport/traits/address.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/traits/address.rs
rename to p2p/src/net/mock/transport/traits/address.rs
diff --git a/p2p/src/net/default_backend/transport/traits/listener.rs b/p2p/src/net/mock/transport/traits/listener.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/traits/listener.rs
rename to p2p/src/net/mock/transport/traits/listener.rs
diff --git a/p2p/src/net/default_backend/transport/traits/mod.rs b/p2p/src/net/mock/transport/traits/mod.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/traits/mod.rs
rename to p2p/src/net/mock/transport/traits/mod.rs
diff --git a/p2p/src/net/default_backend/transport/traits/socket.rs b/p2p/src/net/mock/transport/traits/socket.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/traits/socket.rs
rename to p2p/src/net/mock/transport/traits/socket.rs
diff --git a/p2p/src/net/default_backend/transport/traits/stream.rs b/p2p/src/net/mock/transport/traits/stream.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/traits/stream.rs
rename to p2p/src/net/mock/transport/traits/stream.rs
diff --git a/p2p/src/net/default_backend/types.rs b/p2p/src/net/mock/types.rs
similarity index 82%
rename from p2p/src/net/default_backend/types.rs
rename to p2p/src/net/mock/types.rs
index 425da8b19..c756a8ad2 100644
--- a/p2p/src/net/default_backend/types.rs
+++ b/p2p/src/net/mock/types.rs
@@ -27,11 +27,7 @@ use serialization::{Decode, Encode};
 
 use crate::{
     error, message,
-    net::{
-        self,
-        default_backend::transport::TransportSocket,
-        types::{PeerInfo, PubSubTopic},
-    },
+    net::{self, mock::transport::TransportSocket, types::PubSubTopic},
     types::peer_address::PeerAddress,
 };
 
@@ -41,17 +37,17 @@ pub enum Command<T: TransportSocket> {
         response: oneshot::Sender<crate::Result<()>>,
     },
     Disconnect {
-        peer_id: PeerId,
+        peer_id: MockPeerId,
         response: oneshot::Sender<crate::Result<()>>,
     },
     SendRequest {
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         message: message::Request,
     },
     /// Send response to remote peer
     SendResponse {
-        request_id: RequestId,
+        request_id: MockRequestId,
         message: message::Response,
     },
     AnnounceData {
@@ -62,17 +58,17 @@ pub enum Command<T: TransportSocket> {
 
 pub enum SyncingEvent {
     Request {
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         request: message::SyncRequest,
     },
     Response {
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         response: message::SyncResponse,
     },
     Announcement {
-        peer_id: PeerId,
+        peer_id: MockPeerId,
         announcement: Box<message::Announcement>,
     },
 }
@@ -80,23 +76,23 @@ pub enum SyncingEvent {
 #[derive(Debug, PartialEq, Eq)]
 pub enum ConnectivityEvent<T: TransportSocket> {
     Request {
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         request: message::PeerManagerRequest,
     },
     Response {
-        peer_id: PeerId,
-        request_id: RequestId,
+        peer_id: MockPeerId,
+        request_id: MockRequestId,
         response: message::PeerManagerResponse,
     },
     InboundAccepted {
         address: T::Address,
-        peer_info: PeerInfo<PeerId>,
+        peer_info: MockPeerInfo,
         receiver_address: Option<PeerAddress>,
     },
     OutboundAccepted {
         address: T::Address,
-        peer_info: PeerInfo<PeerId>,
+        peer_info: MockPeerInfo,
         receiver_address: Option<PeerAddress>,
     },
     ConnectionError {
@@ -104,11 +100,11 @@ pub enum ConnectivityEvent<T: TransportSocket> {
         error: error::P2pError,
     },
     ConnectionClosed {
-        peer_id: PeerId,
+        peer_id: MockPeerId,
     },
     /// A peer misbehaved and its reputation must be adjusted according to the error type.
     Misbehaved {
-        peer_id: PeerId,
+        peer_id: MockPeerId,
         error: error::P2pError,
     },
     AddressDiscovered {
@@ -129,25 +125,25 @@ pub enum PubSubEvent<T: TransportSocket> {
 static NEXT_REQUEST_ID: AtomicU64 = AtomicU64::new(1);
 
 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encode, Decode, Default)]
-pub struct RequestId(u64);
+pub struct MockRequestId(u64);
 
-impl RequestId {
+impl MockRequestId {
     pub fn new() -> Self {
         let id = NEXT_REQUEST_ID.fetch_add(1, Ordering::Relaxed);
         Self(id)
     }
 }
 
-impl std::fmt::Display for RequestId {
+impl std::fmt::Display for MockRequestId {
     fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
         write!(f, "{}", self.0)
     }
 }
 
 #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, Encode, Decode)]
-pub struct PeerId(u64);
+pub struct MockPeerId(u64);
 
-impl FromStr for PeerId {
+impl FromStr for MockPeerId {
     type Err = <u64 as FromStr>::Err;
 
     fn from_str(s: &str) -> Result<Self, Self::Err> {
@@ -157,14 +153,14 @@ impl FromStr for PeerId {
 
 static NEXT_PEER_ID: AtomicU64 = AtomicU64::new(1);
 
-impl PeerId {
+impl MockPeerId {
     pub fn new() -> Self {
         let id = NEXT_PEER_ID.fetch_add(1, Ordering::Relaxed);
         Self(id)
     }
 }
 
-impl std::fmt::Display for PeerId {
+impl std::fmt::Display for MockPeerId {
     fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
         write!(f, "{}", self.0)
     }
@@ -174,6 +170,15 @@ impl std::fmt::Display for PeerId {
 /// Used to detect and drop self connections.
 pub type HandshakeNonce = u64;
 
+#[derive(Debug, PartialEq, Eq)]
+pub struct MockPeerInfo {
+    pub peer_id: MockPeerId,
+    pub network: [u8; 4],
+    pub version: SemVer,
+    pub agent: Option<String>,
+    pub subscriptions: BTreeSet<PubSubTopic>,
+}
+
 #[derive(Debug, PartialEq, Eq)]
 pub enum PeerEvent {
     /// Peer information received from remote
@@ -195,9 +200,9 @@ pub enum PeerEvent {
     MessageReceived { message: Message },
 }
 
-/// Events sent by the default_backend backend to peers
+/// Events sent by the mock backend to peers
 #[derive(Debug)]
-pub enum Event {
+pub enum MockEvent {
     Disconnect,
     SendMessage(Box<Message>),
 }
@@ -231,11 +236,11 @@ pub enum HandshakeMessage {
 pub enum Message {
     Handshake(HandshakeMessage),
     Request {
-        request_id: RequestId,
+        request_id: MockRequestId,
         request: message::Request,
     },
     Response {
-        request_id: RequestId,
+        request_id: MockRequestId,
         response: message::Response,
     },
     Announcement {
diff --git a/p2p/src/net/mod.rs b/p2p/src/net/mod.rs
index 3a27f44ec..349eec33a 100644
--- a/p2p/src/net/mod.rs
+++ b/p2p/src/net/mod.rs
@@ -13,7 +13,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-pub mod default_backend;
+pub mod mock;
 pub mod types;
 
 use std::{
@@ -31,7 +31,7 @@ use crate::{
     message::{PeerManagerResponse, SyncRequest, SyncResponse},
 };
 
-use self::default_backend::transport::TransportAddress;
+use self::mock::transport::TransportAddress;
 
 /// [NetworkingService] provides the low-level network interface
 /// that each network service provider must implement
diff --git a/p2p/src/net/types/mod.rs b/p2p/src/net/types/mod.rs
index d7780ef6c..cf7e00f4b 100644
--- a/p2p/src/net/types/mod.rs
+++ b/p2p/src/net/types/mod.rs
@@ -13,10 +13,7 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-use std::{
-    collections::BTreeSet,
-    fmt::{Debug, Display},
-};
+use std::{collections::BTreeSet, fmt::Display};
 
 use common::primitives::semver::SemVer;
 use serialization::{Decode, Encode};
@@ -38,13 +35,13 @@ pub enum Role {
 /// (both are Mintlayer nodes and that both support mandatory protocols). If those checks pass,
 /// the information is passed on to [crate::peer_manager::PeerManager] which decides whether it
 /// wants to keep the connection open or close it and possibly ban the peer from.
-#[derive(Debug, PartialEq, Eq)]
-pub struct PeerInfo<P> {
+#[derive(Debug)]
+pub struct PeerInfo<T: NetworkingService> {
     /// Unique ID of the peer
-    pub peer_id: P,
+    pub peer_id: T::PeerId,
 
     /// Peer network
-    pub network: [u8; 4],
+    pub magic_bytes: [u8; 4],
 
     /// Peer software version
     pub version: SemVer,
@@ -56,11 +53,11 @@ pub struct PeerInfo<P> {
     pub subscriptions: BTreeSet<PubSubTopic>,
 }
 
-impl<P: Debug> Display for PeerInfo<P> {
+impl<T: NetworkingService> Display for PeerInfo<T> {
     fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
         writeln!(f, "Peer information:")?;
-        writeln!(f, "--> Peer ID: {:?}", self.peer_id)?;
-        writeln!(f, "--> Network: {:x?}", self.network)?;
+        writeln!(f, "--> Peer ID: {}", self.peer_id)?;
+        writeln!(f, "--> Magic bytes: {:x?}", self.magic_bytes)?;
         writeln!(f, "--> Software version: {}", self.version)?;
         writeln!(
             f,
@@ -103,7 +100,7 @@ pub enum ConnectivityEvent<T: NetworkingService> {
         address: T::Address,
 
         /// Peer information
-        peer_info: PeerInfo<T::PeerId>,
+        peer_info: PeerInfo<T>,
 
         /// Socket address of this node as seen by remote peer
         receiver_address: Option<PeerAddress>,
@@ -115,7 +112,7 @@ pub enum ConnectivityEvent<T: NetworkingService> {
         address: T::Address,
 
         /// Peer information
-        peer_info: PeerInfo<T::PeerId>,
+        peer_info: PeerInfo<T>,
 
         /// Socket address of this node as seen by remote peer
         receiver_address: Option<PeerAddress>,
diff --git a/p2p/src/peer_manager/mod.rs b/p2p/src/peer_manager/mod.rs
index a1865bff2..f99b0be8f 100644
--- a/p2p/src/peer_manager/mod.rs
+++ b/p2p/src/peer_manager/mod.rs
@@ -42,10 +42,8 @@ use crate::{
     event::{PeerManagerEvent, SyncControlEvent},
     message::{AddrListRequest, AddrListResponse, PeerManagerRequest, PeerManagerResponse},
     net::{
-        self,
-        default_backend::transport::TransportAddress,
-        types::{PeerInfo, Role},
-        AsBannableAddress, ConnectivityService, NetworkingService,
+        self, mock::transport::TransportAddress, types::Role, AsBannableAddress,
+        ConnectivityService, NetworkingService,
     },
     types::peer_address::PeerAddress,
 };
@@ -132,7 +130,7 @@ where
         &mut self,
         address: T::Address,
         role: Role,
-        info: PeerInfo<T::PeerId>,
+        info: net::types::PeerInfo<T>,
         _receiver_address: Option<PeerAddress>,
     ) -> crate::Result<()> {
         // TODO: Handle receiver_address
@@ -140,10 +138,10 @@ where
         let peer_id = info.peer_id;
 
         ensure!(
-            info.network == *self.chain_config.magic_bytes(),
+            info.magic_bytes == *self.chain_config.magic_bytes(),
             P2pError::ProtocolError(ProtocolError::DifferentNetwork(
                 *self.chain_config.magic_bytes(),
-                info.network,
+                info.magic_bytes,
             ))
         );
         ensure!(
@@ -179,7 +177,7 @@ where
     fn accept_inbound_connection(
         &mut self,
         address: T::Address,
-        info: net::types::PeerInfo<T::PeerId>,
+        info: net::types::PeerInfo<T>,
         receiver_address: Option<PeerAddress>,
     ) -> crate::Result<()> {
         log::debug!("validate inbound connection, inbound address {address:?}");
@@ -212,7 +210,7 @@ where
     /// or by the [`PeerManager::heartbeat()`] function which has decided to cull
     /// this connection in favor of another potential connection.
     fn close_connection(&mut self, peer_id: T::PeerId) -> crate::Result<()> {
-        // The backend is always sending ConnectionClosed event when somebody disconnects, ensure that the peer is active
+        // Mock backend is always sending ConnectionClosed event when somebody disconnects, ensure that the peer is active
         if self.peerdb.is_active_peer(&peer_id) {
             log::debug!("connection closed for peer {peer_id}");
 
diff --git a/p2p/src/peer_manager/peerdb/mod.rs b/p2p/src/peer_manager/peerdb/mod.rs
index 7390c85b6..fb9c6e7ad 100644
--- a/p2p/src/peer_manager/peerdb/mod.rs
+++ b/p2p/src/peer_manager/peerdb/mod.rs
@@ -38,7 +38,7 @@ use crate::{
     error::{ConversionError, P2pError},
     interface::types::ConnectedPeer,
     net::{
-        default_backend::transport::TransportAddress,
+        mock::transport::TransportAddress,
         types::{self, Role},
         AsBannableAddress, NetworkingService,
     },
@@ -48,7 +48,7 @@ use crate::{
 #[derive(Debug)]
 pub struct PeerContext<T: NetworkingService> {
     /// Peer information
-    pub info: types::PeerInfo<T::PeerId>,
+    pub info: types::PeerInfo<T>,
 
     /// Peer's address
     pub address: T::Address,
@@ -188,12 +188,7 @@ impl<T: NetworkingService> PeerDb<T> {
     ///
     /// After `PeerManager` has established either an inbound or an outbound connection,
     /// it informs the `PeerDb` about it.
-    pub fn peer_connected(
-        &mut self,
-        address: T::Address,
-        role: Role,
-        info: types::PeerInfo<T::PeerId>,
-    ) {
+    pub fn peer_connected(&mut self, address: T::Address, role: Role, info: types::PeerInfo<T>) {
         log::info!(
             "peer connected, peer_id: {}, address: {address:?}, {:?}",
             info.peer_id,
diff --git a/p2p/src/sync/peer.rs b/p2p/src/sync/peer.rs
index 6018743a9..6dd364aaa 100644
--- a/p2p/src/sync/peer.rs
+++ b/p2p/src/sync/peer.rs
@@ -120,26 +120,24 @@ impl<T: NetworkingService> PeerContext<T> {
 #[cfg(test)]
 mod tests {
     use super::*;
-    use crate::net::default_backend::{
-        transport::TcpTransportSocket, types, DefaultNetworkingService,
-    };
+    use crate::net::mock::{transport::TcpTransportSocket, types, MockService};
     use common::chain::block::{
         consensus_data::ConsensusData, timestamp::BlockTimestamp, BlockReward,
     };
 
-    fn new_peersyncstate() -> PeerContext<DefaultNetworkingService<TcpTransportSocket>> {
-        PeerContext::<DefaultNetworkingService<TcpTransportSocket>>::new(types::PeerId::new())
+    fn new_mock_peersyncstate() -> PeerContext<MockService<TcpTransportSocket>> {
+        PeerContext::<MockService<TcpTransportSocket>>::new(types::MockPeerId::new())
     }
 
     #[test]
     fn create_new_peersyncstate() {
-        let peer = new_peersyncstate();
+        let peer = new_mock_peersyncstate();
         assert_eq!(peer.state, PeerSyncState::Unknown);
     }
 
     #[test]
     fn test_set_state() {
-        let mut peer = new_peersyncstate();
+        let mut peer = new_mock_peersyncstate();
         let header = Block::new(
             vec![],
             Id::new(common::primitives::H256([0x07; 32])),


Test patch:
diff --git a/p2p/backend-test-suite/src/block_announcement.rs b/p2p/backend-test-suite/src/block_announcement.rs
index 665e5d0f5..868e7977e 100644
--- a/p2p/backend-test-suite/src/block_announcement.rs
+++ b/p2p/backend-test-suite/src/block_announcement.rs
@@ -35,8 +35,8 @@ use p2p::{
     error::{P2pError, PublishError},
     message::Announcement,
     net::{
-        default_backend::constants::ANNOUNCEMENT_MAX_SIZE, types::SyncingEvent,
-        ConnectivityService, NetworkingService, SyncingMessagingService,
+        mock::constants::ANNOUNCEMENT_MAX_SIZE, types::SyncingEvent, ConnectivityService,
+        NetworkingService, SyncingMessagingService,
     },
     testing_utils::{connect_services, TestTransportMaker},
 };
diff --git a/p2p/backend-test-suite/src/connect.rs b/p2p/backend-test-suite/src/connect.rs
index bdc9cbe9e..a398de46b 100644
--- a/p2p/backend-test-suite/src/connect.rs
+++ b/p2p/backend-test-suite/src/connect.rs
@@ -23,12 +23,7 @@ use p2p::{
     net::{ConnectivityService, NetworkingService, SyncingMessagingService},
 };
 
-tests![
-    connect,
-    #[cfg(not(target_os = "windows"))]
-    connect_address_in_use,
-    connect_accept,
-];
+tests![connect, connect_address_in_use, connect_accept,];
 
 async fn connect<T, S, A>()
 where
@@ -49,8 +44,6 @@ where
 }
 
 // Check that connecting twice to the same address isn't possible.
-// TODO: Investigate why this test fails on Windows.
-#[cfg(not(target_os = "windows"))]
 async fn connect_address_in_use<T, S, A>()
 where
     T: TestTransportMaker<Transport = S::Transport, Address = S::Address>,
diff --git a/p2p/backend-test-suite/src/lib.rs b/p2p/backend-test-suite/src/lib.rs
index b0ce53dfc..4a16e7ff1 100644
--- a/p2p/backend-test-suite/src/lib.rs
+++ b/p2p/backend-test-suite/src/lib.rs
@@ -31,8 +31,7 @@ use libtest_mimic::{Arguments, Trial};
 
 use p2p::{
     net::{
-        default_backend::types::PeerId, ConnectivityService, NetworkingService,
-        SyncingMessagingService,
+        mock::types::MockPeerId, ConnectivityService, NetworkingService, SyncingMessagingService,
     },
     testing_utils::{RandomAddressMaker, TestTransportMaker},
 };
@@ -41,7 +40,7 @@ use p2p::{
 pub fn run<T, S, A>()
 where
     T: TestTransportMaker<Transport = S::Transport, Address = S::Address>,
-    S: NetworkingService<PeerId = PeerId> + Debug + 'static,
+    S: NetworkingService<PeerId = MockPeerId> + Debug + 'static,
     S::ConnectivityHandle: ConnectivityService<S> + Debug,
     S::SyncingMessagingHandle: SyncingMessagingService<S> + Debug,
     A: RandomAddressMaker<Address = S::Address>,
@@ -55,7 +54,7 @@ where
 fn tests<T, S, A>() -> Vec<Trial>
 where
     T: TestTransportMaker<Transport = S::Transport, Address = S::Address>,
-    S: NetworkingService<PeerId = PeerId> + Debug + 'static,
+    S: NetworkingService<PeerId = MockPeerId> + Debug + 'static,
     S::ConnectivityHandle: ConnectivityService<S> + Debug,
     S::SyncingMessagingHandle: SyncingMessagingService<S> + Debug,
     A: RandomAddressMaker<Address = S::Address>,
diff --git a/p2p/backend-test-suite/src/peer_manager_peerdb.rs b/p2p/backend-test-suite/src/peer_manager_peerdb.rs
index 12401ffd1..2ae0d46e4 100644
--- a/p2p/backend-test-suite/src/peer_manager_peerdb.rs
+++ b/p2p/backend-test-suite/src/peer_manager_peerdb.rs
@@ -21,7 +21,7 @@ use std::{sync::Arc, time::Duration};
 use p2p::{
     config::P2pConfig,
     net::{
-        default_backend::types::PeerId,
+        mock::types::MockPeerId,
         types::{PeerInfo, PubSubTopic, Role},
         AsBannableAddress, NetworkingService,
     },
@@ -38,7 +38,7 @@ tests![
 
 async fn adjust_peer_score_normal_threshold<T, S, A>()
 where
-    S: NetworkingService<PeerId = PeerId>,
+    S: NetworkingService<PeerId = MockPeerId>,
     A: RandomAddressMaker<Address = S::Address>,
 {
     let mut peerdb = PeerDb::<S>::new(Arc::new(P2pConfig::default())).unwrap();
@@ -51,7 +51,7 @@ where
 
 async fn adjust_peer_score_higher_threshold<T, S, A>()
 where
-    S: NetworkingService<PeerId = PeerId>,
+    S: NetworkingService<PeerId = MockPeerId>,
     A: RandomAddressMaker<Address = S::Address>,
 {
     let config = P2pConfig {
@@ -73,7 +73,7 @@ where
 
 async fn adjust_peer_score_lower_threshold<T, S, A>()
 where
-    S: NetworkingService<PeerId = PeerId>,
+    S: NetworkingService<PeerId = MockPeerId>,
     A: RandomAddressMaker<Address = S::Address>,
 {
     let config = P2pConfig {
@@ -94,7 +94,7 @@ where
 
 async fn unban_peer<T, S, A>()
 where
-    S: NetworkingService<PeerId = PeerId>,
+    S: NetworkingService<PeerId = MockPeerId>,
     A: RandomAddressMaker<Address = S::Address>,
 {
     let mut peerdb = PeerDb::<S>::new(Arc::new(P2pConfig {
@@ -119,19 +119,19 @@ where
     assert!(!peerdb.is_address_banned(&address));
 }
 
-fn make_peer_info<T, S, A>() -> (S::PeerId, S::Address, PeerInfo<S::PeerId>)
+fn make_peer_info<T, S, A>() -> (S::PeerId, S::Address, PeerInfo<S>)
 where
-    S: NetworkingService<PeerId = PeerId>,
+    S: NetworkingService<PeerId = MockPeerId>,
     A: RandomAddressMaker<Address = S::Address>,
 {
-    let peer_id = PeerId::new();
+    let peer_id = MockPeerId::new();
 
     (
         peer_id,
         A::new(),
-        PeerInfo::<S::PeerId> {
+        PeerInfo::<S> {
             peer_id,
-            network: [1, 2, 3, 4],
+            magic_bytes: [1, 2, 3, 4],
             version: common::primitives::semver::SemVer::new(0, 1, 0),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -141,7 +141,7 @@ where
 
 fn add_active_peer<T, S, A>(peerdb: &mut PeerDb<S>) -> S::PeerId
 where
-    S: NetworkingService<PeerId = PeerId>,
+    S: NetworkingService<PeerId = MockPeerId>,
     A: RandomAddressMaker<Address = S::Address>,
 {
     let (peer_id, address, info) = make_peer_info::<T, S, A>();
diff --git a/p2p/backend-test-suite/src/utils.rs b/p2p/backend-test-suite/src/utils.rs
index 43df5566c..f1bd43d80 100644
--- a/p2p/backend-test-suite/src/utils.rs
+++ b/p2p/backend-test-suite/src/utils.rs
@@ -18,7 +18,7 @@ macro_rules! tests {
         pub fn tests<T, S, A>() -> impl Iterator<Item = libtest_mimic::Trial>
         where
             T: p2p::testing_utils::TestTransportMaker<Transport = S::Transport, Address = S::Address>,
-            S: p2p::net::NetworkingService<PeerId = p2p::net::default_backend::types::PeerId> + std::fmt::Debug + 'static,
+            S: p2p::net::NetworkingService<PeerId = p2p::net::mock::types::MockPeerId> + std::fmt::Debug + 'static,
             S::ConnectivityHandle: p2p::net::ConnectivityService<S> + std::fmt::Debug,
             S::SyncingMessagingHandle: p2p::net::SyncingMessagingService<S> + std::fmt::Debug,
             A: p2p::testing_utils::RandomAddressMaker<Address = S::Address>,
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/mod.rs b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/mod.rs
similarity index 100%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/mod.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/mod.rs
diff --git a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/tests.rs b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/tests.rs
similarity index 85%
rename from p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/tests.rs
rename to p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/tests.rs
index f7de1d551..e0c17d3d4 100644
--- a/p2p/src/net/default_backend/transport/impls/stream_adapter/wrapped_transport/tests.rs
+++ b/p2p/src/net/mock/transport/impls/stream_adapter/wrapped_transport/tests.rs
@@ -28,14 +28,14 @@ use tokio::{
 
 use crate::{
     message::{BlockListRequest, Request},
-    net::default_backend::{
+    net::mock::{
         transport::{
             impls::stream_adapter::wrapped_transport::wrapped_listener::MAX_CONCURRENT_HANDSHAKES,
-            BufferedTranscoder, ChannelListener, IdentityStreamAdapter, MpscChannelTransport,
+            BufferedTranscoder, IdentityStreamAdapter, MockChannelListener, MockChannelTransport,
             NoiseEncryptionAdapter, PeerStream, TcpTransportSocket, TransportListener,
             TransportSocket,
         },
-        types::{Message, RequestId},
+        types::{Message, MockRequestId},
     },
 };
 
@@ -70,7 +70,7 @@ async fn test<A: TestTransportMaker<Address = T::Address>, T: TransportSocket>(t
 async fn test_send_recv() {
     test::<TestTransportTcp, TcpTransportSocket>(TcpTransportSocket::new()).await;
 
-    test::<TestTransportChannel, MpscChannelTransport>(MpscChannelTransport::new()).await;
+    test::<TestTransportChannel, MockChannelTransport>(MockChannelTransport::new()).await;
 
     test::<TestTransportTcp, WrappedTransportSocket<NoiseEncryptionAdapter, TcpTransportSocket>>(
         WrappedTransportSocket::new(NoiseEncryptionAdapter::gen_new(), TcpTransportSocket::new()),
@@ -79,10 +79,10 @@ async fn test_send_recv() {
 
     test::<
         TestTransportChannel,
-        WrappedTransportSocket<NoiseEncryptionAdapter, MpscChannelTransport>,
+        WrappedTransportSocket<NoiseEncryptionAdapter, MockChannelTransport>,
     >(WrappedTransportSocket::new(
         NoiseEncryptionAdapter::gen_new(),
-        MpscChannelTransport::new(),
+        MockChannelTransport::new(),
     ))
     .await;
 
@@ -93,8 +93,8 @@ async fn test_send_recv() {
 
     test::<
         TestTransportChannel,
-        WrappedTransportSocket<IdentityStreamAdapter, MpscChannelTransport>,
-    >(WrappedTransportSocket::new(IdentityStreamAdapter::new(), MpscChannelTransport::new()))
+        WrappedTransportSocket<IdentityStreamAdapter, MockChannelTransport>,
+    >(WrappedTransportSocket::new(IdentityStreamAdapter::new(), MockChannelTransport::new()))
     .await;
 
     test::<
@@ -110,36 +110,36 @@ async fn test_send_recv() {
     .await;
 }
 
-pub struct TestTransport {
-    transport: MpscChannelTransport,
+pub struct TestMockTransport {
+    transport: MockChannelTransport,
     port_open: Arc<Mutex<bool>>,
 }
 
-pub struct TestListener {
-    listener: ChannelListener,
+pub struct TestMockListener {
+    listener: MockChannelListener,
     port_open: Arc<Mutex<bool>>,
 }
 
-impl TestTransport {
+impl TestMockTransport {
     fn new() -> Self {
         Self {
-            transport: MpscChannelTransport::new(),
+            transport: MockChannelTransport::new(),
             port_open: Default::default(),
         }
     }
 }
 
 #[async_trait]
-impl TransportSocket for TestTransport {
-    type Address = <MpscChannelTransport as TransportSocket>::Address;
-    type BannableAddress = <MpscChannelTransport as TransportSocket>::BannableAddress;
-    type Listener = TestListener;
-    type Stream = <MpscChannelTransport as TransportSocket>::Stream;
+impl TransportSocket for TestMockTransport {
+    type Address = <MockChannelTransport as TransportSocket>::Address;
+    type BannableAddress = <MockChannelTransport as TransportSocket>::BannableAddress;
+    type Listener = TestMockListener;
+    type Stream = <MockChannelTransport as TransportSocket>::Stream;
 
     async fn bind(&self, addresses: Vec<Self::Address>) -> crate::Result<Self::Listener> {
         let listener = self.transport.bind(addresses).await.unwrap();
         *self.port_open.lock().unwrap() = true;
-        Ok(TestListener {
+        Ok(TestMockListener {
             listener,
             port_open: Arc::clone(&self.port_open),
         })
@@ -153,38 +153,38 @@ impl TransportSocket for TestTransport {
 #[async_trait]
 impl
     TransportListener<
-        <MpscChannelTransport as TransportSocket>::Stream,
-        <MpscChannelTransport as TransportSocket>::Address,
-    > for TestListener
+        <MockChannelTransport as TransportSocket>::Stream,
+        <MockChannelTransport as TransportSocket>::Address,
+    > for TestMockListener
 {
     async fn accept(
         &mut self,
     ) -> crate::Result<(
-        <MpscChannelTransport as TransportSocket>::Stream,
-        <MpscChannelTransport as TransportSocket>::Address,
+        <MockChannelTransport as TransportSocket>::Stream,
+        <MockChannelTransport as TransportSocket>::Address,
     )> {
         self.listener.accept().await
     }
 
     fn local_addresses(
         &self,
-    ) -> crate::Result<Vec<<MpscChannelTransport as TransportSocket>::Address>> {
+    ) -> crate::Result<Vec<<MockChannelTransport as TransportSocket>::Address>> {
         self.listener.local_addresses()
     }
 }
 
-impl Drop for TestListener {
+impl Drop for TestMockListener {
     fn drop(&mut self) {
         *self.port_open.lock().unwrap() = false;
     }
 }
 
 #[tokio::test]
-// Test that the base listener is dropped after AdaptedTransport::Listener is dropped.
+// Test that the base listener is dropped after AdaptedMockTransport::Listener is dropped.
 async fn test_bind_port_closed() {
-    let transport = WrappedTransportSocket::<NoiseEncryptionAdapter, TestTransport>::new(
+    let transport = WrappedTransportSocket::<NoiseEncryptionAdapter, TestMockTransport>::new(
         NoiseEncryptionAdapter::gen_new(),
-        TestTransport::new(),
+        TestMockTransport::new(),
     );
     assert!(!*transport.base_transport.port_open.lock().unwrap());
 
@@ -208,7 +208,7 @@ async fn send_2_reqs() {
     let server_stream = server_res.unwrap().0;
     let peer_stream = peer_res.unwrap();
 
-    let id_1 = RequestId::new();
+    let id_1 = MockRequestId::new();
     let request = Request::BlockListRequest(BlockListRequest::new(vec![]));
     let mut peer_stream = BufferedTranscoder::new(peer_stream);
     peer_stream
@@ -219,7 +219,7 @@ async fn send_2_reqs() {
         .await
         .unwrap();
 
-    let id_2 = RequestId::new();
+    let id_2 = MockRequestId::new();
     peer_stream
         .send(Message::Request {
             request_id: id_2,
diff --git a/p2p/src/peer_manager/tests/ban.rs b/p2p/src/peer_manager/tests/ban.rs
index 6b2d52a3b..a1cc45f53 100644
--- a/p2p/src/peer_manager/tests/ban.rs
+++ b/p2p/src/peer_manager/tests/ban.rs
@@ -29,10 +29,10 @@ use crate::{
     error::{P2pError, PeerError},
     net::{
         self,
-        default_backend::{
-            transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-            types::PeerId,
-            DefaultNetworkingService,
+        mock::{
+            transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+            types::MockPeerId,
+            MockService,
         },
         types::PubSubTopic,
         AsBannableAddress, ConnectivityService, NetworkingService,
@@ -81,19 +81,18 @@ where
 }
 
 #[tokio::test]
-async fn ban_connected_peer_tcp() {
-    ban_connected_peer::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn ban_connected_peer_mock_tcp() {
+    ban_connected_peer::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn ban_connected_peer_channels() {
-    ban_connected_peer::<TestTransportChannel, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn ban_connected_peer_mock_channels() {
+    ban_connected_peer::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn ban_connected_peer_noise() {
-    ban_connected_peer::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn ban_connected_peer_mock_noise() {
+    ban_connected_peer::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn banned_peer_attempts_to_connect<A, T>()
@@ -136,26 +135,19 @@ where
 }
 
 #[tokio::test]
-async fn banned_peer_attempts_to_connect_tcp() {
-    banned_peer_attempts_to_connect::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn banned_peer_attempts_to_connect_mock_tcp() {
+    banned_peer_attempts_to_connect::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn banned_peer_attempts_to_connect_channel() {
-    banned_peer_attempts_to_connect::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn banned_peer_attempts_to_connect_mock_channel() {
+    banned_peer_attempts_to_connect::<TestTransportChannel, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn banned_peer_attempts_to_connect_noise() {
-    banned_peer_attempts_to_connect::<
-        TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >()
-    .await;
+async fn banned_peer_attempts_to_connect_mock_noise() {
+    banned_peer_attempts_to_connect::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 // attempt to connect to banned peer
@@ -218,22 +210,18 @@ where
 }
 
 #[tokio::test]
-async fn connect_to_banned_peer_tcp() {
-    connect_to_banned_peer::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn connect_to_banned_peer_mock_tcp() {
+    connect_to_banned_peer::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn connect_to_banned_peer_channels() {
-    connect_to_banned_peer::<TestTransportChannel, DefaultNetworkingService<MpscChannelTransport>>(
-    )
-    .await;
+async fn connect_to_banned_peer_mock_channels() {
+    connect_to_banned_peer::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn connect_to_banned_peer_noise() {
-    connect_to_banned_peer::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn connect_to_banned_peer_mock_noise() {
+    connect_to_banned_peer::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn validate_invalid_outbound_connection<A, S, B>(peer_id: S::PeerId)
@@ -251,9 +239,9 @@ where
     let res = peer_manager.accept_connection(
         B::new(),
         Role::Outbound,
-        net::types::PeerInfo::<S::PeerId> {
+        net::types::PeerInfo::<S> {
             peer_id,
-            network: [1, 2, 3, 4],
+            magic_bytes: [1, 2, 3, 4],
             version: SemVer::new(0, 1, 0),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -267,9 +255,9 @@ where
     let res = peer_manager.accept_connection(
         B::new(),
         Role::Outbound,
-        net::types::PeerInfo::<S::PeerId> {
+        net::types::PeerInfo::<S> {
             peer_id,
-            network: *config.magic_bytes(),
+            magic_bytes: *config.magic_bytes(),
             version: SemVer::new(1, 1, 1),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -284,9 +272,9 @@ where
     let res = peer_manager.accept_connection(
         address.clone(),
         Role::Outbound,
-        net::types::PeerInfo::<S::PeerId> {
+        net::types::PeerInfo::<S> {
             peer_id,
-            network: *config.magic_bytes(),
+            magic_bytes: *config.magic_bytes(),
             version: SemVer::new(0, 1, 0),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -300,32 +288,32 @@ where
 }
 
 #[tokio::test]
-async fn validate_invalid_outbound_connection_tcp() {
+async fn validate_invalid_outbound_connection_mock_tcp() {
     validate_invalid_outbound_connection::<
         TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
+        MockService<TcpTransportSocket>,
         TestTcpAddressMaker,
-    >(PeerId::new())
+    >(MockPeerId::new())
     .await;
 }
 
 #[tokio::test]
-async fn validate_invalid_outbound_connection_channels() {
+async fn validate_invalid_outbound_connection_mock_channels() {
     validate_invalid_outbound_connection::<
         TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
+        MockService<MockChannelTransport>,
         TestChannelAddressMaker,
-    >(PeerId::new())
+    >(MockPeerId::new())
     .await;
 }
 
 #[tokio::test]
-async fn validate_invalid_outbound_connection_noise() {
+async fn validate_invalid_outbound_connection_mock_noise() {
     validate_invalid_outbound_connection::<
         TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
+        MockService<NoiseTcpTransport>,
         TestTcpAddressMaker,
-    >(PeerId::new())
+    >(MockPeerId::new())
     .await;
 }
 
@@ -343,9 +331,9 @@ where
     // invalid magic bytes
     let res = peer_manager.accept_inbound_connection(
         B::new(),
-        net::types::PeerInfo::<S::PeerId> {
+        net::types::PeerInfo::<S> {
             peer_id,
-            network: [1, 2, 3, 4],
+            magic_bytes: [1, 2, 3, 4],
             version: SemVer::new(0, 1, 0),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -358,9 +346,9 @@ where
     // invalid version
     let res = peer_manager.accept_inbound_connection(
         B::new(),
-        net::types::PeerInfo::<S::PeerId> {
+        net::types::PeerInfo::<S> {
             peer_id,
-            network: *config.magic_bytes(),
+            magic_bytes: *config.magic_bytes(),
             version: SemVer::new(1, 1, 1),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -374,9 +362,9 @@ where
     let address = B::new();
     let res = peer_manager.accept_inbound_connection(
         address.clone(),
-        net::types::PeerInfo::<S::PeerId> {
+        net::types::PeerInfo::<S> {
             peer_id,
-            network: *config.magic_bytes(),
+            magic_bytes: *config.magic_bytes(),
             version: SemVer::new(0, 1, 0),
             agent: None,
             subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions].into_iter().collect(),
@@ -390,32 +378,32 @@ where
 }
 
 #[tokio::test]
-async fn validate_invalid_inbound_connection_tcp() {
+async fn validate_invalid_inbound_connection_mock_tcp() {
     validate_invalid_inbound_connection::<
         TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
+        MockService<TcpTransportSocket>,
         TestTcpAddressMaker,
-    >(PeerId::new())
+    >(MockPeerId::new())
     .await;
 }
 
 #[tokio::test]
-async fn validate_invalid_inbound_connection_channels() {
+async fn validate_invalid_inbound_connection_mock_channels() {
     validate_invalid_inbound_connection::<
         TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
+        MockService<MockChannelTransport>,
         TestChannelAddressMaker,
-    >(PeerId::new())
+    >(MockPeerId::new())
     .await;
 }
 
 #[tokio::test]
-async fn validate_invalid_inbound_connection_noise() {
+async fn validate_invalid_inbound_connection_mock_noise() {
     validate_invalid_inbound_connection::<
         TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
+        MockService<NoiseTcpTransport>,
         TestTcpAddressMaker,
-    >(PeerId::new())
+    >(MockPeerId::new())
     .await;
 }
 
@@ -466,28 +454,17 @@ where
 }
 
 #[tokio::test]
-async fn inbound_connection_invalid_magic_tcp() {
-    inbound_connection_invalid_magic::<
-        TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
-    >()
-    .await;
+async fn inbound_connection_invalid_magic_mock_tcp() {
+    inbound_connection_invalid_magic::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn inbound_connection_invalid_magic_channels() {
-    inbound_connection_invalid_magic::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn inbound_connection_invalid_magic_mock_channels() {
+    inbound_connection_invalid_magic::<TestTransportChannel, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn inbound_connection_invalid_magic_noise() {
-    inbound_connection_invalid_magic::<
-        TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >()
-    .await;
+async fn inbound_connection_invalid_magic_mock_noise() {
+    inbound_connection_invalid_magic::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
diff --git a/p2p/src/peer_manager/tests/connections.rs b/p2p/src/peer_manager/tests/connections.rs
index fcb87111d..64cd24f9a 100644
--- a/p2p/src/peer_manager/tests/connections.rs
+++ b/p2p/src/peer_manager/tests/connections.rs
@@ -37,12 +37,12 @@ use crate::{
     event::PeerManagerEvent,
     net::{
         self,
-        default_backend::{
-            transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-            types::PeerId,
-            DefaultNetworkingService,
+        mock::{
+            transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+            types::MockPeerId,
+            MockService,
         },
-        types::{PeerInfo, PubSubTopic},
+        types::PubSubTopic,
         ConnectivityService, NetworkingService,
     },
     peer_manager::{self, tests::make_peer_manager},
@@ -72,31 +72,13 @@ async fn test_peer_manager_connect<T: NetworkingService>(
 }
 
 #[tokio::test]
-async fn test_peer_manager_connect_tcp() {
+async fn test_peer_manager_connect_mock() {
     let transport = TestTransportTcp::make_transport();
     let bind_addr = TestTransportTcp::make_address();
     let remote_addr: SocketAddr = "[::1]:1".parse().unwrap();
 
-    test_peer_manager_connect::<DefaultNetworkingService<TcpTransportSocket>>(
-        transport,
-        bind_addr,
-        remote_addr,
-    )
-    .await;
-}
-
-#[tokio::test]
-async fn test_peer_manager_connect_tcp_noise() {
-    let transport = TestTransportNoise::make_transport();
-    let bind_addr = TestTransportTcp::make_address();
-    let remote_addr: SocketAddr = "[::1]:1".parse().unwrap();
-
-    test_peer_manager_connect::<DefaultNetworkingService<NoiseTcpTransport>>(
-        transport,
-        bind_addr,
-        remote_addr,
-    )
-    .await;
+    test_peer_manager_connect::<MockService<TcpTransportSocket>>(transport, bind_addr, remote_addr)
+        .await;
 }
 
 // verify that the auto-connect functionality works if the number of active connections
@@ -134,19 +116,18 @@ where
 }
 
 #[tokio::test]
-async fn test_auto_connect_tcp() {
-    test_auto_connect::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn test_auto_connect_mock_tcp() {
+    test_auto_connect::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn test_auto_connect_channels() {
-    test_auto_connect::<TestTransportChannel, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn test_auto_connect_mock_channels() {
+    test_auto_connect::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn test_auto_connect_noise() {
-    test_auto_connect::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn test_auto_connect_mock_noise() {
+    test_auto_connect::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn connect_outbound_same_network<A, T>()
@@ -170,22 +151,19 @@ where
 }
 
 #[tokio::test]
-async fn connect_outbound_same_network_tcp() {
-    connect_outbound_same_network::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn connect_outbound_same_network_mock_tcp() {
+    connect_outbound_same_network::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn connect_outbound_same_network_channels() {
-    connect_outbound_same_network::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn connect_outbound_same_network_mock_channels() {
+    connect_outbound_same_network::<TestTransportChannel, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn connect_outbound_same_network_noise() {
-    connect_outbound_same_network::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn connect_outbound_same_network_mock_noise() {
+    connect_outbound_same_network::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn connect_outbound_different_network<A, T>()
@@ -211,34 +189,24 @@ where
         &mut pm1.peer_connectivity_handle,
     )
     .await;
-    assert_ne!(peer_info.network, *config.magic_bytes());
+    assert_ne!(peer_info.magic_bytes, *config.magic_bytes());
 }
 
 #[tokio::test]
-async fn connect_outbound_different_network_tcp() {
-    connect_outbound_different_network::<
-        TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
-    >()
-    .await;
+async fn connect_outbound_different_network_mock_tcp() {
+    connect_outbound_different_network::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn connect_outbound_different_network_channels() {
-    connect_outbound_different_network::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn connect_outbound_different_network_mock_channels() {
+    connect_outbound_different_network::<TestTransportChannel, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn connect_outbound_different_network_noise() {
-    connect_outbound_different_network::<
-        TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >()
-    .await;
+async fn connect_outbound_different_network_mock_noise() {
+    connect_outbound_different_network::<TestTransportNoise, MockService<NoiseTcpTransport>>()
+        .await;
 }
 
 async fn connect_inbound_same_network<A, T>()
@@ -266,24 +234,18 @@ where
 }
 
 #[tokio::test]
-async fn connect_inbound_same_network_tcp() {
-    connect_inbound_same_network::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>(
-    )
-    .await;
+async fn connect_inbound_same_network_mock_tcp() {
+    connect_inbound_same_network::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn connect_inbound_same_network_channel() {
-    connect_inbound_same_network::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn connect_inbound_same_network_mock_channel() {
+    connect_inbound_same_network::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn connect_inbound_same_network_noise() {
-    connect_inbound_same_network::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn connect_inbound_same_network_mock_noise() {
+    connect_inbound_same_network::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn connect_inbound_different_network<A, T>()
@@ -324,30 +286,19 @@ where
 }
 
 #[tokio::test]
-async fn connect_inbound_different_network_tcp() {
-    connect_inbound_different_network::<
-        TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
-    >()
-    .await;
+async fn connect_inbound_different_network_mock_tcp() {
+    connect_inbound_different_network::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn connect_inbound_different_network_channels() {
-    connect_inbound_different_network::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn connect_inbound_different_network_mock_channels() {
+    connect_inbound_different_network::<TestTransportChannel, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn connect_inbound_different_network_noise() {
-    connect_inbound_different_network::<
-        TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >()
-    .await;
+async fn connect_inbound_different_network_mock_noise() {
+    connect_inbound_different_network::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn remote_closes_connection<A, T>()
@@ -389,23 +340,21 @@ where
 }
 
 #[tokio::test]
-async fn remote_closes_connection_tcp() {
-    remote_closes_connection::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn remote_closes_connection_mock_tcp() {
+    remote_closes_connection::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn remote_closes_connection_channels() {
-    remote_closes_connection::<TestTransportChannel, DefaultNetworkingService<MpscChannelTransport>>().await;
+async fn remote_closes_connection_mock_channels() {
+    remote_closes_connection::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn remote_closes_connection_noise() {
-    remote_closes_connection::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn remote_closes_connection_mock_noise() {
+    remote_closes_connection::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
-async fn inbound_connection_too_many_peers<A, T>(peers: Vec<(T::Address, PeerInfo<T::PeerId>)>)
+async fn inbound_connection_too_many_peers<A, T>(peers: Vec<(T::Address, net::types::PeerInfo<T>)>)
 where
     A: TestTransportMaker<Transport = T::Transport, Address = T::Address>,
     T: NetworkingService + 'static + std::fmt::Debug,
@@ -451,15 +400,15 @@ where
 }
 
 #[tokio::test]
-async fn inbound_connection_too_many_peers_tcp() {
+async fn inbound_connection_too_many_peers_mock_tcp() {
     let config = Arc::new(config::create_mainnet());
     let peers = (0..peer_manager::MAX_ACTIVE_CONNECTIONS)
         .map(|index| {
             (
                 format!("127.0.0.1:{}", index + 10000).parse().expect("valid address"),
-                PeerInfo {
-                    peer_id: PeerId::new(),
-                    network: *config.magic_bytes(),
+                net::types::PeerInfo::<MockService<TcpTransportSocket>> {
+                    peer_id: MockPeerId::new(),
+                    magic_bytes: *config.magic_bytes(),
                     version: common::primitives::semver::SemVer::new(0, 1, 0),
                     agent: None,
                     subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions]
@@ -470,23 +419,20 @@ async fn inbound_connection_too_many_peers_tcp() {
         })
         .collect::<Vec<_>>();
 
-    inbound_connection_too_many_peers::<
-        TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
-    >(peers)
-    .await;
+    inbound_connection_too_many_peers::<TestTransportTcp, MockService<TcpTransportSocket>>(peers)
+        .await;
 }
 
 #[tokio::test]
-async fn inbound_connection_too_many_peers_channels() {
+async fn inbound_connection_too_many_peers_mock_channels() {
     let config = Arc::new(config::create_mainnet());
     let peers = (0..peer_manager::MAX_ACTIVE_CONNECTIONS)
         .map(|index| {
             (
                 format!("{}", index + 10000).parse().expect("valid address"),
-                PeerInfo {
-                    peer_id: PeerId::new(),
-                    network: *config.magic_bytes(),
+                net::types::PeerInfo::<MockService<MockChannelTransport>> {
+                    peer_id: MockPeerId::new(),
+                    magic_bytes: *config.magic_bytes(),
                     version: common::primitives::semver::SemVer::new(0, 1, 0),
                     agent: None,
                     subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions]
@@ -497,23 +443,22 @@ async fn inbound_connection_too_many_peers_channels() {
         })
         .collect::<Vec<_>>();
 
-    inbound_connection_too_many_peers::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >(peers)
+    inbound_connection_too_many_peers::<TestTransportChannel, MockService<MockChannelTransport>>(
+        peers,
+    )
     .await;
 }
 
 #[tokio::test]
-async fn inbound_connection_too_many_peers_noise() {
+async fn inbound_connection_too_many_peers_mock_noise() {
     let config = Arc::new(config::create_mainnet());
     let peers = (0..peer_manager::MAX_ACTIVE_CONNECTIONS)
         .map(|index| {
             (
                 format!("127.0.0.1:{}", index + 10000).parse().expect("valid address"),
-                PeerInfo {
-                    peer_id: PeerId::new(),
-                    network: *config.magic_bytes(),
+                net::types::PeerInfo::<MockService<NoiseTcpTransport>> {
+                    peer_id: MockPeerId::new(),
+                    magic_bytes: *config.magic_bytes(),
                     version: common::primitives::semver::SemVer::new(0, 1, 0),
                     agent: None,
                     subscriptions: [PubSubTopic::Blocks, PubSubTopic::Transactions]
@@ -524,11 +469,8 @@ async fn inbound_connection_too_many_peers_noise() {
         })
         .collect::<Vec<_>>();
 
-    inbound_connection_too_many_peers::<
-        TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >(peers)
-    .await;
+    inbound_connection_too_many_peers::<TestTransportNoise, MockService<NoiseTcpTransport>>(peers)
+        .await;
 }
 
 async fn connection_timeout<T>(transport: T::Transport, addr1: T::Address, addr2: T::Address)
@@ -559,8 +501,8 @@ where
 }
 
 #[tokio::test]
-async fn connection_timeout_tcp() {
-    connection_timeout::<DefaultNetworkingService<TcpTransportSocket>>(
+async fn connection_timeout_mock_tcp() {
+    connection_timeout::<MockService<TcpTransportSocket>>(
         TestTransportTcp::make_transport(),
         TestTransportTcp::make_address(),
         TestTransportTcp::make_address(),
@@ -569,8 +511,8 @@ async fn connection_timeout_tcp() {
 }
 
 #[tokio::test]
-async fn connection_timeout_channels() {
-    connection_timeout::<DefaultNetworkingService<MpscChannelTransport>>(
+async fn connection_timeout_mock_channels() {
+    connection_timeout::<MockService<MockChannelTransport>>(
         TestTransportChannel::make_transport(),
         TestTransportChannel::make_address(),
         65_535,
@@ -579,8 +521,8 @@ async fn connection_timeout_channels() {
 }
 
 #[tokio::test]
-async fn connection_timeout_noise() {
-    connection_timeout::<DefaultNetworkingService<NoiseTcpTransport>>(
+async fn connection_timeout_mock_noise() {
+    connection_timeout::<MockService<NoiseTcpTransport>>(
         TestTransportNoise::make_transport(),
         TestTransportNoise::make_address(),
         TestTransportNoise::make_address(),
@@ -637,8 +579,8 @@ async fn connection_timeout_rpc_notified<T>(
 }
 
 #[tokio::test]
-async fn connection_timeout_rpc_notified_tcp() {
-    connection_timeout_rpc_notified::<DefaultNetworkingService<TcpTransportSocket>>(
+async fn connection_timeout_rpc_notified_mock_tcp() {
+    connection_timeout_rpc_notified::<MockService<TcpTransportSocket>>(
         TestTransportTcp::make_transport(),
         TestTransportTcp::make_address(),
         TestTransportTcp::make_address(),
@@ -647,8 +589,8 @@ async fn connection_timeout_rpc_notified_tcp() {
 }
 
 #[tokio::test]
-async fn connection_timeout_rpc_notified_channels() {
-    connection_timeout_rpc_notified::<DefaultNetworkingService<MpscChannelTransport>>(
+async fn connection_timeout_rpc_notified_mock_channels() {
+    connection_timeout_rpc_notified::<MockService<MockChannelTransport>>(
         TestTransportChannel::make_transport(),
         TestTransportChannel::make_address(),
         9999,
@@ -657,8 +599,8 @@ async fn connection_timeout_rpc_notified_channels() {
 }
 
 #[tokio::test]
-async fn connection_timeout_rpc_notified_noise() {
-    connection_timeout_rpc_notified::<DefaultNetworkingService<NoiseTcpTransport>>(
+async fn connection_timeout_rpc_notified_mock_noise() {
+    connection_timeout_rpc_notified::<MockService<NoiseTcpTransport>>(
         TestTransportNoise::make_transport(),
         TestTransportNoise::make_address(),
         TestTransportNoise::make_address(),
@@ -715,7 +657,7 @@ where
         let (rtx, rrx) = oneshot::channel();
         tx1.send(PeerManagerEvent::GetConnectedPeers(rtx)).unwrap();
         let connected_peers = timeout(Duration::from_secs(1), rrx).await.unwrap().unwrap();
-        // The backend will also make reverse connection.
+        // Mock backend will also make reverse connection.
         if connected_peers.len() == 1 || connected_peers.len() == 2 {
             break;
         }
@@ -727,17 +669,16 @@ where
 }
 
 #[tokio::test]
-async fn connection_add_node_tcp() {
-    connection_add_node::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn connection_add_node_mock_tcp() {
+    connection_add_node::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn connection_add_node_noise() {
-    connection_add_node::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn connection_add_node_mock_noise() {
+    connection_add_node::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 #[tokio::test]
-async fn connection_add_node_channel() {
-    connection_add_node::<TestTransportChannel, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn connection_add_node_mock_channel() {
+    connection_add_node::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
diff --git a/p2p/src/sync/tests/block_response.rs b/p2p/src/sync/tests/block_response.rs
index ef068c4ac..7c9f5b23b 100644
--- a/p2p/src/sync/tests/block_response.rs
+++ b/p2p/src/sync/tests/block_response.rs
@@ -25,10 +25,10 @@ use common::{chain::block::consensus_data::PoWData, primitives::Idable};
 
 use crate::{
     error::{P2pError, PeerError, ProtocolError},
-    net::default_backend::{
-        transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-        types::PeerId,
-        DefaultNetworkingService,
+    net::mock::{
+        transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+        types::MockPeerId,
+        MockService,
     },
     sync::{
         peer,
@@ -58,20 +58,19 @@ where
 }
 
 #[tokio::test]
-async fn peer_doesnt_exist_tcp() {
-    peer_doesnt_exist::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn peer_doesnt_exist_mock_tcp() {
+    peer_doesnt_exist::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn peer_doesnt_exist_channels() {
-    peer_doesnt_exist::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>().await;
+async fn peer_doesnt_exist_mock_channels() {
+    peer_doesnt_exist::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn peer_doesnt_exist_noise() {
-    peer_doesnt_exist::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn peer_doesnt_exist_mock_noise() {
+    peer_doesnt_exist::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // submit valid block but the peer is in invalid state
@@ -109,19 +108,18 @@ where
 }
 
 #[tokio::test]
-async fn valid_block_tcp() {
-    valid_block::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn valid_block_mock_tcp() {
+    valid_block::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn valid_block_channels() {
-    valid_block::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn valid_block_mock_channels() {
+    valid_block::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn valid_block_noise() {
-    valid_block::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn valid_block_mock_noise() {
+    valid_block::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // submit valid block
@@ -153,33 +151,22 @@ where
 }
 
 #[tokio::test]
-async fn valid_block_invalid_state_tcp() {
-    valid_block_invalid_state::<
-        TestTransportTcp,
-        PeerId,
-        DefaultNetworkingService<TcpTransportSocket>,
-    >()
-    .await;
+async fn valid_block_invalid_state_mock_tcp() {
+    valid_block_invalid_state::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>()
+        .await;
 }
 
 #[tokio::test]
-async fn valid_block_invalid_state_channels() {
-    valid_block_invalid_state::<
-        TestTransportChannel,
-        PeerId,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
+async fn valid_block_invalid_state_mock_channels() {
+    valid_block_invalid_state::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>(
+    )
     .await;
 }
 
 #[tokio::test]
-async fn valid_block_invalid_state_noise() {
-    valid_block_invalid_state::<
-        TestTransportNoise,
-        PeerId,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >()
-    .await;
+async fn valid_block_invalid_state_mock_noise() {
+    valid_block_invalid_state::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>()
+        .await;
 }
 
 // submit the same block twice
@@ -221,31 +208,31 @@ where
 }
 
 #[tokio::test]
-async fn valid_block_resubmitted_chainstate_tcp() {
+async fn valid_block_resubmitted_chainstate_mock_tcp() {
     valid_block_resubmitted_chainstate::<
         TestTransportTcp,
-        PeerId,
-        DefaultNetworkingService<TcpTransportSocket>,
+        MockPeerId,
+        MockService<TcpTransportSocket>,
     >()
     .await;
 }
 
 #[tokio::test]
-async fn valid_block_resubmitted_chainstate_channels() {
+async fn valid_block_resubmitted_chainstate_mock_channels() {
     valid_block_resubmitted_chainstate::<
         TestTransportChannel,
-        PeerId,
-        DefaultNetworkingService<MpscChannelTransport>,
+        MockPeerId,
+        MockService<MockChannelTransport>,
     >()
     .await;
 }
 
 #[tokio::test]
-async fn valid_block_resubmitted_chainstate_noise() {
+async fn valid_block_resubmitted_chainstate_mock_noise() {
     valid_block_resubmitted_chainstate::<
         TestTransportNoise,
-        PeerId,
-        DefaultNetworkingService<NoiseTcpTransport>,
+        MockPeerId,
+        MockService<NoiseTcpTransport>,
     >()
     .await;
 }
@@ -291,18 +278,16 @@ where
 }
 
 #[tokio::test]
-async fn invalid_block_tcp() {
-    invalid_block::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn invalid_block_mock_tcp() {
+    invalid_block::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn invalid_block_channels() {
-    invalid_block::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn invalid_block_mock_channels() {
+    invalid_block::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn invalid_block_noise() {
-    invalid_block::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn invalid_block_mock_noise() {
+    invalid_block::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
diff --git a/p2p/src/sync/tests/connection.rs b/p2p/src/sync/tests/connection.rs
index 602a78aec..454cba6c9 100644
--- a/p2p/src/sync/tests/connection.rs
+++ b/p2p/src/sync/tests/connection.rs
@@ -19,10 +19,10 @@ use crate::testing_utils::{
 
 use crate::{
     error::{P2pError, PeerError},
-    net::default_backend::{
-        transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-        types::PeerId,
-        DefaultNetworkingService,
+    net::mock::{
+        transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+        types::MockPeerId,
+        MockService,
     },
     sync::tests::{make_sync_manager, register_peer, MakeTestPeerId},
     ConnectivityService, NetworkingService, SyncingMessagingService,
@@ -51,23 +51,19 @@ where
 }
 
 #[tokio::test]
-async fn test_peer_reconnected_tcp() {
-    test_peer_reconnected::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn test_peer_reconnected_mock_tcp() {
+    test_peer_reconnected::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn test_peer_reconnected_channels() {
-    test_peer_reconnected::<
-        TestTransportChannel,
-        PeerId,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn test_peer_reconnected_mock_channels() {
+    test_peer_reconnected::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn test_peer_reconnected_noise() {
-    test_peer_reconnected::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn test_peer_reconnected_mock_noise() {
+    test_peer_reconnected::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // handle peer disconnection event
@@ -98,21 +94,18 @@ where
 }
 
 #[tokio::test]
-async fn test_peer_disconnected_tcp() {
-    test_peer_disconnected::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn test_peer_disconnected_mock_tcp() {
+    test_peer_disconnected::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn test_peer_disconnected_channels() {
-    test_peer_disconnected::<
-        TestTransportChannel,
-        PeerId,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn test_peer_disconnected_mock_channels() {
+    test_peer_disconnected::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn test_peer_disconnected_noise() {
-    test_peer_disconnected::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn test_peer_disconnected_mock_noise() {
+    test_peer_disconnected::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>()
+        .await;
 }
diff --git a/p2p/src/sync/tests/header_response.rs b/p2p/src/sync/tests/header_response.rs
index 3736c4e74..64df21b9a 100644
--- a/p2p/src/sync/tests/header_response.rs
+++ b/p2p/src/sync/tests/header_response.rs
@@ -24,10 +24,10 @@ use p2p_test_utils::TestBlockInfo;
 
 use crate::{
     error::{P2pError, PeerError, ProtocolError},
-    net::default_backend::{
-        transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-        types::PeerId,
-        DefaultNetworkingService,
+    net::mock::{
+        transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+        types::MockPeerId,
+        MockService,
     },
     sync::{
         peer,
@@ -68,20 +68,18 @@ where
 }
 
 #[tokio::test]
-async fn too_many_headers_tcp() {
-    too_many_headers::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn too_many_headers_mock_tcp() {
+    too_many_headers::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn too_many_headers_channels() {
-    too_many_headers::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>().await;
+async fn too_many_headers_mock_channels() {
+    too_many_headers::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn too_many_headers_noise() {
-    too_many_headers::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn too_many_headers_mock_noise() {
+    too_many_headers::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // header response is empty
@@ -106,22 +104,18 @@ where
 }
 
 #[tokio::test]
-async fn empty_response_tcp() {
-    empty_response::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn empty_response_mock_tcp() {
+    empty_response::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn empty_response_channels() {
-    empty_response::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>(
-    )
-    .await;
+async fn empty_response_mock_channels() {
+    empty_response::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn empty_response_noise() {
-    empty_response::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn empty_response_mock_noise() {
+    empty_response::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // valid response with headers in order and the first header attaching to local chain
@@ -159,22 +153,18 @@ where
 }
 
 #[tokio::test]
-async fn valid_response_tcp() {
-    valid_response::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn valid_response_mock_tcp() {
+    valid_response::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn valid_response_channles() {
-    valid_response::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>(
-    )
-    .await;
+async fn valid_response_mock_channles() {
+    valid_response::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn valid_response_noise() {
-    valid_response::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn valid_response_mock_noise() {
+    valid_response::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // the first header doesn't attach to local chain
@@ -211,31 +201,31 @@ where
 }
 
 #[tokio::test]
-async fn header_doesnt_attach_to_local_chain_tcp() {
+async fn header_doesnt_attach_to_local_chain_mock_tcp() {
     header_doesnt_attach_to_local_chain::<
         TestTransportTcp,
-        PeerId,
-        DefaultNetworkingService<TcpTransportSocket>,
+        MockPeerId,
+        MockService<TcpTransportSocket>,
     >()
     .await;
 }
 
 #[tokio::test]
-async fn header_doesnt_attach_to_local_chain_channel() {
+async fn header_doesnt_attach_to_local_chain_mock_channel() {
     header_doesnt_attach_to_local_chain::<
         TestTransportChannel,
-        PeerId,
-        DefaultNetworkingService<MpscChannelTransport>,
+        MockPeerId,
+        MockService<MockChannelTransport>,
     >()
     .await;
 }
 
 #[tokio::test]
-async fn header_doesnt_attach_to_local_chain_noise() {
+async fn header_doesnt_attach_to_local_chain_mock_noise() {
     header_doesnt_attach_to_local_chain::<
         TestTransportNoise,
-        PeerId,
-        DefaultNetworkingService<NoiseTcpTransport>,
+        MockPeerId,
+        MockService<NoiseTcpTransport>,
     >()
     .await;
 }
@@ -275,25 +265,19 @@ where
 }
 
 #[tokio::test]
-async fn headers_not_in_order_tcp() {
-    headers_not_in_order::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>(
-    )
-    .await;
+async fn headers_not_in_order_mock_tcp() {
+    headers_not_in_order::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn headers_not_in_order_channels() {
-    headers_not_in_order::<
-        TestTransportChannel,
-        PeerId,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn headers_not_in_order_mock_channels() {
+    headers_not_in_order::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn headers_not_in_order_noise() {
-    headers_not_in_order::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn headers_not_in_order_mock_noise() {
+    headers_not_in_order::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // peer state is incorrect to be sending header responses
@@ -332,20 +316,18 @@ where
 }
 
 #[tokio::test]
-async fn invalid_state_tcp() {
-    invalid_state::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn invalid_state_mock_tcp() {
+    invalid_state::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn invalid_state_channels() {
-    invalid_state::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn invalid_state_mock_channels() {
+    invalid_state::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn invalid_state_noise() {
-    invalid_state::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn invalid_state_mock_noise() {
+    invalid_state::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
 
 // peer doesn't exist
@@ -369,18 +351,17 @@ where
 }
 
 #[tokio::test]
-async fn peer_doesnt_exist_tcp() {
-    peer_doesnt_exist::<TestTransportTcp, PeerId, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+async fn peer_doesnt_exist_mock_tcp() {
+    peer_doesnt_exist::<TestTransportTcp, MockPeerId, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn peer_doesnt_exist_channels() {
-    peer_doesnt_exist::<TestTransportChannel, PeerId, DefaultNetworkingService<MpscChannelTransport>>().await;
+async fn peer_doesnt_exist_mock_channels() {
+    peer_doesnt_exist::<TestTransportChannel, MockPeerId, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn peer_doesnt_exist_noise() {
-    peer_doesnt_exist::<TestTransportNoise, PeerId, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+async fn peer_doesnt_exist_mock_noise() {
+    peer_doesnt_exist::<TestTransportNoise, MockPeerId, MockService<NoiseTcpTransport>>().await;
 }
diff --git a/p2p/src/sync/tests/mod.rs b/p2p/src/sync/tests/mod.rs
index 8384b728b..9e69411dc 100644
--- a/p2p/src/sync/tests/mod.rs
+++ b/p2p/src/sync/tests/mod.rs
@@ -27,7 +27,7 @@ use chainstate::{make_chainstate, ChainstateConfig, DefaultTransactionVerificati
 use crate::{
     config::{NodeType, P2pConfig},
     event::{PeerManagerEvent, SyncControlEvent},
-    net::{default_backend::types::PeerId, ConnectivityService},
+    net::{mock::types::MockPeerId, ConnectivityService},
     sync::{peer, BlockSyncManager},
     NetworkingService, SyncingMessagingService,
 };
@@ -113,10 +113,10 @@ pub trait MakeTestPeerId {
     fn new() -> Self::PeerId;
 }
 
-impl MakeTestPeerId for PeerId {
+impl MakeTestPeerId for MockPeerId {
     type PeerId = Self;
 
     fn new() -> Self::PeerId {
-        PeerId::new()
+        MockPeerId::new()
     }
 }
diff --git a/p2p/src/sync/tests/request_response.rs b/p2p/src/sync/tests/request_response.rs
index 76b8748fc..c8855029b 100644
--- a/p2p/src/sync/tests/request_response.rs
+++ b/p2p/src/sync/tests/request_response.rs
@@ -22,9 +22,9 @@ use chainstate::Locator;
 use crate::{
     message::{HeaderListRequest, HeaderListResponse, SyncRequest, SyncResponse},
     net::{
-        default_backend::{
-            transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-            DefaultNetworkingService,
+        mock::{
+            transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+            MockService,
         },
         types::SyncingEvent,
     },
@@ -83,19 +83,18 @@ where
 }
 
 #[tokio::test]
-async fn request_response_tcp() {
-    request_response::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn request_response_mock_tcp() {
+    request_response::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn request_response_channels() {
-    request_response::<TestTransportChannel, DefaultNetworkingService<MpscChannelTransport>>()
-        .await;
+async fn request_response_mock_channels() {
+    request_response::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 #[tokio::test]
-async fn test_request_response_noise() {
-    request_response::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>().await;
+async fn test_request_response_mock_noise() {
+    request_response::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
 
 async fn multiple_requests_and_responses<A, T>()
@@ -173,24 +172,17 @@ where
 }
 
 #[tokio::test]
-async fn multiple_requests_and_responses_tcp() {
-    multiple_requests_and_responses::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>().await;
+async fn multiple_requests_and_responses_mock_tcp() {
+    multiple_requests_and_responses::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 #[tokio::test]
-async fn multiple_requests_and_responses_channels() {
-    multiple_requests_and_responses::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+async fn multiple_requests_and_responses_mock_channels() {
+    multiple_requests_and_responses::<TestTransportChannel, MockService<MockChannelTransport>>()
+        .await;
 }
 
 #[tokio::test]
-async fn multiple_requests_and_responses_noise() {
-    multiple_requests_and_responses::<
-        TestTransportNoise,
-        DefaultNetworkingService<NoiseTcpTransport>,
-    >()
-    .await;
+async fn multiple_requests_and_responses_mock_noise() {
+    multiple_requests_and_responses::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }
diff --git a/p2p/src/testing_utils.rs b/p2p/src/testing_utils.rs
index f3e5865af..bea874170 100644
--- a/p2p/src/testing_utils.rs
+++ b/p2p/src/testing_utils.rs
@@ -16,7 +16,6 @@
 #![allow(clippy::unwrap_used)]
 
 use std::{
-    fmt::Debug,
     net::{IpAddr, Ipv6Addr, SocketAddr},
     time::Duration,
 };
@@ -25,8 +24,8 @@ use crypto::random::{make_pseudo_rng, Rng};
 use tokio::time::timeout;
 
 use crate::net::{
-    default_backend::transport::{
-        MpscChannelTransport, NoiseEncryptionAdapter, NoiseTcpTransport, TcpTransportSocket,
+    mock::transport::{
+        MockChannelTransport, NoiseEncryptionAdapter, NoiseTcpTransport, TcpTransportSocket,
     },
     types::{ConnectivityEvent, PeerInfo},
     ConnectivityService, NetworkingService,
@@ -35,7 +34,7 @@ use crate::net::{
 /// An interface for creating transports and addresses used in tests.
 ///
 /// This abstraction layer is needed to uniformly create transports and addresses
-/// in the tests for different transport implementations.
+/// in the tests for different mocks transport implementations.
 pub trait TestTransportMaker {
     /// A transport type.
     type Transport;
@@ -71,12 +70,12 @@ impl TestTransportMaker for TestTransportTcp {
 pub struct TestTransportChannel {}
 
 impl TestTransportMaker for TestTransportChannel {
-    type Transport = MpscChannelTransport;
+    type Transport = MockChannelTransport;
 
     type Address = u32;
 
     fn make_transport() -> Self::Transport {
-        MpscChannelTransport::new()
+        MockChannelTransport::new()
     }
 
     fn make_address() -> Self::Address {
@@ -147,9 +146,9 @@ impl RandomAddressMaker for TestChannelAddressMaker {
 pub async fn connect_services<T>(
     conn1: &mut T::ConnectivityHandle,
     conn2: &mut T::ConnectivityHandle,
-) -> (T::Address, PeerInfo<T::PeerId>, PeerInfo<T::PeerId>)
+) -> (T::Address, PeerInfo<T>, PeerInfo<T>)
 where
-    T: NetworkingService + Debug,
+    T: NetworkingService + std::fmt::Debug,
     T::ConnectivityHandle: ConnectivityService<T>,
 {
     let addr = timeout(Duration::from_secs(5), conn2.local_addresses())
diff --git a/p2p/tests/backend_channels.rs b/p2p/tests/backend_mock_channels.rs
similarity index 85%
rename from p2p/tests/backend_channels.rs
rename to p2p/tests/backend_mock_channels.rs
index 8ee23705e..73c4279c8 100644
--- a/p2p/tests/backend_channels.rs
+++ b/p2p/tests/backend_mock_channels.rs
@@ -14,14 +14,14 @@
 // limitations under the License.
 
 use p2p::{
-    net::default_backend::{transport::MpscChannelTransport, DefaultNetworkingService},
+    net::mock::{transport::MockChannelTransport, MockService},
     testing_utils::{TestChannelAddressMaker, TestTransportChannel},
 };
 
 fn main() {
     p2p_backend_test_suite::run::<
         TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
+        MockService<MockChannelTransport>,
         TestChannelAddressMaker,
     >();
 }
diff --git a/p2p/tests/backend_noise.rs b/p2p/tests/backend_mock_noise.rs
similarity index 83%
rename from p2p/tests/backend_noise.rs
rename to p2p/tests/backend_mock_noise.rs
index e9c3e75c2..7b32aa8f0 100644
--- a/p2p/tests/backend_noise.rs
+++ b/p2p/tests/backend_mock_noise.rs
@@ -14,9 +14,9 @@
 // limitations under the License.
 
 use p2p::{
-    net::default_backend::{
+    net::mock::{
         transport::{NoiseEncryptionAdapter, TcpTransportSocket, WrappedTransportSocket},
-        DefaultNetworkingService,
+        MockService,
     },
     testing_utils::{TestTcpAddressMaker, TestTransportNoise},
 };
@@ -24,9 +24,7 @@ use p2p::{
 fn main() {
     p2p_backend_test_suite::run::<
         TestTransportNoise,
-        DefaultNetworkingService<
-            WrappedTransportSocket<NoiseEncryptionAdapter, TcpTransportSocket>,
-        >,
+        MockService<WrappedTransportSocket<NoiseEncryptionAdapter, TcpTransportSocket>>,
         TestTcpAddressMaker,
     >();
 }
diff --git a/p2p/tests/backend_tcp.rs b/p2p/tests/backend_mock_tcp.rs
similarity index 85%
rename from p2p/tests/backend_tcp.rs
rename to p2p/tests/backend_mock_tcp.rs
index 90a8fcf93..d65c15804 100644
--- a/p2p/tests/backend_tcp.rs
+++ b/p2p/tests/backend_mock_tcp.rs
@@ -14,14 +14,14 @@
 // limitations under the License.
 
 use p2p::{
-    net::default_backend::{transport::TcpTransportSocket, DefaultNetworkingService},
+    net::mock::{transport::TcpTransportSocket, MockService},
     testing_utils::{TestTcpAddressMaker, TestTransportTcp},
 };
 
 fn main() {
     p2p_backend_test_suite::run::<
         TestTransportTcp,
-        DefaultNetworkingService<TcpTransportSocket>,
+        MockService<TcpTransportSocket>,
         TestTcpAddressMaker,
     >();
 }
diff --git a/p2p/tests/block_announcement.rs b/p2p/tests/block_announcement.rs
index 9a88db287..e689460b4 100644
--- a/p2p/tests/block_announcement.rs
+++ b/p2p/tests/block_announcement.rs
@@ -27,9 +27,9 @@ use p2p::testing_utils::{
 use p2p::{
     message::Announcement,
     net::{
-        default_backend::{
-            transport::{MpscChannelTransport, NoiseTcpTransport, TcpTransportSocket},
-            DefaultNetworkingService,
+        mock::{
+            transport::{MockChannelTransport, NoiseTcpTransport, TcpTransportSocket},
+            MockService,
         },
         types::SyncingEvent,
         ConnectivityService, NetworkingService, SyncingMessagingService,
@@ -151,25 +151,19 @@ where
 #[ignore]
 #[tokio::test]
 async fn block_announcement_3_peers_tcp() {
-    block_announcement_3_peers::<TestTransportTcp, DefaultNetworkingService<TcpTransportSocket>>()
-        .await;
+    block_announcement_3_peers::<TestTransportTcp, MockService<TcpTransportSocket>>().await;
 }
 
 // TODO: Implement announcements resending in partially connected networks.
 #[tokio::test]
 #[ignore]
 async fn block_announcement_3_peers_channels() {
-    block_announcement_3_peers::<
-        TestTransportChannel,
-        DefaultNetworkingService<MpscChannelTransport>,
-    >()
-    .await;
+    block_announcement_3_peers::<TestTransportChannel, MockService<MockChannelTransport>>().await;
 }
 
 // TODO: Implement announcements resending in partially connected networks.
 #[ignore]
 #[tokio::test]
 async fn block_announcement_3_peers_noise() {
-    block_announcement_3_peers::<TestTransportNoise, DefaultNetworkingService<NoiseTcpTransport>>()
-        .await;
+    block_announcement_3_peers::<TestTransportNoise, MockService<NoiseTcpTransport>>().await;
 }