From 4e64380adbfc5cf040c4ac03bc87ac6c1f74ec73 Mon Sep 17 00:00:00 2001 From: Amirul Ashraf Date: Fri, 18 Oct 2024 11:37:28 +0800 Subject: [PATCH] Fix ambiguous ProtectedPrivateKey --- src/Nethermind/Nethermind.Api/IBasicApi.cs | 1 + .../Nethermind.Network.Discovery/CompositeDiscoveryApp.cs | 4 +++- .../Nethermind.Network/Rlpx/Handshake/HandshakeService.cs | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Nethermind.Api/IBasicApi.cs b/src/Nethermind/Nethermind.Api/IBasicApi.cs index f96efd59989..7f86a540935 100644 --- a/src/Nethermind/Nethermind.Api/IBasicApi.cs +++ b/src/Nethermind/Nethermind.Api/IBasicApi.cs @@ -40,6 +40,7 @@ public interface IBasicApi IFileSystem FileSystem { get; set; } IKeyStore? KeyStore { get; set; } ILogManager LogManager { get; set; } + [SkipServiceCollection] ProtectedPrivateKey? OriginalSignerKey { get; set; } IReadOnlyList Plugins { get; } [SkipServiceCollection] diff --git a/src/Nethermind/Nethermind.Network.Discovery/CompositeDiscoveryApp.cs b/src/Nethermind/Nethermind.Network.Discovery/CompositeDiscoveryApp.cs index f7013d14c6b..f25e44e670f 100644 --- a/src/Nethermind/Nethermind.Network.Discovery/CompositeDiscoveryApp.cs +++ b/src/Nethermind/Nethermind.Network.Discovery/CompositeDiscoveryApp.cs @@ -3,11 +3,13 @@ using System.Net.Sockets; using System.Runtime.InteropServices; +using Autofac.Features.AttributeFilters; using DotNetty.Transport.Bootstrapping; using DotNetty.Transport.Channels; using DotNetty.Transport.Channels.Sockets; using Nethermind.Api; using Nethermind.Core; +using Nethermind.Core.Container; using Nethermind.Core.Crypto; using Nethermind.Crypto; using Nethermind.Db; @@ -48,7 +50,7 @@ public class CompositeDiscoveryApp : IDiscoveryApp private IDiscoveryApp? _v5; private INodeSource _compositeNodeSource = null!; - public CompositeDiscoveryApp(ProtectedPrivateKey? nodeKey, + public CompositeDiscoveryApp([KeyFilter(ComponentKey.NodeKey)] ProtectedPrivateKey? nodeKey, INetworkConfig networkConfig, IDiscoveryConfig discoveryConfig, IInitConfig initConfig, IEthereumEcdsa? ethereumEcdsa, IMessageSerializationService? serializationService, ILogManager? logManager, ITimestamper? timestamper, ICryptoRandom? cryptoRandom, diff --git a/src/Nethermind/Nethermind.Network/Rlpx/Handshake/HandshakeService.cs b/src/Nethermind/Nethermind.Network/Rlpx/Handshake/HandshakeService.cs index fe7a046c3a9..55baa206b1b 100644 --- a/src/Nethermind/Nethermind.Network/Rlpx/Handshake/HandshakeService.cs +++ b/src/Nethermind/Nethermind.Network/Rlpx/Handshake/HandshakeService.cs @@ -2,8 +2,10 @@ // SPDX-License-Identifier: LGPL-3.0-only using System; +using Autofac.Features.AttributeFilters; using DotNetty.Buffers; using DotNetty.Common.Utilities; +using Nethermind.Core.Container; using Nethermind.Core.Crypto; using Nethermind.Core.Extensions; using Nethermind.Crypto; @@ -34,7 +36,7 @@ public HandshakeService( IEciesCipher eciesCipher, ICryptoRandom cryptoRandom, IEcdsa ecdsa, - ProtectedPrivateKey privateKey, + [KeyFilter(ComponentKey.NodeKey)] ProtectedPrivateKey privateKey, ILogManager logManager) : this(messageSerializationService, eciesCipher, cryptoRandom, ecdsa, privateKey.Unprotect(), logManager) {