Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to .NET 8 #59

Merged
merged 10 commits into from
Dec 14, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -42,10 +42,14 @@ jobs:

- name: Test
working-directory: ${{ env.WORKING_DIR }}
env:
TEST_OPTS: -c ${{ env.BUILD_CONFIG }} --no-build
run: |
dotnet test Libp2p.Core.Tests -c ${{ env.BUILD_CONFIG }} --no-build
#dotnet test Libp2p.Protocols.Multistream.Tests -c ${{ env.BUILD_CONFIG }} --no-build
dotnet test Libp2p.Protocols.Noise.Tests -c ${{ env.BUILD_CONFIG }} --no-build
dotnet test Libp2p.Core.Tests ${{ env.PACK_OPTS }}
#dotnet test Libp2p.Protocols.Multistream.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Noise.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Pubsub.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Quic.Tests ${{ env.PACK_OPTS }}

- name: Publish
working-directory: ${{ env.WORKING_DIR }}
Expand All @@ -60,11 +64,11 @@ jobs:
dotnet pack Libp2p.Protocols.MDns ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Multistream ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Noise ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Ping ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Plaintext ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Pubsub ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Quic ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Yamux ${{ env.PACK_OPTS }}
dotnet pack Libp2p.Protocols.Ping ${{ env.PACK_OPTS }}

dotnet nuget push **/*.nupkg \
-k ${{ github.event.inputs.feed == 'Production' && secrets.NUGET_API_KEY || secrets.NUGETTEST_API_KEY }} \
Expand Down
14 changes: 9 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:

- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true

Expand All @@ -28,11 +28,15 @@ jobs:

- name: Build
working-directory: ${{ env.WORKING_DIR }}
run: dotnet build -c ${{ env.BUILD_CONFIG }} --no-restore -p:Commit=${{ github.sha }}
run: dotnet build -c ${{ env.BUILD_CONFIG }} --no-restore

- name: Test
working-directory: ${{ env.WORKING_DIR }}
env:
TEST_OPTS: -c ${{ env.BUILD_CONFIG }} --no-restore
run: |
dotnet test Libp2p.Core.Tests -c ${{ env.BUILD_CONFIG }} --no-restore
#dotnet test Libp2p.Protocols.Multistream.Tests -c ${{ env.BUILD_CONFIG }} --no-restore
dotnet test Libp2p.Protocols.Noise.Tests -c ${{ env.BUILD_CONFIG }} --no-restore
dotnet test Libp2p.Core.Tests ${{ env.PACK_OPTS }}
#dotnet test Libp2p.Protocols.Multistream.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Noise.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Pubsub.Tests ${{ env.PACK_OPTS }}
dotnet test Libp2p.Protocols.Quic.Tests ${{ env.PACK_OPTS }}
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.0",
"version": "8.0.0",
"allowPrerelease": false,
"rollForward": "latestFeature"
}
Expand Down
1 change: 1 addition & 0 deletions src/libp2p/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<ContinuousIntegrationBuild Condition="'$(GITHUB_ACTIONS)' == 'true'">true</ContinuousIntegrationBuild>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Label="ProductInfo">
Expand Down
32 changes: 16 additions & 16 deletions src/libp2p/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,31 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.13.7" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.7" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.11" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.11" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.2.1" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="Google.Protobuf" Version="3.24.1" />
<PackageVersion Include="Google.Protobuf.Tools" Version="3.24.1" />
<PackageVersion Include="Google.Protobuf" Version="3.25.1" />
<PackageVersion Include="Google.Protobuf.Tools" Version="3.25.1" />
<PackageVersion Include="Makaretu.Dns.Multicast" Version="0.27.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.7.0" />
<PackageVersion Include="Microsoft.CodeAnalysis" Version="4.8.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.5.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.5.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="7.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.7.1" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="1.1.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Noise.NET" Version="1.0.0" />
<PackageVersion Include="NSubstitute" Version="5.0.0" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute.Analyzers.CSharp" Version="1.0.16" />
<PackageVersion Include="NUnit" Version="3.13.3" />
<PackageVersion Include="NUnit" Version="4.0.1" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageVersion Include="NUnit.Analyzers" Version="3.6.1" />
<PackageVersion Include="NUnit.Analyzers" Version="3.10.0" />
<PackageVersion Include="SimpleBase" Version="4.0.0" />
<PackageVersion Include="System.Runtime.Caching" Version="7.0.0" />
</ItemGroup>
</Project>
</Project>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
Expand Down
1 change: 0 additions & 1 deletion src/libp2p/Libp2p.Core.Tests/Libp2p.Core.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsPackable>false</IsPackable>
Expand Down
84 changes: 84 additions & 0 deletions src/libp2p/Libp2p.Core/Enums/Multiaddr.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
namespace Nethermind.Libp2p.Core.Enums;
public enum Multiaddr
{
Ip4 = 0x04,
Tcp = 0x06,
// draft
Dccp = 0x21,
Ip6 = 0x29,
// draft
Ip6zone = 0x2a,
// CIDR mask for IP addresses
// draft
Ipcidr = 0x2b,
Dns = 0x35,
Dns4 = 0x36,
Dns6 = 0x37,
Dnsaddr = 0x38,
// draft
Sctp = 0x84,
// draft
Udp = 0x0111,
// Use webrtc or webrtc-direct instead
// deprecated
P2pWebrtcStar = 0x0113,
// Use webrtc or webrtc-direct instead
// deprecated
P2pWebrtcDirect = 0x0114,
// deprecated
P2pStardust = 0x0115,
// ICE-lite webrtc transport with SDP munging during connection establishment and without use of a STUN server
// draft
WebrtcDirect = 0x0118,
// webrtc transport where connection establishment is according to w3c spec
// draft
Webrtc = 0x0119,
P2pCircuit = 0x0122,
// draft
Udt = 0x012d,
// draft
Utp = 0x012e,
Unix = 0x0190,
// Textile Thread
// draft
Thread = 0x0196,
// libp2p
P2p = 0x01a5,
// draft
Https = 0x01bb,
// draft
Onion = 0x01bc,
// draft
Onion3 = 0x01bd,
// I2P base64 (raw public key)
// draft
Garlic64 = 0x01be,
// I2P base32 (hashed public key or encoded public key/checksum+optional secret)
// draft
Garlic32 = 0x01bf,
// draft
Tls = 0x01c0,
// Server Name Indication RFC 6066 § 3
// draft
Sni = 0x01c1,
// draft
Noise = 0x01c6,
Quic = 0x01cc,
QuicV1 = 0x01cd,
// draft
Webtransport = 0x01d1,
// TLS certificate's fingerprint as a multihash
// draft
Certhash = 0x01d2,
Ws = 0x01dd,
Wss = 0x01de,
P2pWebsocketStar = 0x01df,
// draft
Http = 0x01e0,
// Experimental QUIC over yggdrasil and ironwood routing protocol
// draft
Silverpine = 0x3f42,
// draft
Plaintextv2 = 0x706c61,
Unknown,
}
1 change: 0 additions & 1 deletion src/libp2p/Libp2p.Core/Libp2p.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AssemblyName>Nethermind.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Nethermind.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
<EnforceExtendedAnalyzerRules>false</EnforceExtendedAnalyzerRules>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<AssemblyName>Nethermind.$(MSBuildProjectName)</AssemblyName>
<RootNamespace>Nethermind.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Nethermind.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Nethermind.$(MSBuildProjectName.Replace(" ", "_"))</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>Nethermind.Libp2p.Protocols.Multistream.Tests</RootNamespace>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/libp2p/Libp2p.Protocols.Pubsub/PubsubRouter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@ internal void OnRpc(PeerId peerId, Rpc rpc)
continue;
}

if (!message.VerifySignature())
if (!message.VerifySignature(settings.DefaultSignaturePolicy))
{
limboMessageCache!.Add(messageId, message);
continue;
Expand Down
Loading
Loading