From f1687ec35aca89de2eed9e8d2112f219e6d49bb8 Mon Sep 17 00:00:00 2001 From: ak88 Date: Mon, 24 Jun 2024 11:35:38 +0200 Subject: [PATCH] removed log as dependency --- .../Ethereum.Basic.Test/TransactionTests.cs | 2 +- .../KeyAddressTests.cs | 2 +- .../Ethereum.Test.Base/BlockchainTestBase.cs | 2 +- .../TransactionTests.cs | 2 +- .../Nethermind.AuRa.Test/AuRaSealerTests.cs | 2 +- .../Contract/TxPriorityContractTests.cs | 2 +- .../Rlp/RlpDecodeBlockBenchmark.cs | 2 +- .../Rlp/RlpEncodeBlockBenchmark.cs | 2 +- .../Rlp/RlpEncodeHeaderBenchmark.cs | 2 +- .../Receipts/PersistentReceiptStorageTests.cs | 2 +- .../Receipts/ReceiptsIteratorTests.cs | 2 +- .../Receipts/ReceiptsRecoveryTests.cs | 2 +- .../Nethermind.Blockchain.Test/ReorgTests.cs | 2 +- .../CliqueBlockProducerTests.cs | 2 +- .../CliqueSealEngineTests.cs | 2 +- .../Nethermind.Clique.Test/CliqueTests.cs | 2 +- .../SnapshotManagerTests.cs | 2 +- .../AuRaBlockProcessor.cs | 2 +- .../Blockchain/TestBlockchain.cs | 4 ++-- .../Builders/BlockTreeBuilder.cs | 2 +- .../Builders/TransactionBuilder.cs | 4 ++-- .../Crypto/EthereumEcdsaTests.cs | 10 +++++----- .../Encoding/BlockDecoderTests.cs | 2 +- .../Encoding/ShardBlobTxDecoderTests.cs | 4 ++-- .../Encoding/TxDecoderTests.cs | 6 +++--- .../Nethermind.Core.Test/SignerTests.cs | 4 ++-- .../Nethermind.Crypto/EthereumEcdsa.cs | 10 +--------- .../Eip3529RefundsTests.cs | 2 +- .../Nethermind.Evm.Test/Eip6780Tests.cs | 2 +- .../EvmPooledMemoryTests.cs | 2 +- .../StorageAndSelfDestructTests.cs | 8 ++++---- .../Tracing/GasEstimationTests.cs | 2 +- .../TransactionProcessorEip4844Tests.cs | 2 +- .../TransactionProcessorFeeTests.cs | 2 +- .../TransactionProcessorTests.cs | 2 +- .../VirtualMachineTestsBase.cs | 2 +- .../Precompiles/EcRecoverPrecompile.cs | 2 +- .../TransactionProcessor.cs | 2 +- .../TxPoolBridgeTests.cs | 2 +- .../Nethermind.Init/Steps/InitCrypto.cs | 2 +- .../EthModuleBenchmarks.cs | 2 +- .../Modules/Eth/EthRpcModuleTests.cs | 2 +- .../Modules/ParityRpcModuleTests.cs | 2 +- .../Modules/PersonalRpcModuleTests.cs | 2 +- .../Modules/Proof/ProofRpcModuleTests.cs | 4 ++-- .../Modules/TestRpcBlockchain.cs | 2 +- .../Modules/Trace/ParityStyleTracerTests.cs | 2 +- .../ProcessedTransactionsDbCleanerTests.cs | 2 +- .../Synchronization/MergeBlockDownloader.cs | 2 +- .../Nethermind.Mev.Test/MevMegabundleTests.cs | 2 +- .../Eth62ProtocolHandlerBenchmarks.cs | 2 +- .../HandshakeBenchmarks.cs | 2 +- .../V62/BlockBodiesMessageSerializerTests.cs | 8 ++++---- .../V62/TransactionsMessageSerializerTests.cs | 20 +++++++++---------- .../Eth/V66/Eth66ProtocolHandlerTests.cs | 2 +- .../AuthEip8MessageSerializerTests.cs | 4 ++-- .../Handshake/AuthMessageSerializerTests.cs | 4 ++-- .../EncryptionHandshakeServiceTests.cs | 2 +- .../SyncThreadTests.cs | 2 +- .../Blocks/BlockDownloader.cs | 2 +- .../ReceiptStorageTests.cs | 2 +- .../TxBroadcasterTests.cs | 2 +- .../Nethermind.TxPool.Test/TxPoolTests.cs | 4 ++-- .../Nethermind.Wallet.Test/WalletTests.cs | 2 +- 64 files changed, 93 insertions(+), 101 deletions(-) diff --git a/src/Nethermind/Ethereum.Basic.Test/TransactionTests.cs b/src/Nethermind/Ethereum.Basic.Test/TransactionTests.cs index 1ce9cf6f735..4d1b4cfea7d 100644 --- a/src/Nethermind/Ethereum.Basic.Test/TransactionTests.cs +++ b/src/Nethermind/Ethereum.Basic.Test/TransactionTests.cs @@ -39,7 +39,7 @@ public static IEnumerable LoadTests() [TestCaseSource(nameof(LoadTests))] public void Test(TransactionTest test) { - EthereumEcdsa ethereumEcdsa = new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance); + EthereumEcdsa ethereumEcdsa = new EthereumEcdsa(TestBlockchainIds.ChainId); Transaction decodedUnsigned = Rlp.Decode(test.Unsigned); Assert.That(decodedUnsigned.Value, Is.EqualTo(test.Value), "value"); Assert.That(decodedUnsigned.GasPrice, Is.EqualTo(test.GasPrice), "gasPrice"); diff --git a/src/Nethermind/Ethereum.KeyAddress.Test/KeyAddressTests.cs b/src/Nethermind/Ethereum.KeyAddress.Test/KeyAddressTests.cs index 0384a6b5a4b..944ef338d97 100644 --- a/src/Nethermind/Ethereum.KeyAddress.Test/KeyAddressTests.cs +++ b/src/Nethermind/Ethereum.KeyAddress.Test/KeyAddressTests.cs @@ -26,7 +26,7 @@ public class KeyAddressTests public void SetUp() { Directory.SetCurrentDirectory(AppDomain.CurrentDomain.BaseDirectory); - _ecdsa = new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance); + _ecdsa = new EthereumEcdsa(TestBlockchainIds.ChainId); } private static IEnumerable LoadTests() diff --git a/src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs b/src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs index e6141c97996..74d3eb587cc 100644 --- a/src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs +++ b/src/Nethermind/Ethereum.Test.Base/BlockchainTestBase.cs @@ -131,7 +131,7 @@ protected async Task RunTest(BlockchainTest test, Stopwatch? specProvider.UpdateMergeTransitionInfo(0, 0); } - IEthereumEcdsa ecdsa = new EthereumEcdsa(specProvider.ChainId, _logManager); + IEthereumEcdsa ecdsa = new EthereumEcdsa(specProvider.ChainId); TrieStore trieStore = new(stateDb, _logManager); IWorldState stateProvider = new WorldState(trieStore, codeDb, _logManager); diff --git a/src/Nethermind/Ethereum.Transaction.Test/TransactionTests.cs b/src/Nethermind/Ethereum.Transaction.Test/TransactionTests.cs index 23682737ab7..ec1f5c3b4ce 100644 --- a/src/Nethermind/Ethereum.Transaction.Test/TransactionTests.cs +++ b/src/Nethermind/Ethereum.Transaction.Test/TransactionTests.cs @@ -190,7 +190,7 @@ private void RunTest(TransactionTest test, IReleaseSpec spec) Signature expectedSignature = new(validTest.R, validTest.S, validTest.V); Assert.That(transaction.Signature, Is.EqualTo(expectedSignature), "signature"); - IEthereumEcdsa ecdsa = new EthereumEcdsa(useChainId ? BlockchainIds.Mainnet : 0UL, LimboLogs.Instance); + IEthereumEcdsa ecdsa = new EthereumEcdsa(useChainId ? BlockchainIds.Mainnet : 0UL); bool verified = ecdsa.Verify( validTest.Sender, transaction); diff --git a/src/Nethermind/Nethermind.AuRa.Test/AuRaSealerTests.cs b/src/Nethermind/Nethermind.AuRa.Test/AuRaSealerTests.cs index 156a0517116..3868396dabf 100644 --- a/src/Nethermind/Nethermind.AuRa.Test/AuRaSealerTests.cs +++ b/src/Nethermind/Nethermind.AuRa.Test/AuRaSealerTests.cs @@ -73,7 +73,7 @@ public async Task seal_can_recover_address() block = await _auRaSealer.SealBlock(block, CancellationToken.None); - EthereumEcdsa ecdsa = new(BlockchainIds.Morden, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Morden); Signature signature = new(block.Header.AuRaSignature); signature.V += Signature.VOffset; Address? recoveredAddress = ecdsa.RecoverAddress(signature, block.Header.CalculateHash(RlpBehaviors.ForSealing)); diff --git a/src/Nethermind/Nethermind.AuRa.Test/Contract/TxPriorityContractTests.cs b/src/Nethermind/Nethermind.AuRa.Test/Contract/TxPriorityContractTests.cs index 1caa20bf3a9..d1554f7b638 100644 --- a/src/Nethermind/Nethermind.AuRa.Test/Contract/TxPriorityContractTests.cs +++ b/src/Nethermind/Nethermind.AuRa.Test/Contract/TxPriorityContractTests.cs @@ -296,7 +296,7 @@ public class TxPermissionContractBlockchainWithBlocks : TxPermissionContractBloc { protected override async Task AddBlocksOnStart() { - EthereumEcdsa ecdsa = new(ChainSpec.ChainId, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(ChainSpec.ChainId); await AddBlock( SignTransactions(ecdsa, TestItem.PrivateKeyA, 0, diff --git a/src/Nethermind/Nethermind.Benchmark/Rlp/RlpDecodeBlockBenchmark.cs b/src/Nethermind/Nethermind.Benchmark/Rlp/RlpDecodeBlockBenchmark.cs index e5f923d7fc8..99f343246f4 100644 --- a/src/Nethermind/Nethermind.Benchmark/Rlp/RlpDecodeBlockBenchmark.cs +++ b/src/Nethermind/Nethermind.Benchmark/Rlp/RlpDecodeBlockBenchmark.cs @@ -22,7 +22,7 @@ public RlpDecodeBlockBenchmark() var transactions = new Transaction[100]; for (int i = 0; i < 100; i++) { - transactions[i] = Build.A.Transaction.WithData(new byte[] { (byte)i }).WithNonce((UInt256)i).WithValue((UInt256)i).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), TestItem.PrivateKeyA).TestObject; + transactions[i] = Build.A.Transaction.WithData(new byte[] { (byte)i }).WithNonce((UInt256)i).WithValue((UInt256)i).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA).TestObject; } _scenarios = new[] diff --git a/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeBlockBenchmark.cs b/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeBlockBenchmark.cs index c055004e014..12324708b79 100644 --- a/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeBlockBenchmark.cs +++ b/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeBlockBenchmark.cs @@ -28,7 +28,7 @@ public RlpEncodeBlockBenchmark() var transactions = new Transaction[100]; for (int i = 0; i < 100; i++) { - transactions[i] = Build.A.Transaction.WithData(new byte[] { (byte)i }).WithNonce((UInt256)i).WithValue((UInt256)i).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), TestItem.PrivateKeyA).TestObject; + transactions[i] = Build.A.Transaction.WithData(new byte[] { (byte)i }).WithNonce((UInt256)i).WithValue((UInt256)i).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA).TestObject; } _scenarios = new[] diff --git a/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeHeaderBenchmark.cs b/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeHeaderBenchmark.cs index a572eb1424b..eb30eb284ef 100644 --- a/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeHeaderBenchmark.cs +++ b/src/Nethermind/Nethermind.Benchmark/Rlp/RlpEncodeHeaderBenchmark.cs @@ -27,7 +27,7 @@ public RlpEncodeHeaderBenchmark() var transactions = new Transaction[100]; for (int i = 0; i < 100; i++) { - transactions[i] = Build.A.Transaction.WithData(new byte[] { (byte)i }).WithNonce((UInt256)i).WithValue((UInt256)i).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), TestItem.PrivateKeyA).TestObject; + transactions[i] = Build.A.Transaction.WithData(new byte[] { (byte)i }).WithNonce((UInt256)i).WithValue((UInt256)i).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA).TestObject; } _scenarios = new[] diff --git a/src/Nethermind/Nethermind.Blockchain.Test/Receipts/PersistentReceiptStorageTests.cs b/src/Nethermind/Nethermind.Blockchain.Test/Receipts/PersistentReceiptStorageTests.cs index 9128bc17e76..e09182ba04e 100644 --- a/src/Nethermind/Nethermind.Blockchain.Test/Receipts/PersistentReceiptStorageTests.cs +++ b/src/Nethermind/Nethermind.Blockchain.Test/Receipts/PersistentReceiptStorageTests.cs @@ -48,7 +48,7 @@ public PersistentReceiptStorageTests(bool useCompactReceipts) public void SetUp() { MainnetSpecProvider specProvider = MainnetSpecProvider.Instance; - EthereumEcdsa ethereumEcdsa = new(specProvider.ChainId, LimboLogs.Instance); + EthereumEcdsa ethereumEcdsa = new(specProvider.ChainId); _receiptConfig = new ReceiptConfig(); _receiptsRecovery = new(ethereumEcdsa, specProvider); _receiptsDb = new TestMemColumnsDb(); diff --git a/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsIteratorTests.cs b/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsIteratorTests.cs index da658279ddc..a97147ae00f 100644 --- a/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsIteratorTests.cs +++ b/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsIteratorTests.cs @@ -107,7 +107,7 @@ private ReceiptsIterator CreateIterator(TxReceipt[] receipts, Block block) Span span = stream.AsSpan(); TestMemDb blockDb = new TestMemDb(); ReceiptsRecovery recovery = new ReceiptsRecovery( - new EthereumEcdsa(MainnetSpecProvider.Instance.ChainId, LimboLogs.Instance), + new EthereumEcdsa(MainnetSpecProvider.Instance.ChainId), MainnetSpecProvider.Instance, false ); diff --git a/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsRecoveryTests.cs b/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsRecoveryTests.cs index fbf4bf4cde7..6d72e44f4f9 100644 --- a/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsRecoveryTests.cs +++ b/src/Nethermind/Nethermind.Blockchain.Test/Receipts/ReceiptsRecoveryTests.cs @@ -20,7 +20,7 @@ public class ReceiptsRecoveryTests public void Setup() { MainnetSpecProvider specProvider = MainnetSpecProvider.Instance; - EthereumEcdsa ethereumEcdsa = new(specProvider.ChainId, LimboLogs.Instance); + EthereumEcdsa ethereumEcdsa = new(specProvider.ChainId); _receiptsRecovery = new ReceiptsRecovery(ethereumEcdsa, specProvider); } diff --git a/src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs b/src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs index 4303d621c45..db895f22fcc 100644 --- a/src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs +++ b/src/Nethermind/Nethermind.Blockchain.Test/ReorgTests.cs @@ -39,7 +39,7 @@ public void Setup() WorldState stateProvider = new(trieStore, memDbProvider.CodeDb, LimboLogs.Instance); StateReader stateReader = new(trieStore, memDbProvider.CodeDb, LimboLogs.Instance); ISpecProvider specProvider = MainnetSpecProvider.Instance; - EthereumEcdsa ecdsa = new(1, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(1); ITransactionComparerProvider transactionComparerProvider = new TransactionComparerProvider(specProvider, _blockTree); diff --git a/src/Nethermind/Nethermind.Clique.Test/CliqueBlockProducerTests.cs b/src/Nethermind/Nethermind.Clique.Test/CliqueBlockProducerTests.cs index ce11d9a3b6a..dbc4d72c2f2 100644 --- a/src/Nethermind/Nethermind.Clique.Test/CliqueBlockProducerTests.cs +++ b/src/Nethermind/Nethermind.Clique.Test/CliqueBlockProducerTests.cs @@ -51,7 +51,7 @@ private class On private readonly ILogger _logger; private static readonly ITimestamper _timestamper = Timestamper.Default; private readonly CliqueConfig _cliqueConfig; - private readonly EthereumEcdsa _ethereumEcdsa = new(BlockchainIds.Goerli, LimboLogs.Instance); + private readonly EthereumEcdsa _ethereumEcdsa = new(BlockchainIds.Goerli); private readonly Dictionary _logManagers = new(); private readonly Dictionary _snapshotManager = new(); private readonly Dictionary _blockTrees = new(); diff --git a/src/Nethermind/Nethermind.Clique.Test/CliqueSealEngineTests.cs b/src/Nethermind/Nethermind.Clique.Test/CliqueSealEngineTests.cs index 14f1e249ab9..38eefe80efe 100644 --- a/src/Nethermind/Nethermind.Clique.Test/CliqueSealEngineTests.cs +++ b/src/Nethermind/Nethermind.Clique.Test/CliqueSealEngineTests.cs @@ -98,7 +98,7 @@ public void Setup_chain() private CliqueSealer BuildSealer(int currentBlock, IDb db) { - IEthereumEcdsa ecdsa = new EthereumEcdsa(BlockchainIds.Goerli, LimboLogs.Instance); + IEthereumEcdsa ecdsa = new EthereumEcdsa(BlockchainIds.Goerli); CliqueConfig config = new(); int currentSignerIndex = (currentBlock % _signers.Count); _currentSigner = _signers[currentSignerIndex]; diff --git a/src/Nethermind/Nethermind.Clique.Test/CliqueTests.cs b/src/Nethermind/Nethermind.Clique.Test/CliqueTests.cs index 21c436e18ca..5bdaa0eac99 100644 --- a/src/Nethermind/Nethermind.Clique.Test/CliqueTests.cs +++ b/src/Nethermind/Nethermind.Clique.Test/CliqueTests.cs @@ -60,7 +60,7 @@ public void Setup_chain() MemDb db = new(); CliqueConfig config = new(); - _ecdsa = new EthereumEcdsa(BlockchainIds.Goerli, LimboLogs.Instance); + _ecdsa = new EthereumEcdsa(BlockchainIds.Goerli); _snapshotManager = new SnapshotManager(config, db, _blockTree, _ecdsa, LimboLogs.Instance); _clique = new CliqueSealer(new Signer(BlockchainIds.Goerli, key, LimboLogs.Instance), config, _snapshotManager, LimboLogs.Instance); _sealValidator = new CliqueSealValidator(config, _snapshotManager, LimboLogs.Instance); diff --git a/src/Nethermind/Nethermind.Clique.Test/SnapshotManagerTests.cs b/src/Nethermind/Nethermind.Clique.Test/SnapshotManagerTests.cs index 618c4cdac1a..549f5175241 100644 --- a/src/Nethermind/Nethermind.Clique.Test/SnapshotManagerTests.cs +++ b/src/Nethermind/Nethermind.Clique.Test/SnapshotManagerTests.cs @@ -98,7 +98,7 @@ public void Recognises_signer_turn() Block genesis = CliqueTests.GetGenesis(); Snapshot snapshot = snapshotManager.GetOrCreateSnapshot(0, genesis.Hash); // Here we use a random chain id, should be test independent. - SnapshotManager manager = new(CliqueConfig.Default, _snapshotDb, _blockTree, new EthereumEcdsa(BlockchainIds.GenericNonRealNetwork, LimboLogs.Instance), LimboLogs.Instance); + SnapshotManager manager = new(CliqueConfig.Default, _snapshotDb, _blockTree, new EthereumEcdsa(BlockchainIds.GenericNonRealNetwork), LimboLogs.Instance); // Block 1 Assert.IsTrue(manager.IsInTurn(snapshot, 1, _signer1)); Assert.IsFalse(manager.IsInTurn(snapshot, 1, _signer2)); diff --git a/src/Nethermind/Nethermind.Consensus.AuRa/AuRaBlockProcessor.cs b/src/Nethermind/Nethermind.Consensus.AuRa/AuRaBlockProcessor.cs index 9ba9f8341fa..33554bbca6e 100644 --- a/src/Nethermind/Nethermind.Consensus.AuRa/AuRaBlockProcessor.cs +++ b/src/Nethermind/Nethermind.Consensus.AuRa/AuRaBlockProcessor.cs @@ -142,7 +142,7 @@ private AddingTxEventArgs CheckTxPosdaoRules(AddingTxEventArgs args) if (tx.Signature is not null) { IReleaseSpec spec = _specProvider.GetSpec(args.Block.Header); - EthereumEcdsa ecdsa = new(_specProvider.ChainId, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(_specProvider.ChainId); Address txSenderAddress = ecdsa.RecoverAddress(tx, !spec.ValidateChainId); if (tx.SenderAddress != txSenderAddress) { diff --git a/src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs b/src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs index b4193096de6..bc339a6d3f3 100644 --- a/src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs +++ b/src/Nethermind/Nethermind.Core.Test/Blockchain/TestBlockchain.cs @@ -126,7 +126,7 @@ protected virtual async Task Build(ISpecProvider? specProvider = Timestamper = new ManualTimestamper(new DateTime(2020, 2, 15, 12, 50, 30, DateTimeKind.Utc)); JsonSerializer = new EthereumJsonSerializer(); SpecProvider = CreateSpecProvider(specProvider ?? MainnetSpecProvider.Instance); - EthereumEcdsa = new EthereumEcdsa(SpecProvider.ChainId, LogManager); + EthereumEcdsa = new EthereumEcdsa(SpecProvider.ChainId); DbProvider = await CreateDbProvider(); TrieStore = new TrieStore(StateDb, LogManager); State = new WorldState(TrieStore, DbProvider.CodeDb, LogManager, new PreBlockCaches()); @@ -206,7 +206,7 @@ protected virtual async Task Build(ISpecProvider? specProvider = SealEngine = new SealEngine(sealer, Always.Valid); BloomStorage bloomStorage = new(new BloomConfig(), new MemDb(), new InMemoryDictionaryFileStoreFactory()); - ReceiptsRecovery receiptsRecovery = new(new EthereumEcdsa(SpecProvider.ChainId, LimboLogs.Instance), SpecProvider); + ReceiptsRecovery receiptsRecovery = new(new EthereumEcdsa(SpecProvider.ChainId), SpecProvider); LogFinder = new LogFinder(BlockTree, ReceiptStorage, ReceiptStorage, bloomStorage, LimboLogs.Instance, receiptsRecovery); BeaconBlockRootHandler = new BeaconBlockRootHandler(); BlockProcessor = CreateBlockProcessor(); diff --git a/src/Nethermind/Nethermind.Core.Test/Builders/BlockTreeBuilder.cs b/src/Nethermind/Nethermind.Core.Test/Builders/BlockTreeBuilder.cs index 1f509b8e621..52f1039b9cf 100644 --- a/src/Nethermind/Nethermind.Core.Test/Builders/BlockTreeBuilder.cs +++ b/src/Nethermind/Nethermind.Core.Test/Builders/BlockTreeBuilder.cs @@ -383,7 +383,7 @@ public static void ExtendTree(IBlockTree blockTree, long newChainLength) public BlockTreeBuilder WithTransactions(IReceiptStorage receiptStorage, Func>? logsForBlockBuilder = null) { - _ecdsa = new EthereumEcdsa(BlockTree.ChainId, LimboLogs.Instance); + _ecdsa = new EthereumEcdsa(BlockTree.ChainId); _receiptStorage = receiptStorage; _logCreationFunction = logsForBlockBuilder; return this; diff --git a/src/Nethermind/Nethermind.Core.Test/Builders/TransactionBuilder.cs b/src/Nethermind/Nethermind.Core.Test/Builders/TransactionBuilder.cs index a06da3f81ef..cb8c9e984f3 100644 --- a/src/Nethermind/Nethermind.Core.Test/Builders/TransactionBuilder.cs +++ b/src/Nethermind/Nethermind.Core.Test/Builders/TransactionBuilder.cs @@ -239,7 +239,7 @@ public TransactionBuilder Signed(IEthereumEcdsa ecdsa, PrivateKey privateKey, public TransactionBuilder Signed(PrivateKey? privateKey = null) { privateKey ??= TestItem.IgnoredPrivateKey; - EthereumEcdsa ecdsa = new(TestObjectInternal.ChainId ?? TestBlockchainIds.ChainId, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(TestObjectInternal.ChainId ?? TestBlockchainIds.ChainId); return Signed(ecdsa, privateKey, isEip155Enabled: true); } @@ -256,7 +256,7 @@ public TransactionBuilder SignedAndResolved(IEthereumEcdsa ecdsa, PrivateKey public TransactionBuilder SignedAndResolved(PrivateKey? privateKey = null) { privateKey ??= TestItem.IgnoredPrivateKey; - EthereumEcdsa ecdsa = new(TestObjectInternal.ChainId ?? TestBlockchainIds.ChainId, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(TestObjectInternal.ChainId ?? TestBlockchainIds.ChainId); ecdsa.Sign(privateKey, TestObjectInternal, true); TestObjectInternal.SenderAddress = privateKey.Address; return this; diff --git a/src/Nethermind/Nethermind.Core.Test/Crypto/EthereumEcdsaTests.cs b/src/Nethermind/Nethermind.Core.Test/Crypto/EthereumEcdsaTests.cs index 2c6fa87d3e5..a11dc55dd69 100644 --- a/src/Nethermind/Nethermind.Core.Test/Crypto/EthereumEcdsaTests.cs +++ b/src/Nethermind/Nethermind.Core.Test/Crypto/EthereumEcdsaTests.cs @@ -21,7 +21,7 @@ public class EthereumEcdsaTests [TestCaseSource(nameof(TestCaseSources))] public void Signature_verify_test((string Name, Transaction Tx) testCase) { - EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia); ecdsa.Verify(testCase.Tx.SenderAddress!, testCase.Tx); } @@ -30,7 +30,7 @@ public void Signature_verify_test((string Name, Transaction Tx) testCase) [TestCase(false)] public void Signature_test_sepolia(bool eip155) { - EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia); PrivateKey key = Build.A.PrivateKey.TestObject; Transaction tx = Build.A.Transaction.TestObject; ecdsa.Sign(key, tx, eip155); @@ -42,7 +42,7 @@ public void Signature_test_sepolia(bool eip155) [TestCase(false)] public void Signature_test_sepolia_1559(bool eip155) { - EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia); PrivateKey key = Build.A.PrivateKey.TestObject; Transaction tx = Build.A.Transaction.WithType(TxType.EIP1559).TestObject; ecdsa.Sign(key, tx, eip155); @@ -54,7 +54,7 @@ public void Signature_test_sepolia_1559(bool eip155) [TestCase(false)] public void Signature_test_olympic(bool isEip155Enabled) { - EthereumEcdsa ecdsa = new(BlockchainIds.Mainnet, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Mainnet); PrivateKey key = Build.A.PrivateKey.TestObject; Transaction tx = Build.A.Transaction.TestObject; ecdsa.Sign(key, tx, isEip155Enabled); @@ -66,7 +66,7 @@ public void Signature_test_olympic(bool isEip155Enabled) public void Sign_generic_network() { // maybe make random id so it captures the idea that signature should work irrespective of chain - EthereumEcdsa ecdsa = new(BlockchainIds.GenericNonRealNetwork, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.GenericNonRealNetwork); PrivateKey key = Build.A.PrivateKey.TestObject; Transaction tx = Build.A.Transaction.TestObject; ecdsa.Sign(key, tx, true); diff --git a/src/Nethermind/Nethermind.Core.Test/Encoding/BlockDecoderTests.cs b/src/Nethermind/Nethermind.Core.Test/Encoding/BlockDecoderTests.cs index bf378f9d01c..2b9b49dda37 100644 --- a/src/Nethermind/Nethermind.Core.Test/Encoding/BlockDecoderTests.cs +++ b/src/Nethermind/Nethermind.Core.Test/Encoding/BlockDecoderTests.cs @@ -28,7 +28,7 @@ public BlockDecoderTests() .WithData(new byte[] { (byte)i }) .WithNonce((UInt256)i) .WithValue((UInt256)i) - .Signed(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), TestItem.PrivateKeyA, true) + .Signed(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA, true) .TestObject; } diff --git a/src/Nethermind/Nethermind.Core.Test/Encoding/ShardBlobTxDecoderTests.cs b/src/Nethermind/Nethermind.Core.Test/Encoding/ShardBlobTxDecoderTests.cs index e4ce2d91c9f..8cbd5d3ccb7 100644 --- a/src/Nethermind/Nethermind.Core.Test/Encoding/ShardBlobTxDecoderTests.cs +++ b/src/Nethermind/Nethermind.Core.Test/Encoding/ShardBlobTxDecoderTests.cs @@ -38,7 +38,7 @@ public void Roundtrip_ExecutionPayloadForm_for_shard_blobs((Transaction Tx, stri rlpStream.Position = 0; Transaction? decoded = _txDecoder.Decode(rlpStream); decoded!.SenderAddress = - new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance).RecoverAddress(decoded); + new EthereumEcdsa(TestBlockchainIds.ChainId).RecoverAddress(decoded); decoded.Hash = decoded.CalculateHash(); decoded.Should().BeEquivalentTo(testCase.Tx, testCase.Description); } @@ -54,7 +54,7 @@ public void Roundtrip_ValueDecoderContext_ExecutionPayloadForm_for_shard_blobs(( rlpStream.Position = 0; Transaction? decoded = _txDecoder.Decode(ref decoderContext); decoded!.SenderAddress = - new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance).RecoverAddress(decoded); + new EthereumEcdsa(TestBlockchainIds.ChainId).RecoverAddress(decoded); decoded.Hash = decoded.CalculateHash(); decoded.Should().BeEquivalentTo(testCase.Tx, testCase.Description); } diff --git a/src/Nethermind/Nethermind.Core.Test/Encoding/TxDecoderTests.cs b/src/Nethermind/Nethermind.Core.Test/Encoding/TxDecoderTests.cs index 3fbfd883789..76dcc48a671 100644 --- a/src/Nethermind/Nethermind.Core.Test/Encoding/TxDecoderTests.cs +++ b/src/Nethermind/Nethermind.Core.Test/Encoding/TxDecoderTests.cs @@ -99,7 +99,7 @@ public void Roundtrip((Transaction Tx, string Description) testCase) rlpStream.Position = 0; Transaction? decoded = _txDecoder.Decode(rlpStream); decoded!.SenderAddress = - new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance).RecoverAddress(decoded); + new EthereumEcdsa(TestBlockchainIds.ChainId).RecoverAddress(decoded); decoded.Hash = decoded.CalculateHash(); decoded.EqualToTransaction(testCase.Tx); } @@ -115,7 +115,7 @@ public void Roundtrip_ValueDecoderContext((Transaction Tx, string Description) t rlpStream.Position = 0; Transaction? decoded = _txDecoder.Decode(ref decoderContext); decoded!.SenderAddress = - new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance).RecoverAddress(decoded); + new EthereumEcdsa(TestBlockchainIds.ChainId).RecoverAddress(decoded); decoded.Hash = decoded.CalculateHash(); decoded.EqualToTransaction(testCase.Tx); } @@ -130,7 +130,7 @@ public void Roundtrip_ValueDecoderContext_WithMemorySlice((Transaction Tx, strin rlpStream.Position = 0; Transaction? decoded = _txDecoder.Decode(ref decoderContext); decoded!.SenderAddress = - new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance).RecoverAddress(decoded); + new EthereumEcdsa(TestBlockchainIds.ChainId).RecoverAddress(decoded); decoded.Hash = decoded.CalculateHash(); decoded.EqualToTransaction(testCase.Tx); } diff --git a/src/Nethermind/Nethermind.Core.Test/SignerTests.cs b/src/Nethermind/Nethermind.Core.Test/SignerTests.cs index 42e2c036366..53683e27c9c 100644 --- a/src/Nethermind/Nethermind.Core.Test/SignerTests.cs +++ b/src/Nethermind/Nethermind.Core.Test/SignerTests.cs @@ -32,7 +32,7 @@ public void Hex_and_back_again(string hexSignature) [Test] public void Sign_and_recover() { - EthereumEcdsa ethereumEcdsa = new(BlockchainIds.Olympic, LimboLogs.Instance); + EthereumEcdsa ethereumEcdsa = new(BlockchainIds.Olympic); Hash256 message = Keccak.Compute("Test message"); PrivateKey privateKey = Build.A.PrivateKey.TestObject; @@ -43,7 +43,7 @@ public void Sign_and_recover() [Test] public void Decompress() { - EthereumEcdsa ethereumEcdsa = new(BlockchainIds.Olympic, LimboLogs.Instance); + EthereumEcdsa ethereumEcdsa = new(BlockchainIds.Olympic); PrivateKey privateKey = Build.A.PrivateKey.TestObject; CompressedPublicKey compressedPublicKey = privateKey.CompressedPublicKey; PublicKey expected = privateKey.PublicKey; diff --git a/src/Nethermind/Nethermind.Crypto/EthereumEcdsa.cs b/src/Nethermind/Nethermind.Crypto/EthereumEcdsa.cs index 48eeb1d07be..7b27a145d43 100644 --- a/src/Nethermind/Nethermind.Crypto/EthereumEcdsa.cs +++ b/src/Nethermind/Nethermind.Crypto/EthereumEcdsa.cs @@ -27,20 +27,14 @@ public class EthereumEcdsa : Ecdsa, IEthereumEcdsa NumberStyles.HexNumber); private readonly ulong _chainIdValue; - private readonly ILogger _logger; - public EthereumEcdsa(ulong chainId, ILogManager logManager) + public EthereumEcdsa(ulong chainId) { - _logger = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager)); _chainIdValue = chainId; } public void Sign(PrivateKey privateKey, Transaction tx, bool isEip155Enabled) { - if (_logger.IsDebug) - _logger.Debug( - $"Signing transaction {tx.SenderAddress} -> {tx.To} ({tx.Value}) with data of length {tx.Data?.Length}"); - if (tx.Type != TxType.Legacy) { tx.ChainId = _chainIdValue; @@ -53,8 +47,6 @@ public void Sign(PrivateKey privateKey, Transaction tx, bool isEip155Enabled) { tx.Signature.V = tx.Signature.V + 8 + 2 * _chainIdValue; } - - if (_logger.IsDebug) _logger.Debug($"Transaction {tx.SenderAddress} -> {tx.To} ({tx.Value}) signed"); } /// diff --git a/src/Nethermind/Nethermind.Evm.Test/Eip3529RefundsTests.cs b/src/Nethermind/Nethermind.Evm.Test/Eip3529RefundsTests.cs index 81c276ef05d..510bc998b7d 100644 --- a/src/Nethermind/Nethermind.Evm.Test/Eip3529RefundsTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/Eip3529RefundsTests.cs @@ -146,7 +146,7 @@ public void After_3529_self_destruct_has_zero_refund(bool eip3529Enabled) long gasLimit = 1000000; - EthereumEcdsa ecdsa = new(1, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(1); // deploy create 2 Transaction tx0 = Build.A.Transaction.WithCode(initOfCreate2Code).WithGasLimit(gasLimit).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; // invoke create 2 to deploy contract diff --git a/src/Nethermind/Nethermind.Evm.Test/Eip6780Tests.cs b/src/Nethermind/Nethermind.Evm.Test/Eip6780Tests.cs index 37d6a951800..91e5329b87b 100644 --- a/src/Nethermind/Nethermind.Evm.Test/Eip6780Tests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/Eip6780Tests.cs @@ -39,7 +39,7 @@ public class Eip6780Tests : VirtualMachineTestsBase private Address _contractAddress; private byte[] _initCode; private readonly long _gasLimit = 1000000; - private readonly EthereumEcdsa _ecdsa = new(1, LimboLogs.Instance); + private readonly EthereumEcdsa _ecdsa = new(1); [SetUp] public override void Setup() diff --git a/src/Nethermind/Nethermind.Evm.Test/EvmPooledMemoryTests.cs b/src/Nethermind/Nethermind.Evm.Test/EvmPooledMemoryTests.cs index ab88c978cae..bfa853192b5 100644 --- a/src/Nethermind/Nethermind.Evm.Test/EvmPooledMemoryTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/EvmPooledMemoryTests.cs @@ -143,7 +143,7 @@ public void GetTrace_memory_should_not_overflow() private static readonly Address to = new Address("0x000000000000000000000000636f6e7472616374"); private static readonly Address coinbase = new Address("0x4444588443C3a91288c5002483449Aba1054192b"); // for testing purposes, particular chain id does not matter. Maybe make random id so it captures the idea that signature should would irrespective of chain - private static readonly EthereumEcdsa ethereumEcdsa = new(BlockchainIds.GenericNonRealNetwork, LimboLogs.Instance); + private static readonly EthereumEcdsa ethereumEcdsa = new(BlockchainIds.GenericNonRealNetwork); private static string run(byte[] input) { long blocknr = 12965000; diff --git a/src/Nethermind/Nethermind.Evm.Test/StorageAndSelfDestructTests.cs b/src/Nethermind/Nethermind.Evm.Test/StorageAndSelfDestructTests.cs index 9477089d2db..97b553f28d8 100644 --- a/src/Nethermind/Nethermind.Evm.Test/StorageAndSelfDestructTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/StorageAndSelfDestructTests.cs @@ -63,7 +63,7 @@ public void Load_self_destruct() long gasLimit = 1000000; - EthereumEcdsa ecdsa = new(1, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(1); Transaction initTx = Build.A.Transaction.WithCode(initByteCode).WithGasLimit(gasLimit).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; Transaction tx1 = Build.A.Transaction.WithCode(byteCode1).WithGasLimit(gasLimit).WithNonce(1).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; Transaction tx2 = Build.A.Transaction.WithCode(byteCode2).WithGasLimit(gasLimit).WithNonce(2).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; @@ -142,7 +142,7 @@ public void Destroy_restore_store() long gasLimit = 1000000; - EthereumEcdsa ecdsa = new(1, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(1); // deploy create 2 Transaction tx0 = Build.A.Transaction.WithCode(initOfCreate2Code).WithGasLimit(gasLimit).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; // invoke create 2 to deploy contract @@ -247,7 +247,7 @@ public void Destroy_restore_store_different_cells() long gasLimit = 1000000; - EthereumEcdsa ecdsa = new(1, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(1); // deploy create 2 Transaction tx0 = Build.A.Transaction.WithCode(initOfCreate2Code).WithGasLimit(gasLimit).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; // invoke create 2 to deploy contract @@ -364,7 +364,7 @@ public void Destroy_restore_store_different_cells_previously_existing() long gasLimit = 1000000; - EthereumEcdsa ecdsa = new(1, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(1); // deploy create 2 Transaction tx0 = Build.A.Transaction.WithCode(initOfCreate2Code).WithGasLimit(gasLimit).SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; // call contract once diff --git a/src/Nethermind/Nethermind.Evm.Test/Tracing/GasEstimationTests.cs b/src/Nethermind/Nethermind.Evm.Test/Tracing/GasEstimationTests.cs index def68b3ca1d..c6af6bf6b3e 100644 --- a/src/Nethermind/Nethermind.Evm.Test/Tracing/GasEstimationTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/Tracing/GasEstimationTests.cs @@ -365,7 +365,7 @@ public TestEnvironment() CodeInfoRepository codeInfoRepository = new(); VirtualMachine virtualMachine = new(new TestBlockhashProvider(_specProvider), _specProvider, codeInfoRepository, LimboLogs.Instance); _transactionProcessor = new TransactionProcessor(_specProvider, _stateProvider, virtualMachine, codeInfoRepository, LimboLogs.Instance); - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, LimboLogs.Instance); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); tracer = new(); BlocksConfig blocksConfig = new(); diff --git a/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorEip4844Tests.cs b/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorEip4844Tests.cs index 562b27e937e..fcd0eda8227 100644 --- a/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorEip4844Tests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorEip4844Tests.cs @@ -38,7 +38,7 @@ public void Setup() CodeInfoRepository codeInfoRepository = new(); VirtualMachine virtualMachine = new(new TestBlockhashProvider(_specProvider), _specProvider, codeInfoRepository, LimboLogs.Instance); _transactionProcessor = new TransactionProcessor(_specProvider, _stateProvider, virtualMachine, codeInfoRepository, LimboLogs.Instance); - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, LimboLogs.Instance); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); } diff --git a/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorFeeTests.cs b/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorFeeTests.cs index e0185255a0b..574dcdbc171 100644 --- a/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorFeeTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorFeeTests.cs @@ -45,7 +45,7 @@ public void Setup() CodeInfoRepository codeInfoRepository = new(); VirtualMachine virtualMachine = new(new TestBlockhashProvider(_specProvider), _specProvider, codeInfoRepository, LimboLogs.Instance); _transactionProcessor = new TransactionProcessor(_specProvider, _stateProvider, virtualMachine, codeInfoRepository, LimboLogs.Instance); - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, LimboLogs.Instance); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); } [TestCase(true, true)] diff --git a/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorTests.cs b/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorTests.cs index 3a7139dc4b6..59b07b4e72a 100644 --- a/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorTests.cs +++ b/src/Nethermind/Nethermind.Evm.Test/TransactionProcessorTests.cs @@ -61,7 +61,7 @@ public void Setup() CodeInfoRepository codeInfoRepository = new(); VirtualMachine virtualMachine = new(new TestBlockhashProvider(_specProvider), _specProvider, codeInfoRepository, LimboLogs.Instance); _transactionProcessor = new TransactionProcessor(_specProvider, _stateProvider, virtualMachine, codeInfoRepository, LimboLogs.Instance); - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, LimboLogs.Instance); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); } [TestCase(true, true)] diff --git a/src/Nethermind/Nethermind.Evm.Test/VirtualMachineTestsBase.cs b/src/Nethermind/Nethermind.Evm.Test/VirtualMachineTestsBase.cs index dcddc35cfec..c0985fdc74e 100644 --- a/src/Nethermind/Nethermind.Evm.Test/VirtualMachineTestsBase.cs +++ b/src/Nethermind/Nethermind.Evm.Test/VirtualMachineTestsBase.cs @@ -66,7 +66,7 @@ public virtual void Setup() _stateDb = new MemDb(); ITrieStore trieStore = new TrieStore(_stateDb, logManager); TestState = new WorldState(trieStore, codeDb, logManager); - _ethereumEcdsa = new EthereumEcdsa(SpecProvider.ChainId, logManager); + _ethereumEcdsa = new EthereumEcdsa(SpecProvider.ChainId); IBlockhashProvider blockhashProvider = new TestBlockhashProvider(SpecProvider); CodeInfoRepository = new CodeInfoRepository(); Machine = new VirtualMachine(blockhashProvider, SpecProvider, CodeInfoRepository, logManager); diff --git a/src/Nethermind/Nethermind.Evm/Precompiles/EcRecoverPrecompile.cs b/src/Nethermind/Nethermind.Evm/Precompiles/EcRecoverPrecompile.cs index 037e1637d18..93a3b7994d1 100644 --- a/src/Nethermind/Nethermind.Evm/Precompiles/EcRecoverPrecompile.cs +++ b/src/Nethermind/Nethermind.Evm/Precompiles/EcRecoverPrecompile.cs @@ -26,7 +26,7 @@ private EcRecoverPrecompile() public long BaseGasCost(IReleaseSpec releaseSpec) => 3000L; - private readonly EthereumEcdsa _ecdsa = new(BlockchainIds.Mainnet, LimboLogs.Instance); + private readonly EthereumEcdsa _ecdsa = new(BlockchainIds.Mainnet); private readonly byte[] _zero31 = new byte[31]; diff --git a/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs b/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs index 95744638d44..b3900c23e6f 100644 --- a/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs +++ b/src/Nethermind/Nethermind.Evm/TransactionProcessing/TransactionProcessor.cs @@ -81,7 +81,7 @@ public TransactionProcessor( VirtualMachine = virtualMachine; _codeInfoRepository = codeInfoRepository; - Ecdsa = new EthereumEcdsa(specProvider.ChainId, logManager); + Ecdsa = new EthereumEcdsa(specProvider.ChainId); } public TransactionResult CallAndRestore(Transaction transaction, in BlockExecutionContext blCtx, ITxTracer txTracer) => diff --git a/src/Nethermind/Nethermind.Facade.Test/TxPoolBridgeTests.cs b/src/Nethermind/Nethermind.Facade.Test/TxPoolBridgeTests.cs index 65cc8729908..a9a0bcc4a31 100644 --- a/src/Nethermind/Nethermind.Facade.Test/TxPoolBridgeTests.cs +++ b/src/Nethermind/Nethermind.Facade.Test/TxPoolBridgeTests.cs @@ -34,7 +34,7 @@ public void SetUp() [Test] public void Timestamp_is_set_on_transactions() { - Transaction tx = Build.A.Transaction.WithSenderAddress(TestItem.AddressA).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), TestItem.PrivateKeyA).TestObject; + Transaction tx = Build.A.Transaction.WithSenderAddress(TestItem.AddressA).Signed(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA).TestObject; _txSender.SendTransaction(tx, TxHandlingOptions.PersistentBroadcast); _txPool.Received().SubmitTx(Arg.Is(tx => tx.Timestamp != UInt256.Zero), TxHandlingOptions.PersistentBroadcast); } diff --git a/src/Nethermind/Nethermind.Init/Steps/InitCrypto.cs b/src/Nethermind/Nethermind.Init/Steps/InitCrypto.cs index 7dfe8751497..aa3a7f6a91c 100644 --- a/src/Nethermind/Nethermind.Init/Steps/InitCrypto.cs +++ b/src/Nethermind/Nethermind.Init/Steps/InitCrypto.cs @@ -22,7 +22,7 @@ public InitCrypto(INethermindApi api) [Todo(Improve.Refactor, "Automatically scan all the references solutions?")] public virtual Task Execute(CancellationToken _) { - _api.EthereumEcdsa = new EthereumEcdsa(_api.SpecProvider!.ChainId, _api.LogManager); + _api.EthereumEcdsa = new EthereumEcdsa(_api.SpecProvider!.ChainId); return Task.CompletedTask; } } diff --git a/src/Nethermind/Nethermind.JsonRpc.Benchmark/EthModuleBenchmarks.cs b/src/Nethermind/Nethermind.JsonRpc.Benchmark/EthModuleBenchmarks.cs index 246c6052c22..4466f0da2ce 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Benchmark/EthModuleBenchmarks.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Benchmark/EthModuleBenchmarks.cs @@ -97,7 +97,7 @@ TransactionProcessor transactionProcessor BlockProcessor blockProcessor = new(specProvider, Always.Valid, new RewardCalculator(specProvider), transactionsExecutor, stateProvider, NullReceiptStorage.Instance, new BlockhashStore(blockTree, specProvider, stateProvider), LimboLogs.Instance); - EthereumEcdsa ecdsa = new(specProvider.ChainId, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(specProvider.ChainId); BlockchainProcessor blockchainProcessor = new( blockTree, blockProcessor, diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs index b613c75e75c..c5b2ae5db1a 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs @@ -1035,7 +1035,7 @@ public async Task Send_transaction_with_signature_will_not_try_to_sign() txSender.SendTransaction(Arg.Any(), TxHandlingOptions.PersistentBroadcast).Returns((TestItem.KeccakA, AcceptTxResult.Accepted)); ctx.Test = await TestRpcBlockchain.ForTest(SealEngineType.NethDev).WithBlockchainBridge(bridge).WithTxSender(txSender).Build(); - Transaction tx = Build.A.Transaction.Signed(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), TestItem.PrivateKeyA).TestObject; + Transaction tx = Build.A.Transaction.Signed(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA).TestObject; string serialized = await ctx.Test.TestEthRpc("eth_sendRawTransaction", Rlp.Encode(tx, RlpBehaviors.None).Bytes.ToHexString()); await txSender.Received().SendTransaction(Arg.Any(), TxHandlingOptions.PersistentBroadcast); diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/ParityRpcModuleTests.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/ParityRpcModuleTests.cs index 8b4a3052a6c..3fd4d6dbac0 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/ParityRpcModuleTests.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/ParityRpcModuleTests.cs @@ -56,7 +56,7 @@ public void Initialize() { LimboLogs logger = LimboLogs.Instance; MainnetSpecProvider specProvider = MainnetSpecProvider.Instance; - _ethereumEcdsa = new(specProvider.ChainId, logger); + _ethereumEcdsa = new(specProvider.ChainId); Peer peerA = SetUpPeerA(); //standard case Peer peerB = SetUpPeerB(); //Session is null diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/PersonalRpcModuleTests.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/PersonalRpcModuleTests.cs index ce707f19bab..19a04413700 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/PersonalRpcModuleTests.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/PersonalRpcModuleTests.cs @@ -23,7 +23,7 @@ public class PersonalRpcModuleTests public void Initialize() { _wallet = new DevWallet(new WalletConfig(), LimboLogs.Instance); - _ecdsa = new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance); + _ecdsa = new EthereumEcdsa(TestBlockchainIds.ChainId); _keyStore = Substitute.For(); } diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Proof/ProofRpcModuleTests.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Proof/ProofRpcModuleTests.cs index 22d8e66c775..7f74b75145a 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Proof/ProofRpcModuleTests.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Proof/ProofRpcModuleTests.cs @@ -76,7 +76,7 @@ public async Task Setup() ProofModuleFactory moduleFactory = new( _worldStateManager, _blockTree, - new CompositeBlockPreprocessorStep(new RecoverSignatures(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), NullTxPool.Instance, _specProvider, LimboLogs.Instance)), + new CompositeBlockPreprocessorStep(new RecoverSignatures(new EthereumEcdsa(TestBlockchainIds.ChainId), NullTxPool.Instance, _specProvider, LimboLogs.Instance)), receiptStorage, _specProvider, LimboLogs.Instance); @@ -220,7 +220,7 @@ public async Task Get_receipt_when_block_has_few_receipts(bool withHeader, strin ProofModuleFactory moduleFactory = new ProofModuleFactory( _worldStateManager, _blockTree, - new CompositeBlockPreprocessorStep(new RecoverSignatures(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), NullTxPool.Instance, _specProvider, LimboLogs.Instance)), + new CompositeBlockPreprocessorStep(new RecoverSignatures(new EthereumEcdsa(TestBlockchainIds.ChainId), NullTxPool.Instance, _specProvider, LimboLogs.Instance)), _receiptFinder, _specProvider, LimboLogs.Instance); diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcBlockchain.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcBlockchain.cs index 6fba1d025d9..819c8464f75 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcBlockchain.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/TestRpcBlockchain.cs @@ -142,7 +142,7 @@ protected override async Task Build( ITxSigner txSigner = new WalletTxSigner(TestWallet, specProvider.ChainId); TxSealer = new TxSealer(txSigner, Timestamper); - TxSender ??= new TxPoolSender(TxPool, TxSealer, NonceManager, EthereumEcdsa ?? new EthereumEcdsa(specProvider.ChainId, LogManager)); + TxSender ??= new TxPoolSender(TxPool, TxSealer, NonceManager, EthereumEcdsa ?? new EthereumEcdsa(specProvider.ChainId)); GasPriceOracle ??= new GasPriceOracle(BlockFinder, SpecProvider, LogManager); FeeHistoryOracle ??= new FeeHistoryOracle(BlockTree, ReceiptStorage, SpecProvider); ISyncConfig syncConfig = new SyncConfig(); diff --git a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Trace/ParityStyleTracerTests.cs b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Trace/ParityStyleTracerTests.cs index a6aef576922..f1db95b2139 100644 --- a/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Trace/ParityStyleTracerTests.cs +++ b/src/Nethermind/Nethermind.JsonRpc.Test/Modules/Trace/ParityStyleTracerTests.cs @@ -78,7 +78,7 @@ public void Setup() new BlockhashStore(_blockTree, specProvider, stateProvider), LimboLogs.Instance); - RecoverSignatures txRecovery = new(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), NullTxPool.Instance, specProvider, LimboLogs.Instance); + RecoverSignatures txRecovery = new(new EthereumEcdsa(TestBlockchainIds.ChainId), NullTxPool.Instance, specProvider, LimboLogs.Instance); _processor = new BlockchainProcessor(_blockTree, blockProcessor, txRecovery, _stateReader, LimboLogs.Instance, BlockchainProcessor.Options.NoReceipts); Block genesis = Build.A.Block.Genesis.TestObject; diff --git a/src/Nethermind/Nethermind.Merge.Plugin.Test/ProcessedTransactionsDbCleanerTests.cs b/src/Nethermind/Nethermind.Merge.Plugin.Test/ProcessedTransactionsDbCleanerTests.cs index ee17433c037..cffc22457db 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin.Test/ProcessedTransactionsDbCleanerTests.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin.Test/ProcessedTransactionsDbCleanerTests.cs @@ -35,7 +35,7 @@ Transaction GetTx(PrivateKey sender) .WithMaxFeePerGas(UInt256.One) .WithMaxPriorityFeePerGas(UInt256.One) .WithNonce(UInt256.Zero) - .SignedAndResolved(new EthereumEcdsa(_specProvider.ChainId, _logManager), sender).TestObject; + .SignedAndResolved(new EthereumEcdsa(_specProvider.ChainId), sender).TestObject; } IColumnsDb columnsDb = new MemColumnsDb(BlobTxsColumns.ProcessedTxs); diff --git a/src/Nethermind/Nethermind.Merge.Plugin/Synchronization/MergeBlockDownloader.cs b/src/Nethermind/Nethermind.Merge.Plugin/Synchronization/MergeBlockDownloader.cs index e808719cf13..6dda2612c56 100644 --- a/src/Nethermind/Nethermind.Merge.Plugin/Synchronization/MergeBlockDownloader.cs +++ b/src/Nethermind/Nethermind.Merge.Plugin/Synchronization/MergeBlockDownloader.cs @@ -65,7 +65,7 @@ public MergeBlockDownloader( _syncReport = syncReport ?? throw new ArgumentNullException(nameof(syncReport)); _receiptStorage = receiptStorage ?? throw new ArgumentNullException(nameof(receiptStorage)); _beaconPivot = beaconPivot; - _receiptsRecovery = new ReceiptsRecovery(new EthereumEcdsa(specProvider.ChainId, logManager), specProvider); + _receiptsRecovery = new ReceiptsRecovery(new EthereumEcdsa(specProvider.ChainId), specProvider); _fullStateFinder = fullStateFinder ?? throw new ArgumentNullException(nameof(fullStateFinder)); _logger = logManager.GetClassLogger(); } diff --git a/src/Nethermind/Nethermind.Mev.Test/MevMegabundleTests.cs b/src/Nethermind/Nethermind.Mev.Test/MevMegabundleTests.cs index a2992904998..f014b39d0c0 100644 --- a/src/Nethermind/Nethermind.Mev.Test/MevMegabundleTests.cs +++ b/src/Nethermind/Nethermind.Mev.Test/MevMegabundleTests.cs @@ -27,7 +27,7 @@ BundleTransaction BuildTransaction(PrivateKey sender, bool canRevert = false) return tx; } - EthereumEcdsa ecdsa = new(BlockchainIds.Mainnet, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Mainnet); BundleTransaction tx = BuildTransaction(TestItem.PrivateKeyB); BundleTransaction revertingTx = BuildTransaction(TestItem.PrivateKeyA, true); diff --git a/src/Nethermind/Nethermind.Network.Benchmark/Eth62ProtocolHandlerBenchmarks.cs b/src/Nethermind/Nethermind.Network.Benchmark/Eth62ProtocolHandlerBenchmarks.cs index 0f8bae8edc8..5700d30de35 100644 --- a/src/Nethermind/Nethermind.Network.Benchmark/Eth62ProtocolHandlerBenchmarks.cs +++ b/src/Nethermind/Nethermind.Network.Benchmark/Eth62ProtocolHandlerBenchmarks.cs @@ -51,7 +51,7 @@ public void SetUp() _ser.Register(new TransactionsMessageSerializer()); _ser.Register(new StatusMessageSerializer()); NodeStatsManager stats = new NodeStatsManager(TimerFactory.Default, LimboLogs.Instance); - var ecdsa = new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance); + var ecdsa = new EthereumEcdsa(TestBlockchainIds.ChainId); var tree = Build.A.BlockTree().TestObject; var stateProvider = new WorldState(new TrieStore(new MemDb(), LimboLogs.Instance), new MemDb(), LimboLogs.Instance); var specProvider = MainnetSpecProvider.Instance; diff --git a/src/Nethermind/Nethermind.Network.Benchmark/HandshakeBenchmarks.cs b/src/Nethermind/Nethermind.Network.Benchmark/HandshakeBenchmarks.cs index f41aba98baa..8b7c6d6f942 100644 --- a/src/Nethermind/Nethermind.Network.Benchmark/HandshakeBenchmarks.cs +++ b/src/Nethermind/Nethermind.Network.Benchmark/HandshakeBenchmarks.cs @@ -76,7 +76,7 @@ public void Dispose() } } - private readonly IEthereumEcdsa _ecdsa = new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance); // TODO: separate general crypto signer from Ethereum transaction signing + private readonly IEthereumEcdsa _ecdsa = new EthereumEcdsa(BlockchainIds.Sepolia); // TODO: separate general crypto signer from Ethereum transaction signing private IMessageSerializationService _messageSerializationService; diff --git a/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/BlockBodiesMessageSerializerTests.cs b/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/BlockBodiesMessageSerializerTests.cs index c011f42da5f..338ae5d04b5 100644 --- a/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/BlockBodiesMessageSerializerTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/BlockBodiesMessageSerializerTests.cs @@ -47,7 +47,7 @@ private static IEnumerable GetBlockBodyValues() BlockHeader header = Build.A.BlockHeader.TestObject; Transaction tx = Build.A.Transaction .WithTo(TestItem.AddressA) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject; tx.SenderAddress = null; @@ -79,21 +79,21 @@ private static IEnumerable GetBlockBodyValues() .WithChainId(TestBlockchainIds.ChainId) .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(1) - .SignedAndResolved(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), + .SignedAndResolved(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithChainId(TestBlockchainIds.ChainId) .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(2) - .SignedAndResolved(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), + .SignedAndResolved(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithChainId(TestBlockchainIds.ChainId) .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(3, false) - .SignedAndResolved(new EthereumEcdsa(TestBlockchainIds.ChainId, LimboLogs.Instance), + .SignedAndResolved(new EthereumEcdsa(TestBlockchainIds.ChainId), TestItem.PrivateKeyA) .TestObject, }, new[] { header }, diff --git a/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/TransactionsMessageSerializerTests.cs b/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/TransactionsMessageSerializerTests.cs index 1003b9d29e3..a2c9071df99 100644 --- a/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/TransactionsMessageSerializerTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V62/TransactionsMessageSerializerTests.cs @@ -121,7 +121,7 @@ public static IEnumerable> GetTransactions() { Build.A.Transaction .WithTo(TestItem.AddressA) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject }; @@ -130,36 +130,36 @@ public static IEnumerable> GetTransactions() Build.A.Transaction .WithType(TxType.Legacy) .WithTo(TestItem.AddressA) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(1) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithType(TxType.AccessList) .WithTo(TestItem.AddressA) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(2) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithType(TxType.EIP1559) .WithTo(TestItem.AddressA) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(3) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithType(TxType.EIP1559) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, }; @@ -169,12 +169,12 @@ public static IEnumerable> GetTransactions() Build.A.Transaction .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(1) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject, Build.A.Transaction .WithTo(TestItem.AddressA) .WithShardBlobTxTypeAndFields(2) - .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance), TestItem.PrivateKeyA) + .SignedAndResolved(new EthereumEcdsa(BlockchainIds.Sepolia), TestItem.PrivateKeyA) .TestObject }; } diff --git a/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V66/Eth66ProtocolHandlerTests.cs b/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V66/Eth66ProtocolHandlerTests.cs index d46fe53acef..3e933943923 100644 --- a/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V66/Eth66ProtocolHandlerTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/P2P/Subprotocols/Eth/V66/Eth66ProtocolHandlerTests.cs @@ -207,7 +207,7 @@ public void Can_handle_get_pooled_transactions() [Test] public void Can_handle_pooled_transactions() { - Transaction tx = Build.A.Transaction.Signed(new EthereumEcdsa(1, LimboLogs.Instance), TestItem.PrivateKeyA).TestObject; + Transaction tx = Build.A.Transaction.Signed(new EthereumEcdsa(1), TestItem.PrivateKeyA).TestObject; var msg65 = new PooledTransactionsMessage(new ArrayPoolList(1) { tx }); var msg66 = new Network.P2P.Subprotocols.Eth.V66.Messages.PooledTransactionsMessage(1111, msg65); diff --git a/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthEip8MessageSerializerTests.cs b/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthEip8MessageSerializerTests.cs index 7d155359e69..d4a6eeab330 100644 --- a/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthEip8MessageSerializerTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthEip8MessageSerializerTests.cs @@ -50,7 +50,7 @@ private void TestEncodeDecode(IEthereumEcdsa ecdsa) [TestCase(BlockchainIds.EthereumClassicTestnet)] public void Encode_decode_before_eip155(int chainId) { - EthereumEcdsa ecdsa = new(BlockchainIds.Olympic, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Olympic); TestEncodeDecode(ecdsa); } @@ -58,7 +58,7 @@ public void Encode_decode_before_eip155(int chainId) [TestCase(BlockchainIds.Sepolia)] public void Encode_decode_with_eip155(int chainId) { - EthereumEcdsa ecdsa = new(BlockchainIds.Olympic, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Olympic); TestEncodeDecode(ecdsa); } diff --git a/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthMessageSerializerTests.cs b/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthMessageSerializerTests.cs index 3b6626bb38c..fac56e55d35 100644 --- a/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthMessageSerializerTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/AuthMessageSerializerTests.cs @@ -52,7 +52,7 @@ private void TestEncodeDecode(IEthereumEcdsa ecdsa) [TestCase(BlockchainIds.EthereumClassicTestnet)] public void Encode_decode_before_eip155(int chainId) { - EthereumEcdsa ecdsa = new(BlockchainIds.Olympic, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Olympic); TestEncodeDecode(ecdsa); } @@ -60,7 +60,7 @@ public void Encode_decode_before_eip155(int chainId) [TestCase(BlockchainIds.Sepolia)] public void Encode_decode_with_eip155(int chainId) { - EthereumEcdsa ecdsa = new(BlockchainIds.Olympic, LimboLogs.Instance); + EthereumEcdsa ecdsa = new(BlockchainIds.Olympic); TestEncodeDecode(ecdsa); } } diff --git a/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/EncryptionHandshakeServiceTests.cs b/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/EncryptionHandshakeServiceTests.cs index 1876ed8d3a1..566387af20f 100644 --- a/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/EncryptionHandshakeServiceTests.cs +++ b/src/Nethermind/Nethermind.Network.Test/Rlpx/Handshake/EncryptionHandshakeServiceTests.cs @@ -48,7 +48,7 @@ public void TearDown() _trueCryptoRandom?.Dispose(); } - private readonly IEthereumEcdsa _ecdsa = new EthereumEcdsa(BlockchainIds.Sepolia, LimboLogs.Instance); // TODO: separate general crypto signer from Ethereum transaction signing + private readonly IEthereumEcdsa _ecdsa = new EthereumEcdsa(BlockchainIds.Sepolia); // TODO: separate general crypto signer from Ethereum transaction signing private IMessageSerializationService _messageSerializationService; diff --git a/src/Nethermind/Nethermind.Synchronization.Test/SyncThreadTests.cs b/src/Nethermind/Nethermind.Synchronization.Test/SyncThreadTests.cs index c41fc74bbe2..602cada00c3 100644 --- a/src/Nethermind/Nethermind.Synchronization.Test/SyncThreadTests.cs +++ b/src/Nethermind/Nethermind.Synchronization.Test/SyncThreadTests.cs @@ -263,7 +263,7 @@ private SyncTestContext CreateSyncManager(int index) InMemoryReceiptStorage receiptStorage = new(); - EthereumEcdsa ecdsa = new(specProvider.ChainId, logManager); + EthereumEcdsa ecdsa = new(specProvider.ChainId); BlockTree tree = Build.A.BlockTree().WithoutSettingHead.TestObject; ITransactionComparerProvider transactionComparerProvider = new TransactionComparerProvider(specProvider, tree); diff --git a/src/Nethermind/Nethermind.Synchronization/Blocks/BlockDownloader.cs b/src/Nethermind/Nethermind.Synchronization/Blocks/BlockDownloader.cs index f2344bb8488..765c0f7e7a4 100644 --- a/src/Nethermind/Nethermind.Synchronization/Blocks/BlockDownloader.cs +++ b/src/Nethermind/Nethermind.Synchronization/Blocks/BlockDownloader.cs @@ -79,7 +79,7 @@ public BlockDownloader( _betterPeerStrategy = betterPeerStrategy ?? throw new ArgumentNullException(nameof(betterPeerStrategy)); _logger = logManager?.GetClassLogger() ?? throw new ArgumentNullException(nameof(logManager)); - _receiptsRecovery = new ReceiptsRecovery(new EthereumEcdsa(_specProvider.ChainId, logManager), _specProvider); + _receiptsRecovery = new ReceiptsRecovery(new EthereumEcdsa(_specProvider.ChainId), _specProvider); _syncBatchSize = syncBatchSize ?? new SyncBatchSize(logManager); _blockTree.NewHeadBlock += BlockTreeOnNewHeadBlock; } diff --git a/src/Nethermind/Nethermind.TxPool.Test/ReceiptStorageTests.cs b/src/Nethermind/Nethermind.TxPool.Test/ReceiptStorageTests.cs index 51fd3449f06..634ca9a9c46 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/ReceiptStorageTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/ReceiptStorageTests.cs @@ -40,7 +40,7 @@ public ReceiptStorageTests(bool useEip2718) public void Setup() { _specProvider = MainnetSpecProvider.Instance; - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, LimboLogs.Instance); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); _blockTree = Build.A.BlockTree() .WithBlocks(Build.A.Block.TestObject) .TestObject; diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs index 6cd66531054..1a6db97812a 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs @@ -56,7 +56,7 @@ public void Setup() { _logManager = LimboLogs.Instance; _specProvider = MainnetSpecProvider.Instance; - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, _logManager); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); _blockTree = Substitute.For(); _comparer = new TransactionComparerProvider(_specProvider, _blockTree).GetDefaultComparer(); _txPoolConfig = new TxPoolConfig(); diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index a6a96c029a2..2510d106826 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -51,7 +51,7 @@ public void Setup() { _logManager = LimboLogs.Instance; _specProvider = MainnetSpecProvider.Instance; - _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId, _logManager); + _ethereumEcdsa = new EthereumEcdsa(_specProvider.ChainId); var trieStore = new TrieStore(new MemDb(), _logManager); var codeDb = new MemDb(); _stateProvider = new WorldState(trieStore, codeDb, _logManager); @@ -96,7 +96,7 @@ public void should_delete_peers() public void should_ignore_transactions_with_different_chain_id() { _txPool = CreatePool(null, new TestSpecProvider(Shanghai.Instance)); - EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia, _logManager); // default is mainnet, we're passing sepolia + EthereumEcdsa ecdsa = new(BlockchainIds.Sepolia); // default is mainnet, we're passing sepolia Transaction tx = Build.A.Transaction.SignedAndResolved(ecdsa, TestItem.PrivateKeyA).TestObject; AcceptTxResult result = _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast); _txPool.GetPendingTransactionsCount().Should().Be(0); diff --git a/src/Nethermind/Nethermind.Wallet.Test/WalletTests.cs b/src/Nethermind/Nethermind.Wallet.Test/WalletTests.cs index 35bfc3eedb3..a39be4e3011 100644 --- a/src/Nethermind/Nethermind.Wallet.Test/WalletTests.cs +++ b/src/Nethermind/Nethermind.Wallet.Test/WalletTests.cs @@ -136,7 +136,7 @@ public void Each_account_can_sign_with_simple_key([ValueSource(nameof(WalletType [Test] public void Can_sign_on_networks_with_chain_id([ValueSource(nameof(WalletTypes))] WalletType walletType, [Values(0ul, 1ul, 40000ul, ulong.MaxValue / 3)] ulong chainId) { - EthereumEcdsa ecdsa = new EthereumEcdsa(chainId, LimboLogs.Instance); + EthereumEcdsa ecdsa = new EthereumEcdsa(chainId); Context ctx = _cachedWallets[walletType]; for (int i = 1; i <= (walletType == WalletType.Memory ? 10 : 3); i++) {