Skip to content

Commit

Permalink
Merge branch 'master' into feat/optimism-holocene
Browse files Browse the repository at this point in the history
  • Loading branch information
benaadams authored Nov 19, 2024
2 parents d9fd3e4 + 81f08a0 commit 4013c7a
Show file tree
Hide file tree
Showing 52 changed files with 6,434 additions and 2,378 deletions.
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>
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ public void NoCategorySettings()
IEnvironment? env = Substitute.For<IEnvironment>();
env.GetEnvironmentVariables().Returns(new Dictionary<string, string>() {
{ "NETHERMIND_CLI_SWITCH_LOCAL", "http://localhost:80" },
{ "NETHERMIND_MONITORING_JOB", "nethermindJob" },
{ "NETHERMIND_MONITORING_GROUP", "nethermindGroup" },
{ "NETHERMIND_ENODE_IPADDRESS", "1.2.3.4" },
{ "NETHERMIND_URL", "http://test:80" },
{ "NETHERMIND_CORS_ORIGINS", "*" },
{ "NETHERMIND_CONFIG", "test2.json" },
{ "NETHERMIND_XYZ", "xyz" }, // not existing, should get error
{ "QWER", "qwerty" } // not Nethermind setting, no error
Expand Down
6 changes: 3 additions & 3 deletions src/Nethermind/Nethermind.Config/EnvConfigSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,19 @@ public EnvConfigSource(IEnvironment environmentWrapper)
return (null, null);
}

// variables like "NETHERMIND_URL", "NETHERMIND_CONFIG" ...
// variables like "NETHERMIND_CONFIG"
if (a.Length == 2)
{
return (null, a[1]);
}

// VARIABLES like "NETHERMIND_CLI_SWITCH_LOCAL", "NETHERMIND_MONITORING_JOB" ...
// VARIABLES like "NETHERMIND_CLI_SWITCH_LOCAL"
if (a.Length > 2 && !a[1].EndsWith("config", StringComparison.OrdinalIgnoreCase))
{
return (null, string.Join(null, a[1..]));
}

// Variables like "NETHERMIND_JSONRPCCONFIG_ENABLED" ...
// Variables like "NETHERMIND_JSONRPCCONFIG_ENABLED"
return (a[1], a[2]);
});
}
Expand Down
15 changes: 0 additions & 15 deletions src/Nethermind/Nethermind.Config/INoCategoryConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,6 @@ public interface INoCategoryConfig : IConfig
[ConfigItem(Description = "Path to the configuration file.")]
public string Config { get; set; }

[ConfigItem(Description = "Sets the job name for metrics monitoring.", EnvironmentVariable = "NETHERMIND_MONITORING_JOB")]
public string MonitoringJob { get; set; }

[ConfigItem(Description = "Sets the default group name for metrics monitoring.", EnvironmentVariable = "NETHERMIND_MONITORING_GROUP")]
public string MonitoringGroup { get; set; }

[ConfigItem(Description = "Sets the external IP for the node.", EnvironmentVariable = "NETHERMIND_ENODE_IPADDRESS")]
public string EnodeIpAddress { get; set; }

[ConfigItem(Description = "Defines default URL for JSON RPC.", EnvironmentVariable = "NETHERMIND_URL")]
public string Url { get; set; }

[ConfigItem(Description = "Defines CORS origins for JSON RPC.", DefaultValue = "*", EnvironmentVariable = "NETHERMIND_CORS_ORIGINS")]
public string CorsOrigins { get; set; }

[ConfigItem(Description = "Defines host value for CLI function \"switchLocal\".", DefaultValue = "http://localhost", EnvironmentVariable = "NETHERMIND_CLI_SWITCH_LOCAL")]
public string CliSwitchLocal { get; set; }
}
3 changes: 0 additions & 3 deletions src/Nethermind/Nethermind.Config/NoCategoryConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,5 @@ public class NoCategoryConfig : INoCategoryConfig
public string Config { get; set; } = null;
public string MonitoringJob { get; set; }
public string MonitoringGroup { get; set; }
public string EnodeIpAddress { get; set; }
public string Url { get; set; }
public string CorsOrigins { get; set; }
public string CliSwitchLocal { get; set; }
}
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);

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

0 comments on commit 4013c7a

Please sign in to comment.