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

Migrate to .NET 9 #7532

Merged
merged 36 commits into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bd29127
Switch to .NET 9
rubo Sep 14, 2024
35bcaac
Update packages
rubo Sep 19, 2024
8d2f24b
Merge branch 'master' into feature/dotnet9-migration
rubo Sep 21, 2024
f9455ea
Update Docker files
rubo Sep 26, 2024
2a30f62
Merge branch 'master' into feature/dotnet9-migration
rubo Sep 26, 2024
35976d5
Merge branch 'master' into feature/dotnet9-migration
rubo Sep 30, 2024
bd43063
Update tools' target framework
rubo Oct 7, 2024
a83afee
Merge branch 'master' into feature/dotnet9-migration
rubo Oct 7, 2024
e5eac31
Merge branch 'master' into feature/dotnet9-migration
rubo Oct 10, 2024
ea2f47c
Add `Directory.Build.props` to tools
rubo Oct 10, 2024
4e7b370
Merge branch 'master' into feature/dotnet9-migration
rubo Oct 10, 2024
e000fe0
Remove redundant `$TARGETPLATFORM`
rubo Oct 11, 2024
082149f
Update packages
rubo Oct 14, 2024
e08e3f6
Merge remote-tracking branch 'origin/master' into feature/dotnet9-mig…
asdacap Oct 17, 2024
cbf6204
Remove to array
asdacap Oct 18, 2024
c867b90
Merge remote-tracking branch 'origin/master' into feature/dotnet9-mig…
asdacap Oct 18, 2024
7090a43
Merge branch 'master' into feature/dotnet9-migration
rubo Nov 1, 2024
fb25b0d
Update debug Dockerfile
rubo Nov 1, 2024
70f26cb
Merge branch 'master' into feature/dotnet9-migration
rubo Nov 18, 2024
60da617
Revise workflows
rubo Nov 18, 2024
2a5ee93
Enable warnings as errors
rubo Nov 18, 2024
03ad186
Fix CA2265 warning
rubo Nov 18, 2024
aac9c6d
Update packages
rubo Nov 18, 2024
a004d0f
Disable warnings as errors
rubo Nov 18, 2024
7f14edc
Remove redundant target framework
rubo Nov 18, 2024
254bbae
Update Ckzg `precompute`
rubo Nov 18, 2024
65c4e3f
Updated Ckzg trusted setup
rubo Nov 18, 2024
15e9462
Fix test
rubo Nov 18, 2024
84c8958
Fix tests
rubo Nov 18, 2024
be0544e
Fix formatting
rubo Nov 18, 2024
a38351f
Enable warnings as errors and change NuGet audit mode
rubo Nov 19, 2024
ae9bf39
Fix solutions build workflow
rubo Nov 19, 2024
980804f
Update tools
rubo Nov 19, 2024
2d20327
Update `global.json`
rubo Nov 19, 2024
c370608
Switch to file scope namespaces
rubo Nov 19, 2024
1b7491c
Update Nethermind.Crypto.SecP256k1 package
rubo Nov 19, 2024
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
16 changes: 5 additions & 11 deletions .github/workflows/build-solutions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,16 @@ jobs:
config: [release, debug]
solution: [Nethermind, EthereumTests, Benchmarks]
steps:
- name: Free up disk space
uses: jlumbroso/free-disk-space@main
with:
large-packages: false
tool-cache: false
- name: Check out repository
uses: actions/checkout@v4
with:
submodules: ${{ matrix.solution == 'EthereumTests' }}
- name: Set up .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.403
- name: Cache dotnet packages
id: cache-dotnet
uses: actions/cache@v4
with:
# nuget cache files are stored in `~/.nuget/packages/` on Linux/macOS
path: ~/.nuget/packages/
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
restore-keys: |
${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
- name: Build ${{ matrix.solution }}.sln
run: dotnet build src/Nethermind/${{ matrix.solution }}.sln -c ${{ matrix.config }}
6 changes: 0 additions & 6 deletions .github/workflows/nethermind-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ jobs:
uses: actions/checkout@v4
- name: Set up .NET
uses: actions/setup-dotnet@v4
- name: Cache dotnet packages
id: cache-dotnet
uses: actions/cache/restore@v4
with:
path: ~/.nuget/packages/
key: ${{ runner.os }}-nuget-${{ hashFiles('**/Directory.Packages.props') }}
- name: ${{ matrix.project }}
id: test
run: |
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build

ARG BUILD_CONFIG=release
ARG BUILD_TIMESTAMP
Expand All @@ -18,7 +18,7 @@ RUN arch=$([ "$TARGETARCH" = "amd64" ] && echo "x64" || echo "$TARGETARCH") && \
# A temporary symlink to support the old executable name
RUN ln -s -r /publish/nethermind /publish/Nethermind.Runner

FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble

WORKDIR /nethermind

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.chiseled
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2024 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build

ARG BUILD_CONFIG=release
ARG BUILD_TIMESTAMP
Expand All @@ -21,7 +21,7 @@ RUN cd /publish && \
mkdir logs && \
mkdir nethermind_db

FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble-chiseled
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble-chiseled

WORKDIR /nethermind

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.diag
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
# SPDX-License-Identifier: LGPL-3.0-only

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0-noble AS build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-noble AS build

ARG BUILD_CONFIG=release
ARG BUILD_TIMESTAMP
Expand All @@ -22,7 +22,7 @@ RUN dotnet tool install -g dotnet-dump && \
dotnet tool install -g dotnet-trace && \
dotnet tool install -g JetBrains.dotTrace.GlobalTools

FROM mcr.microsoft.com/dotnet/aspnet:8.0-noble
FROM mcr.microsoft.com/dotnet/aspnet:9.0-noble

WORKDIR /nethermind

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"version": "9.0.0",
"allowPrerelease": false,
"rollForward": "latestFeature"
}
Expand Down
3 changes: 2 additions & 1 deletion src/Nethermind/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
<LangVersion>latest</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<NuGetAuditMode>direct</NuGetAuditMode>
<TargetFramework>net9.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>
Expand Down
60 changes: 30 additions & 30 deletions src/Nethermind/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,51 +3,51 @@
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI" Version="8.0.2" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.Client" Version="8.0.1" />
<PackageVersion Include="AspNetCore.HealthChecks.UI.InMemory.Storage" Version="8.0.1" />
<PackageVersion Include="Autofac" Version="8.1.0" />
<PackageVersion Include="Autofac" Version="8.1.1" />
<PackageVersion Include="Autofac.Extensions.DependencyInjection" Version="10.0.0" />
<PackageVersion Include="BenchmarkDotNet" Version="0.13.12" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.13.12" />
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.4.0" />
<PackageVersion Include="Ckzg.Bindings" Version="1.0.2.855" />
<PackageVersion Include="Ckzg.Bindings" Version="2.0.1.1236" />
<PackageVersion Include="Colorful.Console" Version="1.2.15" />
<PackageVersion Include="ConcurrentHashSet" Version="1.3.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
<PackageVersion Include="Crc32.NET" Version="1.2.0" />
<PackageVersion Include="DnsClient" Version="1.8.0" />
<PackageVersion Include="FastEnum" Version="1.8.0" />
<PackageVersion Include="FluentAssertions" Version="6.12.0" />
<PackageVersion Include="FastEnum" Version="2.0.2" />
<PackageVersion Include="FluentAssertions" Version="6.12.2" />
<PackageVersion Include="FluentAssertions.Json" Version="6.1.0" />
<PackageVersion Include="Google.Protobuf" Version="3.28.0" />
<PackageVersion Include="Google.Protobuf.Tools" Version="3.28.0" />
<PackageVersion Include="Google.Protobuf" Version="3.28.3" />
<PackageVersion Include="Google.Protobuf.Tools" Version="3.28.3" />
<PackageVersion Include="Grpc" Version="2.46.6" />
<PackageVersion Include="Grpc.Tools" Version="2.65.0" />
<PackageVersion Include="Grpc.Tools" Version="2.67.0" />
<PackageVersion Include="HexMate" Version="0.0.3" />
<PackageVersion Include="Jint" Version="2.11.58" />
<PackageVersion Include="MathNet.Numerics.FSharp" Version="5.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="8.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.Extensions" Version="8.0.7" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection" Version="9.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.Extensions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Build.Tasks.Git" Version="8.0.0" />
<PackageVersion Include="Microsoft.ClearScript.V8" Version="7.4.5" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.linux-arm64" Version="7.4.5" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.linux-x64" Version="7.4.5" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.osx-arm64" Version="7.4.5" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.osx-x64" Version="7.4.5" />
<PackageVersion Include="Microsoft.ClearScript.V8.Native.win-x64" Version="7.4.5" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="8.0.7" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.0" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="9.0.0" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.2.1" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.21.0" />
<PackageVersion Include="Nethermind.Crypto.Bls" Version="1.0.4" />
<PackageVersion Include="Nethermind.Crypto.Pairings" Version="1.1.1" />
<PackageVersion Include="Nethermind.Crypto.SecP256k1" Version="1.2.2" />
<PackageVersion Include="Nethermind.Crypto.SecP256k1" Version="1.3.0" />
<PackageVersion Include="Nethermind.DotNetty.Buffers" Version="1.0.1" />
<PackageVersion Include="Nethermind.DotNetty.Handlers" Version="1.0.1" />
<PackageVersion Include="Nethermind.DotNetty.Transport" Version="1.0.1" />
Expand All @@ -56,31 +56,31 @@
<PackageVersion Include="Nethermind.Libp2p.Protocols.PubsubPeerDiscovery" Version="1.0.0-preview.34" />
<PackageVersion Include="Nethermind.Numerics.Int256" Version="1.2.0" />
<PackageVersion Include="Nito.Collections.Deque" Version="1.2.1" />
<PackageVersion Include="NLog" Version="5.3.2" />
<PackageVersion Include="NLog" Version="5.3.4" />
<PackageVersion Include="NLog.Targets.Seq" Version="4.0.1" />
<PackageVersion Include="NonBlocking" Version="2.1.2" />
<PackageVersion Include="NSubstitute" Version="5.1.0" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit.Analyzers" Version="4.3.0" />
<PackageVersion Include="NUnit.Analyzers" Version="4.4.0" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="Open.NAT.Core" Version="2.1.0.5" />
<PackageVersion Include="PierTwo.Lantern.Discv5.WireProtocol" Version="1.0.0-preview.4" />
<PackageVersion Include="Polly" Version="8.4.1" />
<PackageVersion Include="Polly" Version="8.5.0" />
<PackageVersion Include="prometheus-net.AspNetCore" Version="8.2.1" />
<PackageVersion Include="Pyroscope" Version="0.8.14" />
<PackageVersion Include="Pyroscope" Version="0.9.0" />
<PackageVersion Include="ReadLine" Version="2.0.1" />
<PackageVersion Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageVersion Include="RocksDB" Version="9.4.0.50294" />
<PackageVersion Include="SCrypt" Version="2.0.0.2" />
<PackageVersion Include="Shouldly" Version="4.2.1" />
<PackageVersion Include="Snappier" Version="1.1.6" />
<PackageVersion Include="System.CommandLine" Version="2.0.0-beta4.24517.1" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
<PackageVersion Include="System.IO.Pipelines" Version="8.0.0" />
<PackageVersion Include="System.Configuration.ConfigurationManager" Version="9.0.0" />
<PackageVersion Include="System.IO.Pipelines" Version="9.0.0" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="8.0.0" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="21.0.29" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.29" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="9.0.0" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="21.1.3" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.1.3" />
<PackageVersion Include="Websocket.Client" Version="5.1.2" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Core/Extensions/Bytes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1154,7 +1154,7 @@ public static string ToCleanUtf8String(this ReadOnlySpan<byte> bytes)
// So we allocate bytes.Length to bytes.Length * 2 chars.
const int maxOutputChars = 32 * 2;

if (bytes == null || bytes.Length == 0 || bytes.Length > 32)
if (bytes.IsEmpty || bytes.Length > 32)
return string.Empty;

// Allocate a char buffer on the stack.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public static Task InitializeAsync(ILogger logger = default, string? setupFilePa

if (logger.IsInfo)
logger.Info($"Loading {nameof(Ckzg)} trusted setup from file {trustedSetupTextFileLocation}");
_ckzgSetup = Ckzg.Ckzg.LoadTrustedSetup(trustedSetupTextFileLocation);
_ckzgSetup = Ckzg.Ckzg.LoadTrustedSetup(trustedSetupTextFileLocation, 8);
flcl42 marked this conversation as resolved.
Show resolved Hide resolved

if (_ckzgSetup == IntPtr.Zero)
{
Expand Down
Loading