From 35154d8bcacfa23c3e784c3801db8e0672202166 Mon Sep 17 00:00:00 2001 From: Alexey Osipov Date: Thu, 12 Dec 2024 12:08:09 +0300 Subject: [PATCH] Adjust namespaces --- README.md | 8 ++++---- src/libp2p/Libp2p.Core.TestsBase/E2e/TestBuilder.cs | 1 - src/libp2p/Libp2p.Core.TestsBase/E2e/TestMuxerTests.cs | 1 - src/libp2p/Libp2p.Core/ILibp2pBuilderContext.cs | 6 ++++-- src/libp2p/Libp2p.Core/Peer.cs | 1 - src/libp2p/Libp2p.Core/PeerFactory.cs | 1 - src/libp2p/Libp2p.Core/PeerFactoryBuilderBase.cs | 1 - src/libp2p/Libp2p.Core/ProtocolStackSettings.cs | 2 -- src/libp2p/Libp2p.E2eTests/E2eTestSetup.cs | 2 +- src/libp2p/Libp2p.Protocols.Identify/IdentifyProtocol.cs | 1 - src/libp2p/Libp2p.Protocols.Noise/README.md | 2 +- src/libp2p/Libp2p.Protocols.Tls.Tests/TlsProtocolTests.cs | 2 +- src/libp2p/Libp2p.sln | 2 ++ src/libp2p/Libp2p/Libp2pPeerFactory.cs | 2 +- src/libp2p/Libp2p/Libp2pPeerFactoryBuilder.cs | 4 ++-- src/libp2p/Libp2p/LogMessages.cs | 2 +- src/libp2p/Libp2p/ServiceProviderExtensions.cs | 2 +- src/samples/chat/Program.cs | 2 +- src/samples/perf-benchmarks/NoStackPeerFactoryBuilder.cs | 2 +- src/samples/perf-benchmarks/Program.cs | 2 +- src/samples/pubsub-chat/Program.cs | 2 +- 21 files changed, 22 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index cac0d299..e8d2b180 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,14 @@ The target is to provide a performant well-tested implementation of a wide range | Protocol | Version | Status | |--------------------|--------------------|-----------------| | TCP | tcp | ✅ | -| QUIC | quic-v1 | ✅ | +| QUIC | quic-v1 | 🚧 | | multistream-select | /multistream/1.0.0 | ✅ | | plaintext | /plaintext/2.0.0 | ✅ | | noise | /noise | ✅ | | tls | /tls/1.0.0 | 🚧 | | WebTransport | | ⬜ help wanted | | yamux | /yamux/1.0.0 | ✅ | -| Circuit Relay | /libp2p/circuit/relay/0.2.0/* | ⬜ help wanted | +| Circuit Relay | /libp2p/circuit/relay/0.2.0/* | 🚧 | | hole punching | | ⬜ help wanted | | **Application layer** | Identify | /ipfs/id/1.0.0 | ✅ | @@ -55,11 +55,11 @@ The target is to provide a performant well-tested implementation of a wide range | pubsub | /floodsub/1.0.0 | ✅ | | | /meshsub/1.0.0 | ✅ | | | /meshsub/1.1.0 | 🚧 | -| | /meshsub/1.2.0 | ⬜ | +| | /meshsub/1.2.0 | 🚧 | | **Discovery** | mDns | basic | ✅ | | | DNS-SD | 🚧 | -| [discv5](https://github.com/Pier-Two/Lantern.Discv5) | 5.1 | 🚧 help wanted | +| [discv5](https://github.com/Pier-Two/Lantern.Discv5) (wrapper) | 5.1 | 🚧 help wanted | ⬜ - not yet implemented
🚧 - work in progress
diff --git a/src/libp2p/Libp2p.Core.TestsBase/E2e/TestBuilder.cs b/src/libp2p/Libp2p.Core.TestsBase/E2e/TestBuilder.cs index 5a499280..13ea2dbb 100644 --- a/src/libp2p/Libp2p.Core.TestsBase/E2e/TestBuilder.cs +++ b/src/libp2p/Libp2p.Core.TestsBase/E2e/TestBuilder.cs @@ -4,7 +4,6 @@ using Microsoft.Extensions.Logging; using Nethermind.Libp2p.Core.Discovery; using Nethermind.Libp2p.Protocols; -using Nethermind.Libp2p.Stack; using System.Collections.Concurrent; namespace Nethermind.Libp2p.Core.TestsBase.E2e; diff --git a/src/libp2p/Libp2p.Core.TestsBase/E2e/TestMuxerTests.cs b/src/libp2p/Libp2p.Core.TestsBase/E2e/TestMuxerTests.cs index 2e2ae85e..cb5dd3af 100644 --- a/src/libp2p/Libp2p.Core.TestsBase/E2e/TestMuxerTests.cs +++ b/src/libp2p/Libp2p.Core.TestsBase/E2e/TestMuxerTests.cs @@ -3,7 +3,6 @@ using Microsoft.Extensions.DependencyInjection; using Nethermind.Libp2p.Core.Discovery; -using Nethermind.Libp2p.Stack; using NUnit.Framework; namespace Nethermind.Libp2p.Core.TestsBase.E2e; diff --git a/src/libp2p/Libp2p.Core/ILibp2pBuilderContext.cs b/src/libp2p/Libp2p.Core/ILibp2pBuilderContext.cs index f6a1cfe7..fc5011e8 100644 --- a/src/libp2p/Libp2p.Core/ILibp2pBuilderContext.cs +++ b/src/libp2p/Libp2p.Core/ILibp2pBuilderContext.cs @@ -1,9 +1,11 @@ // SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited // SPDX-License-Identifier: MIT -using Nethermind.Libp2p.Core; -namespace Nethermind.Libp2p.Stack; +// SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited +// SPDX-License-Identifier: MIT + +namespace Nethermind.Libp2p.Core; public interface IProtocolStackSettings { diff --git a/src/libp2p/Libp2p.Core/Peer.cs b/src/libp2p/Libp2p.Core/Peer.cs index c44016a0..dd9bd4ed 100644 --- a/src/libp2p/Libp2p.Core/Peer.cs +++ b/src/libp2p/Libp2p.Core/Peer.cs @@ -7,7 +7,6 @@ using Nethermind.Libp2p.Core.Discovery; using Nethermind.Libp2p.Core.Exceptions; using Nethermind.Libp2p.Core.Extensions; -using Nethermind.Libp2p.Stack; using System.Collections.Concurrent; using System.Collections.ObjectModel; diff --git a/src/libp2p/Libp2p.Core/PeerFactory.cs b/src/libp2p/Libp2p.Core/PeerFactory.cs index bc554ba7..66bed12d 100644 --- a/src/libp2p/Libp2p.Core/PeerFactory.cs +++ b/src/libp2p/Libp2p.Core/PeerFactory.cs @@ -3,7 +3,6 @@ using Microsoft.Extensions.Logging; using Nethermind.Libp2p.Core.Discovery; -using Nethermind.Libp2p.Stack; namespace Nethermind.Libp2p.Core; diff --git a/src/libp2p/Libp2p.Core/PeerFactoryBuilderBase.cs b/src/libp2p/Libp2p.Core/PeerFactoryBuilderBase.cs index 86800156..b7dda9b5 100644 --- a/src/libp2p/Libp2p.Core/PeerFactoryBuilderBase.cs +++ b/src/libp2p/Libp2p.Core/PeerFactoryBuilderBase.cs @@ -2,7 +2,6 @@ // SPDX-License-Identifier: MIT using Microsoft.Extensions.DependencyInjection; -using Nethermind.Libp2p.Stack; namespace Nethermind.Libp2p.Core; diff --git a/src/libp2p/Libp2p.Core/ProtocolStackSettings.cs b/src/libp2p/Libp2p.Core/ProtocolStackSettings.cs index e1184fc3..f3cc0da2 100644 --- a/src/libp2p/Libp2p.Core/ProtocolStackSettings.cs +++ b/src/libp2p/Libp2p.Core/ProtocolStackSettings.cs @@ -1,8 +1,6 @@ // SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited // SPDX-License-Identifier: MIT -using Nethermind.Libp2p.Stack; - namespace Nethermind.Libp2p.Core; public class ProtocolStackSettings : IProtocolStackSettings diff --git a/src/libp2p/Libp2p.E2eTests/E2eTestSetup.cs b/src/libp2p/Libp2p.E2eTests/E2eTestSetup.cs index 3c8e571c..957bd966 100644 --- a/src/libp2p/Libp2p.E2eTests/E2eTestSetup.cs +++ b/src/libp2p/Libp2p.E2eTests/E2eTestSetup.cs @@ -1,9 +1,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; +using Nethermind.Libp2p; using Nethermind.Libp2p.Core; using Nethermind.Libp2p.Core.Discovery; using Nethermind.Libp2p.Core.TestsBase; -using Nethermind.Libp2p.Stack; using System.Text; namespace Libp2p.E2eTests; diff --git a/src/libp2p/Libp2p.Protocols.Identify/IdentifyProtocol.cs b/src/libp2p/Libp2p.Protocols.Identify/IdentifyProtocol.cs index 353dccbd..a3bb48b5 100644 --- a/src/libp2p/Libp2p.Protocols.Identify/IdentifyProtocol.cs +++ b/src/libp2p/Libp2p.Protocols.Identify/IdentifyProtocol.cs @@ -6,7 +6,6 @@ using Multiformats.Address.Net; using Nethermind.Libp2p.Core; using Nethermind.Libp2p.Protocols.Identify; -using Nethermind.Libp2p.Stack; using System.Net.Sockets; using Nethermind.Libp2p.Core.Discovery; using Nethermind.Libp2p.Core.Dto; diff --git a/src/libp2p/Libp2p.Protocols.Noise/README.md b/src/libp2p/Libp2p.Protocols.Noise/README.md index ea8941e7..5deb2726 100644 --- a/src/libp2p/Libp2p.Protocols.Noise/README.md +++ b/src/libp2p/Libp2p.Protocols.Noise/README.md @@ -1,4 +1,4 @@ -# Noise protocol +# TLS protocol - [libp2p spec](https://github.com/libp2p/specs/blob/master/noise) - [The Noise Protocol Framework](https://www.noiseprotocol.org/noise.html) diff --git a/src/libp2p/Libp2p.Protocols.Tls.Tests/TlsProtocolTests.cs b/src/libp2p/Libp2p.Protocols.Tls.Tests/TlsProtocolTests.cs index 4ee6309b..d3c08ec8 100644 --- a/src/libp2p/Libp2p.Protocols.Tls.Tests/TlsProtocolTests.cs +++ b/src/libp2p/Libp2p.Protocols.Tls.Tests/TlsProtocolTests.cs @@ -14,7 +14,7 @@ namespace Nethermind.Libp2p.Protocols.TLS.Tests; public class TlsProtocolTests { [Test] - [Ignore("Infinite loop")] + [Ignore("Needs a fix on Windows")] public async Task Test_ConnectionEstablished_AfterHandshake() { // Arrange diff --git a/src/libp2p/Libp2p.sln b/src/libp2p/Libp2p.sln index 7a8f3706..a1da66b1 100644 --- a/src/libp2p/Libp2p.sln +++ b/src/libp2p/Libp2p.sln @@ -240,6 +240,8 @@ Global {EC505F21-FC69-4432-88A8-3CD5F7899B08} = {0DC1C6A1-0A5B-43BA-9605-621C21A16716} {F14C0226-D2B1-48B8-BC6A-163BE2C8A4C6} = {6F3D9AA9-C92D-4998-BC4E-D5EA068E8D0D} {BFE1CCB2-59A3-4A69-B543-EBC9C16E39F7} = {6F3D9AA9-C92D-4998-BC4E-D5EA068E8D0D} + {C3CDBAAE-C790-443A-A293-D6E2330160F7} = {6F3D9AA9-C92D-4998-BC4E-D5EA068E8D0D} + {89BD907E-1399-4BE7-98CC-E541EAB21842} = {6F3D9AA9-C92D-4998-BC4E-D5EA068E8D0D} {EC0B1626-C006-4138-A119-FE61CDAB824D} = {6F3D9AA9-C92D-4998-BC4E-D5EA068E8D0D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/src/libp2p/Libp2p/Libp2pPeerFactory.cs b/src/libp2p/Libp2p/Libp2pPeerFactory.cs index 672fc4bf..644dc068 100644 --- a/src/libp2p/Libp2p/Libp2pPeerFactory.cs +++ b/src/libp2p/Libp2p/Libp2pPeerFactory.cs @@ -6,7 +6,7 @@ using Nethermind.Libp2p.Core.Discovery; using Nethermind.Libp2p.Protocols; -namespace Nethermind.Libp2p.Stack; +namespace Nethermind.Libp2p; public class Libp2pPeerFactory(IProtocolStackSettings protocolStackSettings, PeerStore peerStore, ILoggerFactory? loggerFactory = null) : PeerFactory(protocolStackSettings, peerStore, loggerFactory) { diff --git a/src/libp2p/Libp2p/Libp2pPeerFactoryBuilder.cs b/src/libp2p/Libp2p/Libp2pPeerFactoryBuilder.cs index f7833eff..56c665e3 100644 --- a/src/libp2p/Libp2p/Libp2pPeerFactoryBuilder.cs +++ b/src/libp2p/Libp2p/Libp2pPeerFactoryBuilder.cs @@ -4,7 +4,7 @@ using Nethermind.Libp2p.Core; using Nethermind.Libp2p.Protocols; -namespace Nethermind.Libp2p.Stack; +namespace Nethermind.Libp2p; public class Libp2pPeerFactoryBuilder(IServiceProvider? serviceProvider = default) : PeerFactoryBuilderBase(serviceProvider), ILibp2pPeerFactoryBuilder @@ -42,7 +42,7 @@ protected override ProtocolRef[] BuildStack(ProtocolRef[] additionalProtocols) { ProtocolRef tcp = Get(); - ProtocolRef[] encryption = enforcePlaintext ? [Get()] : [Get(), Get()]; + ProtocolRef[] encryption = enforcePlaintext ? [Get()] : [Get()/*, Get()*/]; ProtocolRef[] muxers = [Get()]; diff --git a/src/libp2p/Libp2p/LogMessages.cs b/src/libp2p/Libp2p/LogMessages.cs index 01b41117..17777302 100644 --- a/src/libp2p/Libp2p/LogMessages.cs +++ b/src/libp2p/Libp2p/LogMessages.cs @@ -3,7 +3,7 @@ using Microsoft.Extensions.Logging; -namespace Nethermind.Libp2p.Stack; +namespace Nethermind.Libp2p; internal static partial class LogMessages { diff --git a/src/libp2p/Libp2p/ServiceProviderExtensions.cs b/src/libp2p/Libp2p/ServiceProviderExtensions.cs index 7dbd6794..3f70a92f 100644 --- a/src/libp2p/Libp2p/ServiceProviderExtensions.cs +++ b/src/libp2p/Libp2p/ServiceProviderExtensions.cs @@ -7,7 +7,7 @@ using Nethermind.Libp2p.Protocols; using Nethermind.Libp2p.Protocols.Pubsub; -namespace Nethermind.Libp2p.Stack; +namespace Nethermind.Libp2p; public static class ServiceProviderExtensions { diff --git a/src/samples/chat/Program.cs b/src/samples/chat/Program.cs index ca871f4b..e9a7353d 100644 --- a/src/samples/chat/Program.cs +++ b/src/samples/chat/Program.cs @@ -3,10 +3,10 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Nethermind.Libp2p.Stack; using Nethermind.Libp2p.Core; using Multiformats.Address; using Multiformats.Address.Protocols; +using Nethermind.Libp2p; ServiceProvider serviceProvider = new ServiceCollection() .AddLibp2p(builder => builder.AddAppLayerProtocol()) diff --git a/src/samples/perf-benchmarks/NoStackPeerFactoryBuilder.cs b/src/samples/perf-benchmarks/NoStackPeerFactoryBuilder.cs index dee72361..fe90774c 100644 --- a/src/samples/perf-benchmarks/NoStackPeerFactoryBuilder.cs +++ b/src/samples/perf-benchmarks/NoStackPeerFactoryBuilder.cs @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText:2023 Demerzel Solutions Limited // SPDX-License-Identifier:MIT -using Nethermind.Libp2p.Stack; using Nethermind.Libp2p.Core; using Nethermind.Libp2p.Protocols; +using Nethermind.Libp2p; namespace DataTransferBenchmark; diff --git a/src/samples/perf-benchmarks/Program.cs b/src/samples/perf-benchmarks/Program.cs index 0d779128..c5a0a335 100644 --- a/src/samples/perf-benchmarks/Program.cs +++ b/src/samples/perf-benchmarks/Program.cs @@ -4,9 +4,9 @@ using System.Diagnostics; using DataTransferBenchmark; using Microsoft.Extensions.DependencyInjection; -using Nethermind.Libp2p.Stack; using Nethermind.Libp2p.Core; using Multiformats.Address; +using Nethermind.Libp2p; await Task.Delay(1000); { diff --git a/src/samples/pubsub-chat/Program.cs b/src/samples/pubsub-chat/Program.cs index 9dc076b2..4daa6dea 100644 --- a/src/samples/pubsub-chat/Program.cs +++ b/src/samples/pubsub-chat/Program.cs @@ -2,13 +2,13 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; -using Nethermind.Libp2p.Stack; using Nethermind.Libp2p.Core; using System.Text; using System.Text.Json; using Nethermind.Libp2p.Protocols.Pubsub; using Nethermind.Libp2p.Protocols; using System.Text.RegularExpressions; +using Nethermind.Libp2p; Regex omittedLogs = new(".*(MDnsDiscoveryProtocol|IpTcpProtocol).*");