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

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
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
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"sdk": {
"version": "8.0.0",
"allowPrerelease": false,
"version": "9.0.0",
"allowPrerelease": true,
"rollForward": "latestFeature"
}
}
4 changes: 2 additions & 2 deletions src/Nethermind/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
<LangVersion>latest</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TargetFramework>net9.0</TargetFramework>
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>

Expand Down
16 changes: 8 additions & 8 deletions src/Nethermind/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
<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-rc.2.24474.3" />
<PackageVersion Include="Microsoft.AspNetCore.DataProtection.Extensions" Version="9.0.0-rc.2.24474.3" />
<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" />
Expand All @@ -38,9 +38,9 @@
<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.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.Extensions.Logging.Abstractions" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="Microsoft.Extensions.ObjectPool" Version="9.0.0-rc.2.24474.3" />
<PackageVersion Include="Microsoft.IdentityModel.JsonWebTokens" Version="8.0.1" />
<PackageVersion Include="Microsoft.IO.RecyclableMemoryStream" Version="3.0.1" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
Expand Down Expand Up @@ -75,10 +75,10 @@
<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-rc.2.24473.5" />
<PackageVersion Include="System.IO.Pipelines" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="8.0.0" />
<PackageVersion Include="System.Security.Cryptography.ProtectedData" Version="9.0.0-rc.2.24473.5" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.TestingHelpers" Version="21.0.29" />
<PackageVersion Include="TestableIO.System.IO.Abstractions.Wrappers" Version="21.0.29" />
<PackageVersion Include="Websocket.Client" Version="5.1.2" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
Expand Down
29 changes: 24 additions & 5 deletions src/Nethermind/Nethermind.Runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
# See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.

# This stage is used when running from VS in fast mode (Default for Debug configuration)
FROM mcr.microsoft.com/dotnet/aspnet:9.0 AS base

#USER app

FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
WORKDIR /app

VOLUME /data

EXPOSE 8545 8551 30303

FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
# This stage is used to build the service project
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
ARG BUILD_CONFIGURATION=Release

WORKDIR /src

COPY Directory.*.props .
COPY nuget.config .
COPY Nethermind.*/Nethermind.*.csproj Nethermind.*/

RUN dotnet restore Nethermind.Runner/Nethermind.Runner.csproj

COPY . .

WORKDIR /src/Nethermind.Runner
RUN dotnet build Nethermind.Runner.csproj -c release -o /app/build

RUN dotnet build Nethermind.Runner.csproj -c $BUILD_CONFIGURATION -o /app/build

# This stage is used to publish the service project to be copied to the final stage
FROM build AS publish
RUN dotnet publish Nethermind.Runner.csproj -c release -o /app/publish -p:UseAppHost=false
ARG BUILD_CONFIGURATION=Release

RUN dotnet publish Nethermind.Runner.csproj -c $BUILD_CONFIGURATION -o /app/publish -p:UseAppHost=false

# This stage is used in production or when running from VS in regular mode (Default when not using the Debug configuration)
FROM base AS final

WORKDIR /app

COPY --from=publish /app/publish .

ENTRYPOINT ["dotnet", "nethermind.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
},
"Docker": {
"commandName": "Docker",
"commandLineArgs": "-c holesky --data-dir .data /data --jsonrpc-enginehost 0.0.0.0 --jsonrpc-engineport 8551 --jsonrpc-host 0.0.0.0"
"commandLineArgs": "-c holesky --data-dir /data --jsonrpc-enginehost 0.0.0.0 --jsonrpc-engineport 8551 --jsonrpc-host 0.0.0.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public void CommitTrees(IBlockCommitter blockCommitter)
}
}

Task.WaitAll(commitTask.ToArray());
Task.WaitAll(commitTask);

_toUpdateRoots.Clear();
// only needed here as there is no control over cached storage size otherwise
Expand Down
2 changes: 1 addition & 1 deletion src/Nethermind/Nethermind.Trie/Pruning/TrieStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ void TopLevelPersist(TrieNode tn, Hash256? address2, TreePath path)
{
(TrieNode trieNode, Hash256? address2, TreePath path2) = entry;
PersistNodeStartingFrom(trieNode, address2, path2, persistedNodeRecorder, writeFlags, disposeQueue);
})).ToArray());
})));

disposeQueue.CompleteAdding();
Task.WaitAll(_disposeTasks);
Expand Down
13 changes: 13 additions & 0 deletions tools/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>

<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<LangVersion>latest</LangVersion>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<!--<TreatWarningsAsErrors>true</TreatWarningsAsErrors>-->
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>

</Project>
3 changes: 0 additions & 3 deletions tools/DocGen/DocGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
12 changes: 6 additions & 6 deletions tools/HiveCompare/HiveCompare.sln
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
# 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HiveCompare", "HiveCompare\HiveCompare.csproj", "{D4F2D91C-F015-4070-BE34-C98C0E930279}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HiveCompare", "HiveCompare.csproj", "{FCFD5C39-B554-4AA5-98F7-6539A950F8EE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D4F2D91C-F015-4070-BE34-C98C0E930279}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4F2D91C-F015-4070-BE34-C98C0E930279}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4F2D91C-F015-4070-BE34-C98C0E930279}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D4F2D91C-F015-4070-BE34-C98C0E930279}.Release|Any CPU.Build.0 = Release|Any CPU
{FCFD5C39-B554-4AA5-98F7-6539A950F8EE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FCFD5C39-B554-4AA5-98F7-6539A950F8EE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCFD5C39-B554-4AA5-98F7-6539A950F8EE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCFD5C39-B554-4AA5-98F7-6539A950F8EE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RootNamespace>HiveConsensusWorkflowGenerator</RootNamespace>
</PropertyGroup>

Expand Down
3 changes: 0 additions & 3 deletions tools/Nethermind.Tools.Kute/Nethermind.Tools.Kute.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 0 additions & 4 deletions tools/SendBlobs/SendBlobs.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishSingleFile>true</PublishSingleFile>
<IncludeAllContentForSelfExtract>true</IncludeAllContentForSelfExtract>
<AllowedReferenceRelatedFileExtensions>*.pdb</AllowedReferenceRelatedFileExtensions>
Expand Down
11 changes: 4 additions & 7 deletions tools/TxParser/TxParser.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Nethermind\Nethermind.Serialization.Rlp\Nethermind.Serialization.Rlp.csproj" />
<ProjectReference Include="..\..\src\Nethermind\Nethermind.Crypto\Nethermind.Crypto.csproj" />
Expand All @@ -9,11 +13,4 @@
<ProjectReference Include="..\..\src\Nethermind\Nethermind.Consensus\Nethermind.Consensus.csproj" />
</ItemGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
Loading