diff --git a/src/Nethermind/Directory.Packages.props b/src/Nethermind/Directory.Packages.props index cfb7dad9d3f5..a7f1c8d1993a 100644 --- a/src/Nethermind/Directory.Packages.props +++ b/src/Nethermind/Directory.Packages.props @@ -40,6 +40,7 @@ + @@ -78,4 +79,4 @@ - + \ No newline at end of file diff --git a/src/Nethermind/Nethermind.Crypto/Nethermind.Crypto.csproj b/src/Nethermind/Nethermind.Crypto/Nethermind.Crypto.csproj index 7b9338118fab..d7e5404cd157 100644 --- a/src/Nethermind/Nethermind.Crypto/Nethermind.Crypto.csproj +++ b/src/Nethermind/Nethermind.Crypto/Nethermind.Crypto.csproj @@ -21,24 +21,6 @@ - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest diff --git a/src/Nethermind/Nethermind.Crypto/ShamatarLib.cs b/src/Nethermind/Nethermind.Crypto/ShamatarLib.cs deleted file mode 100644 index ad9fd2463856..000000000000 --- a/src/Nethermind/Nethermind.Crypto/ShamatarLib.cs +++ /dev/null @@ -1,168 +0,0 @@ -// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited -// SPDX-License-Identifier: LGPL-3.0-only - -using System; -using System.Runtime.InteropServices; -using System.Threading; -using System.IO; -using System.Reflection; - -namespace Nethermind.Crypto.Bls; - -public static class ShamatarLib -{ - private static readonly int _loaded; - - static ShamatarLib() - { - if (Interlocked.CompareExchange(ref _loaded, 1, 0) == 0) - NativeLibrary.SetDllImportResolver(Assembly.GetExecutingAssembly(), LoadLibrary); - } - - [DllImport("shamatar")] - private static extern unsafe uint eip196_perform_operation( - byte operation, - byte* input, - int inputLength, - byte* output, - ref int outputLength, - byte* error, - ref int errorLength); - - [DllImport("shamatar")] - private static extern unsafe uint eip2537_perform_operation( - byte operation, - byte* input, - int inputLength, - byte* output, - ref int outputLength, - byte* error, - ref int errorLength); - - private static unsafe bool Bn256Op(byte operation, ReadOnlySpan input, Span output) - { - int outputLength = output.Length; - int errorLength = 256; - uint externalCallResult; - - Span error = stackalloc byte[errorLength]; - fixed (byte* inputPtr = &MemoryMarshal.GetReference(input)) - fixed (byte* outputPtr = &MemoryMarshal.GetReference(output)) - fixed (byte* errorPtr = &MemoryMarshal.GetReference(error)) - { - externalCallResult = eip196_perform_operation( - operation, inputPtr, input.Length, outputPtr, ref outputLength, errorPtr, ref errorLength); - } - - return externalCallResult == 0; - } - - private static unsafe bool BlsOp(byte operation, ReadOnlySpan input, Span output) - { - int outputLength = output.Length; - int errorLength = 256; - uint externalCallResult; - - Span error = stackalloc byte[errorLength]; - fixed (byte* inputPtr = &MemoryMarshal.GetReference(input)) - fixed (byte* outputPtr = &MemoryMarshal.GetReference(output)) - fixed (byte* errorPtr = &MemoryMarshal.GetReference(error)) - { - externalCallResult = eip2537_perform_operation( - operation, inputPtr, input.Length, outputPtr, ref outputLength, errorPtr, ref errorLength); - } - - return externalCallResult == 0; - } - - public static bool Bn256Add(ReadOnlySpan input, Span output) - { - return Bn256Op(1, input, output); - } - - public static bool Bn256Mul(ReadOnlySpan input, Span output) - { - return Bn256Op(2, input, output); - } - - public static bool Bn256Pairing(ReadOnlySpan input, Span output) - { - return Bn256Op(3, input, output); - } - - public static bool BlsG1Add(ReadOnlySpan input, Span output) - { - return BlsOp(1, input, output); - } - - public static bool BlsG1Mul(ReadOnlySpan input, Span output) - { - return BlsOp(2, input, output); - } - - public static bool BlsG1MultiExp(ReadOnlySpan input, Span output) - { - return BlsOp(3, input, output); - } - - public static bool BlsG2Add(ReadOnlySpan input, Span output) - { - return BlsOp(4, input, output); - } - - public static bool BlsG2Mul(ReadOnlySpan input, Span output) - { - return BlsOp(5, input, output); - } - - public static bool BlsG2MultiExp(ReadOnlySpan input, Span output) - { - return BlsOp(6, input, output); - } - - public static bool BlsPairing(ReadOnlySpan input, Span output) - { - return BlsOp(7, input, output); - } - - public static bool BlsMapToG1(ReadOnlySpan input, Span output) - { - return BlsOp(8, input, output); - } - - public static bool BlsMapToG2(ReadOnlySpan input, Span output) - { - return BlsOp(9, input, output); - } - - private static nint LoadLibrary(string libraryName, Assembly assembly, DllImportSearchPath? searchPath) - { - string platform; - - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) - { - libraryName = $"lib{libraryName}.so"; - platform = "linux"; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - libraryName = $"{libraryName}.dll"; - platform = "win"; - } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) - { - libraryName = $"lib{libraryName}.dylib"; - platform = "osx"; - } - else - throw new PlatformNotSupportedException(); - - if (NativeLibrary.TryLoad(libraryName, assembly, searchPath, out var handle)) - return handle; - - var arch = RuntimeInformation.ProcessArchitecture.ToString().ToLowerInvariant(); - - return NativeLibrary.Load( - Path.Combine("runtimes", $"{platform}-{arch}", "native", libraryName), assembly, searchPath); - } -} diff --git a/src/Nethermind/Nethermind.Crypto/runtimes/linux-arm64/native/libshamatar.so b/src/Nethermind/Nethermind.Crypto/runtimes/linux-arm64/native/libshamatar.so deleted file mode 100755 index 91d7014f4c97..000000000000 Binary files a/src/Nethermind/Nethermind.Crypto/runtimes/linux-arm64/native/libshamatar.so and /dev/null differ diff --git a/src/Nethermind/Nethermind.Crypto/runtimes/linux-x64/native/libshamatar.so b/src/Nethermind/Nethermind.Crypto/runtimes/linux-x64/native/libshamatar.so deleted file mode 100644 index 409bbb096ebd..000000000000 Binary files a/src/Nethermind/Nethermind.Crypto/runtimes/linux-x64/native/libshamatar.so and /dev/null differ diff --git a/src/Nethermind/Nethermind.Crypto/runtimes/osx-arm64/native/libshamatar.dylib b/src/Nethermind/Nethermind.Crypto/runtimes/osx-arm64/native/libshamatar.dylib deleted file mode 100755 index 797cc80d010c..000000000000 Binary files a/src/Nethermind/Nethermind.Crypto/runtimes/osx-arm64/native/libshamatar.dylib and /dev/null differ diff --git a/src/Nethermind/Nethermind.Crypto/runtimes/osx-x64/native/libshamatar.dylib b/src/Nethermind/Nethermind.Crypto/runtimes/osx-x64/native/libshamatar.dylib deleted file mode 100644 index 6f9b34f8cf22..000000000000 Binary files a/src/Nethermind/Nethermind.Crypto/runtimes/osx-x64/native/libshamatar.dylib and /dev/null differ diff --git a/src/Nethermind/Nethermind.Crypto/runtimes/win-x64/native/shamatar.dll b/src/Nethermind/Nethermind.Crypto/runtimes/win-x64/native/shamatar.dll deleted file mode 100644 index e80e6e512e4a..000000000000 Binary files a/src/Nethermind/Nethermind.Crypto/runtimes/win-x64/native/shamatar.dll and /dev/null differ diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsAddG1PrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsAddG1PrecompileTests.cs index 3d258b080513..903977642d52 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsAddG1PrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsAddG1PrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsAddG2PrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsAddG2PrecompileTests.cs index bf35bd3cad19..c88cb819cc21 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsAddG2PrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsAddG2PrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsMapToG1Tests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsMapToG1Tests.cs index 742af5fb7c4c..f851a45074da 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsMapToG1Tests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsMapToG1Tests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsMapToG2Tests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsMapToG2Tests.cs index 297a437a69c9..7295507fa86b 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsMapToG2Tests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsMapToG2Tests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsMulG1PrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsMulG1PrecompileTests.cs index 3e19c01836b4..7f301a988579 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsMulG1PrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsMulG1PrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsMulG2PrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsMulG2PrecompileTests.cs index 5b11b5b9c9a1..c21f716f33dc 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsMulG2PrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsMulG2PrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG1PrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG1PrecompileTests.cs index 8d58291daca5..97d59468e369 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG1PrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG1PrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG2PrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG2PrecompileTests.cs index 9d95ea79cb6d..66d8b34af844 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG2PrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsMultiMulG2PrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using NUnit.Framework; using static Nethermind.Specs.Forks.MuirGlacier; diff --git a/src/Nethermind/Nethermind.Evm.Test/BlsParingPrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BlsParingPrecompileTests.cs index 8bf1bb9234e1..b593e715200a 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BlsParingPrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BlsParingPrecompileTests.cs @@ -6,7 +6,7 @@ using FluentAssertions; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; +using Nethermind.Evm.Precompiles.Bls; using Nethermind.Specs.Forks; using NUnit.Framework; diff --git a/src/Nethermind/Nethermind.Evm.Test/BnAddPrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BnAddPrecompileTests.cs index 969dfe33905c..614daab5529d 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BnAddPrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BnAddPrecompileTests.cs @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited // SPDX-License-Identifier: LGPL-3.0-only -using System; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; +using Nethermind.Evm.Precompiles.Snarks; using Nethermind.Specs.Forks; using NUnit.Framework; @@ -31,8 +31,8 @@ public void Test() for (int i = 0; i < inputs.Length; i++) { - IPrecompile shamatar = Precompiles.Snarks.Shamatar.Bn256AddPrecompile.Instance; - (ReadOnlyMemory, bool) resultShamatar = shamatar.Run(inputs[i], MuirGlacier.Instance); + IPrecompile precompile = Bn254AddPrecompile.Instance; + _ = precompile.Run(inputs[i], MuirGlacier.Instance); } } } diff --git a/src/Nethermind/Nethermind.Evm.Test/BnMulPrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BnMulPrecompileTests.cs index 89ef24e44457..1b82b6dc331c 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BnMulPrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BnMulPrecompileTests.cs @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited // SPDX-License-Identifier: LGPL-3.0-only -using System; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; +using Nethermind.Evm.Precompiles.Snarks; using Nethermind.Specs.Forks; using NUnit.Framework; @@ -31,8 +31,8 @@ public void Test() for (int i = 0; i < inputs.Length; i++) { - IPrecompile shamatar = Precompiles.Snarks.Shamatar.Bn256MulPrecompile.Instance; - (ReadOnlyMemory, bool) resultShamatar = shamatar.Run(inputs[i], MuirGlacier.Instance); + IPrecompile precompile = Bn254MulPrecompile.Instance; + _ = precompile.Run(inputs[i], MuirGlacier.Instance); } } } diff --git a/src/Nethermind/Nethermind.Evm.Test/BnPairPrecompileTests.cs b/src/Nethermind/Nethermind.Evm.Test/BnPairPrecompileTests.cs index 2d7b1691dd63..d554f400e395 100644 --- a/src/Nethermind/Nethermind.Evm.Test/BnPairPrecompileTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/BnPairPrecompileTests.cs @@ -1,9 +1,9 @@ // SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited // SPDX-License-Identifier: LGPL-3.0-only -using System; using Nethermind.Core.Extensions; using Nethermind.Evm.Precompiles; +using Nethermind.Evm.Precompiles.Snarks; using Nethermind.Specs.Forks; using NUnit.Framework; @@ -62,8 +62,8 @@ public void Test() for (int i = 0; i < inputs.Length; i++) { byte[] cloned = inputs[i].Clone() as byte[]; - IPrecompile shamatar = Precompiles.Snarks.Shamatar.Bn256PairingPrecompile.Instance; - (ReadOnlyMemory, bool) resultShamatar = shamatar.Run(cloned, MuirGlacier.Instance); + IPrecompile precompile = Bn254PairingPrecompile.Instance; + _ = precompile.Run(cloned, MuirGlacier.Instance); } } } diff --git a/src/Nethermind/Nethermind.Evm.Test/Eip1108Tests.cs b/src/Nethermind/Nethermind.Evm.Test/Eip1108Tests.cs index 7e5a9d98e662..33585bdefcf0 100644 --- a/src/Nethermind/Nethermind.Evm.Test/Eip1108Tests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/Eip1108Tests.cs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: LGPL-3.0-only using Nethermind.Specs; -using Nethermind.Evm.Precompiles.Snarks.Shamatar; +using Nethermind.Evm.Precompiles.Snarks; using NUnit.Framework; namespace Nethermind.Evm.Test @@ -25,7 +25,7 @@ public void Test_add_before_istanbul() { _blockNumberAdjustment = -1; byte[] code = Prepare.EvmCode - .CallWithInput(Bn256AddPrecompile.Instance.Address, 1000L, new byte[128]) + .CallWithInput(Bn254AddPrecompile.Instance.Address, 1000L, new byte[128]) .Done; TestAllTracerWithOutput result = Execute(code); Assert.AreEqual(StatusCode.Success, result.StatusCode); @@ -36,7 +36,7 @@ public void Test_add_before_istanbul() public void Test_add_after_istanbul() { byte[] code = Prepare.EvmCode - .CallWithInput(Bn256AddPrecompile.Instance.Address, 1000L, new byte[128]) + .CallWithInput(Bn254AddPrecompile.Instance.Address, 1000L, new byte[128]) .Done; TestAllTracerWithOutput result = Execute(code); Assert.AreEqual(StatusCode.Success, result.StatusCode); @@ -48,7 +48,7 @@ public void Test_mul_before_istanbul() { _blockNumberAdjustment = -1; byte[] code = Prepare.EvmCode - .CallWithInput(Bn256MulPrecompile.Instance.Address, 50000L, new byte[128]) + .CallWithInput(Bn254MulPrecompile.Instance.Address, 50000L, new byte[128]) .Done; TestAllTracerWithOutput result = Execute(code); Assert.AreEqual(StatusCode.Success, result.StatusCode); @@ -59,7 +59,7 @@ public void Test_mul_before_istanbul() public void Test_mul_after_istanbul() { byte[] code = Prepare.EvmCode - .CallWithInput(Bn256MulPrecompile.Instance.Address, 10000L, new byte[128]) + .CallWithInput(Bn254MulPrecompile.Instance.Address, 10000L, new byte[128]) .Done; TestAllTracerWithOutput result = Execute(code); Assert.AreEqual(StatusCode.Success, result.StatusCode); @@ -71,7 +71,7 @@ public void Test_pairing_before_istanbul() { _blockNumberAdjustment = -1; byte[] code = Prepare.EvmCode - .CallWithInput(Bn256PairingPrecompile.Instance.Address, 200000L, new byte[192]) + .CallWithInput(Bn254PairingPrecompile.Instance.Address, 200000L, new byte[192]) .Done; TestAllTracerWithOutput result = Execute(BlockNumber, 1000000L, code); Assert.AreEqual(StatusCode.Success, result.StatusCode); @@ -82,7 +82,7 @@ public void Test_pairing_before_istanbul() public void Test_pairing_after_istanbul() { byte[] code = Prepare.EvmCode - .CallWithInput(Bn256PairingPrecompile.Instance.Address, 200000L, new byte[192]) + .CallWithInput(Bn254PairingPrecompile.Instance.Address, 200000L, new byte[192]) .Done; TestAllTracerWithOutput result = Execute(BlockNumber, 1000000L, code); Assert.AreEqual(StatusCode.Success, result.StatusCode); diff --git a/src/Nethermind/Nethermind.Evm/Metrics.cs b/src/Nethermind/Nethermind.Evm/Metrics.cs index 180eefac5e92..0215677ff255 100644 --- a/src/Nethermind/Nethermind.Evm/Metrics.cs +++ b/src/Nethermind/Nethermind.Evm/Metrics.cs @@ -45,16 +45,16 @@ public class Metrics public static long BlockhashOpcode { get; set; } [CounterMetric] - [Description("Number of BN256_MUL precompile calls.")] - public static long Bn256MulPrecompile { get; set; } + [Description("Number of BN254_MUL precompile calls.")] + public static long Bn254MulPrecompile { get; set; } [CounterMetric] - [Description("Number of BN256_ADD precompile calls.")] - public static long Bn256AddPrecompile { get; set; } + [Description("Number of BN254_ADD precompile calls.")] + public static long Bn254AddPrecompile { get; set; } [CounterMetric] - [Description("Number of BN256_PAIRING precompile calls.")] - public static long Bn256PairingPrecompile { get; set; } + [Description("Number of BN254_PAIRING precompile calls.")] + public static long Bn254PairingPrecompile { get; set; } [CounterMetric] [Description("Number of EC_RECOVERY precompile calls.")] diff --git a/src/Nethermind/Nethermind.Evm/Nethermind.Evm.csproj b/src/Nethermind/Nethermind.Evm/Nethermind.Evm.csproj index 52de971ba6c5..bf4f06ca1676 100644 --- a/src/Nethermind/Nethermind.Evm/Nethermind.Evm.csproj +++ b/src/Nethermind/Nethermind.Evm/Nethermind.Evm.csproj @@ -14,6 +14,7 @@ + diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/BlsExtensions.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/BlsExtensions.cs similarity index 81% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/BlsExtensions.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/BlsExtensions.cs index d528c7499c2d..33602d50376a 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/BlsExtensions.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/BlsExtensions.cs @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited // SPDX-License-Identifier: LGPL-3.0-only -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { public static class BlsParams { diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1AddPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1AddPrecompile.cs similarity index 91% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1AddPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1AddPrecompile.cs index dbe7bc8b0d6f..247ba721bada 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1AddPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1AddPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -45,7 +45,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[2 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsG1Add(inputData.Span, output); + bool success = Pairings.BlsG1Add(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1MulPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1MulPrecompile.cs similarity index 91% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1MulPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1MulPrecompile.cs index 0450443a08ff..81e1166d0330 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1MulPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1MulPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -45,7 +45,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[2 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsG1Mul(inputData.Span, output); + bool success = Pairings.BlsG1Mul(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1MultiExpPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1MultiExpPrecompile.cs similarity index 90% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1MultiExpPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1MultiExpPrecompile.cs index 421faa2d600a..f45d998e9aa8 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G1MultiExpPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G1MultiExpPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -44,7 +44,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[2 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsG1MultiExp(inputData.Span, output); + bool success = Pairings.BlsG1MultiExp(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2AddPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2AddPrecompile.cs similarity index 91% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2AddPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2AddPrecompile.cs index f08d54eb9258..712edd78cea9 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2AddPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2AddPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -45,7 +45,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[4 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsG2Add(inputData.Span, output); + bool success = Pairings.BlsG2Add(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2MulPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2MulPrecompile.cs similarity index 91% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2MulPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2MulPrecompile.cs index 3446e53ea064..bff2ec13bb39 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2MulPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2MulPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -45,7 +45,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[4 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsG2Mul(inputData.Span, output); + bool success = Pairings.BlsG2Mul(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2MultiExpPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2MultiExpPrecompile.cs similarity index 90% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2MultiExpPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2MultiExpPrecompile.cs index cc3e4566c5d5..36b01597f131 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/G2MultiExpPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/G2MultiExpPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -44,7 +44,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[4 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsG2MultiExp(inputData.Span, output); + bool success = Pairings.BlsG2MultiExp(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/MapToG1Precompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/MapToG1Precompile.cs similarity index 90% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/MapToG1Precompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/MapToG1Precompile.cs index 56bc49875bd2..22e5aa02a14b 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/MapToG1Precompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/MapToG1Precompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -45,7 +45,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[128]; - bool success = ShamatarLib.BlsMapToG1(inputData.Span, output); + bool success = Pairings.BlsMapToG1(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/MapToG2Precompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/MapToG2Precompile.cs similarity index 91% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/MapToG2Precompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/MapToG2Precompile.cs index 9816bf0061e9..bae5c55aabce 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/MapToG2Precompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/MapToG2Precompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -45,7 +45,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[4 * BlsParams.LenFp]; - bool success = ShamatarLib.BlsMapToG2(inputData.Span, output); + bool success = Pairings.BlsMapToG2(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/PairingPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/PairingPrecompile.cs similarity index 90% rename from src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/PairingPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Bls/PairingPrecompile.cs index afe2f34e0da1..47e3729e62e2 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Bls/Shamatar/PairingPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Bls/PairingPrecompile.cs @@ -4,9 +4,9 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Bls.Shamatar +namespace Nethermind.Evm.Precompiles.Bls { /// /// https://eips.ethereum.org/EIPS/eip-2537 @@ -38,7 +38,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS (byte[], bool) result; Span output = stackalloc byte[32]; - bool success = ShamatarLib.BlsPairing(inputData.Span, output); + bool success = Pairings.BlsPairing(inputData.Span, output); if (success) { result = (output.ToArray(), true); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256AddPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254AddPrecompile.cs similarity index 79% rename from src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256AddPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254AddPrecompile.cs index f736aa865669..2baf3848b843 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256AddPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254AddPrecompile.cs @@ -4,16 +4,16 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Snarks.Shamatar +namespace Nethermind.Evm.Precompiles.Snarks { /// /// https://github.com/matter-labs/eip1962/blob/master/eip196_header.h /// - public class Bn256AddPrecompile : IPrecompile + public class Bn254AddPrecompile : IPrecompile { - public static IPrecompile Instance = new Bn256AddPrecompile(); + public static IPrecompile Instance = new Bn254AddPrecompile(); public Address Address { get; } = Address.FromNumber(6); @@ -29,12 +29,12 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS public unsafe (ReadOnlyMemory, bool) Run(in ReadOnlyMemory inputData, IReleaseSpec releaseSpec) { - Metrics.Bn256AddPrecompile++; + Metrics.Bn254AddPrecompile++; Span inputDataSpan = stackalloc byte[128]; inputData.PrepareEthInput(inputDataSpan); Span output = stackalloc byte[64]; - bool success = ShamatarLib.Bn256Add(inputDataSpan, output); + bool success = Pairings.Bn254Add(inputDataSpan, output); (byte[], bool) result; if (success) diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256MulPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254MulPrecompile.cs similarity index 79% rename from src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256MulPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254MulPrecompile.cs index e059420e17e1..36d5cca228a0 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256MulPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254MulPrecompile.cs @@ -4,16 +4,16 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Snarks.Shamatar +namespace Nethermind.Evm.Precompiles.Snarks { /// /// https://github.com/herumi/mcl/blob/master/api.md /// - public class Bn256MulPrecompile : IPrecompile + public class Bn254MulPrecompile : IPrecompile { - public static IPrecompile Instance = new Bn256MulPrecompile(); + public static IPrecompile Instance = new Bn254MulPrecompile(); public Address Address { get; } = Address.FromNumber(7); @@ -29,12 +29,12 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS public (ReadOnlyMemory, bool) Run(in ReadOnlyMemory inputData, IReleaseSpec releaseSpec) { - Metrics.Bn256MulPrecompile++; + Metrics.Bn254MulPrecompile++; Span inputDataSpan = stackalloc byte[96]; inputData.PrepareEthInput(inputDataSpan); Span output = stackalloc byte[64]; - bool success = ShamatarLib.Bn256Mul(inputDataSpan, output); + bool success = Pairings.Bn254Mul(inputDataSpan, output); (byte[], bool) result; if (success) diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256PairingPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254PairingPrecompile.cs similarity index 88% rename from src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256PairingPrecompile.cs rename to src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254PairingPrecompile.cs index 684318936484..b0269400b99b 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Shamatar/Bn256PairingPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/Snarks/Bn254PairingPrecompile.cs @@ -4,18 +4,18 @@ using System; using Nethermind.Core; using Nethermind.Core.Specs; -using Nethermind.Crypto.Bls; +using Nethermind.Crypto; -namespace Nethermind.Evm.Precompiles.Snarks.Shamatar +namespace Nethermind.Evm.Precompiles.Snarks { /// /// https://github.com/herumi/mcl/blob/master/api.md /// - public class Bn256PairingPrecompile : IPrecompile + public class Bn254PairingPrecompile : IPrecompile { private const int PairSize = 192; - public static IPrecompile Instance = new Bn256PairingPrecompile(); + public static IPrecompile Instance = new Bn254PairingPrecompile(); public Address Address { get; } = Address.FromNumber(8); @@ -31,7 +31,7 @@ public long DataGasCost(in ReadOnlyMemory inputData, IReleaseSpec releaseS public (ReadOnlyMemory, bool) Run(in ReadOnlyMemory inputData, IReleaseSpec releaseSpec) { - Metrics.Bn256PairingPrecompile++; + Metrics.Bn254PairingPrecompile++; (byte[], bool) result; if (inputData.Length % PairSize > 0) @@ -56,7 +56,7 @@ safe in benchmarks so we need to remember to clone */ inputReshuffled.CopyTo(inputDataSpan.Slice(i * PairSize, PairSize)); } - bool success = ShamatarLib.Bn256Pairing(inputDataSpan, output); + bool success = Pairings.Bn254Pairing(inputDataSpan, output); if (success) { diff --git a/src/Nethermind/Nethermind.Evm/VirtualMachine.cs b/src/Nethermind/Nethermind.Evm/VirtualMachine.cs index e0a3dc897a1d..f6d8b760441c 100644 --- a/src/Nethermind/Nethermind.Evm/VirtualMachine.cs +++ b/src/Nethermind/Nethermind.Evm/VirtualMachine.cs @@ -14,8 +14,8 @@ using Nethermind.Evm.CodeAnalysis; using Nethermind.Int256; using Nethermind.Evm.Precompiles; -using Nethermind.Evm.Precompiles.Bls.Shamatar; -using Nethermind.Evm.Precompiles.Snarks.Shamatar; +using Nethermind.Evm.Precompiles.Bls; +using Nethermind.Evm.Precompiles.Snarks; using Nethermind.Evm.Tracing; using Nethermind.Logging; using Nethermind.State; @@ -424,9 +424,9 @@ private void InitializePrecompiledContracts() [Ripemd160Precompile.Instance.Address] = new(Ripemd160Precompile.Instance), [IdentityPrecompile.Instance.Address] = new(IdentityPrecompile.Instance), - [Bn256AddPrecompile.Instance.Address] = new(Bn256AddPrecompile.Instance), - [Bn256MulPrecompile.Instance.Address] = new(Bn256MulPrecompile.Instance), - [Bn256PairingPrecompile.Instance.Address] = new(Bn256PairingPrecompile.Instance), + [Bn254AddPrecompile.Instance.Address] = new(Bn254AddPrecompile.Instance), + [Bn254MulPrecompile.Instance.Address] = new(Bn254MulPrecompile.Instance), + [Bn254PairingPrecompile.Instance.Address] = new(Bn254PairingPrecompile.Instance), [ModExpPrecompile.Instance.Address] = new(ModExpPrecompile.Instance), [Blake2FPrecompile.Instance.Address] = new(Blake2FPrecompile.Instance), diff --git a/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256AddBenchmark.cs b/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254AddBenchmark.cs similarity index 66% rename from src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256AddBenchmark.cs rename to src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254AddBenchmark.cs index 88b2a27c915e..df4c9a0fafe1 100644 --- a/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256AddBenchmark.cs +++ b/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254AddBenchmark.cs @@ -2,17 +2,16 @@ // SPDX-License-Identifier: LGPL-3.0-only using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; using Nethermind.Evm.Precompiles; +using Nethermind.Evm.Precompiles.Snarks; namespace Nethermind.Precompiles.Benchmark { - public class Bn256AddBenchmark : PrecompileBenchmarkBase + public class Bn254AddBenchmark : PrecompileBenchmarkBase { protected override IEnumerable Precompiles => new[] { - Evm.Precompiles.Snarks.Shamatar.Bn256AddPrecompile.Instance + Bn254AddPrecompile.Instance }; protected override string InputsDirectory => "bnadd"; diff --git a/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256MulBenchmark.cs b/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254MulBenchmark.cs similarity index 66% rename from src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256MulBenchmark.cs rename to src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254MulBenchmark.cs index 7a0d2878fce9..fb76d5081e5a 100644 --- a/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256MulBenchmark.cs +++ b/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254MulBenchmark.cs @@ -2,17 +2,16 @@ // SPDX-License-Identifier: LGPL-3.0-only using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; using Nethermind.Evm.Precompiles; +using Nethermind.Evm.Precompiles.Snarks; namespace Nethermind.Precompiles.Benchmark { - public class Bn256MulBenchmark : PrecompileBenchmarkBase + public class Bn254MulBenchmark : PrecompileBenchmarkBase { protected override IEnumerable Precompiles => new[] { - Evm.Precompiles.Snarks.Shamatar.Bn256MulPrecompile.Instance + Bn254MulPrecompile.Instance }; protected override string InputsDirectory => "bnmul"; diff --git a/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256PairingBenchmark.cs b/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254PairingBenchmark.cs similarity index 65% rename from src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256PairingBenchmark.cs rename to src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254PairingBenchmark.cs index bc4587eb8b29..572713e00696 100644 --- a/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn256PairingBenchmark.cs +++ b/src/Nethermind/Nethermind.Precompiles.Benchmark/Bn254PairingBenchmark.cs @@ -2,17 +2,16 @@ // SPDX-License-Identifier: LGPL-3.0-only using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Jobs; using Nethermind.Evm.Precompiles; +using Nethermind.Evm.Precompiles.Snarks; namespace Nethermind.Precompiles.Benchmark { - public class Bn256PairingBenchmark : PrecompileBenchmarkBase + public class Bn254PairingBenchmark : PrecompileBenchmarkBase { protected override IEnumerable Precompiles => new[] { - Evm.Precompiles.Snarks.Shamatar.Bn256PairingPrecompile.Instance + Bn254PairingPrecompile.Instance }; protected override string InputsDirectory => "bnpair"; diff --git a/src/Nethermind/nuget.config b/src/Nethermind/nuget.config index 84c8ccf735eb..238f6742f56e 100644 --- a/src/Nethermind/nuget.config +++ b/src/Nethermind/nuget.config @@ -3,14 +3,14 @@ - + - + + + + +