From ca922d96c9bd8fba6ede887f3b2861e4367c9f7a Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 1 Apr 2024 16:39:11 -0700 Subject: [PATCH 01/21] update tx response for persistent broadcast --- src/Nethermind/Nethermind.TxPool/TxPool.cs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxPool.cs b/src/Nethermind/Nethermind.TxPool/TxPool.cs index 7841ea39993..1540339e854 100644 --- a/src/Nethermind/Nethermind.TxPool/TxPool.cs +++ b/src/Nethermind/Nethermind.TxPool/TxPool.cs @@ -450,14 +450,13 @@ private AcceptTxResult AddCore(Transaction tx, TxFilteringState state, bool isPe if (tx.Hash == removed?.Hash) { // it means it was added and immediately evicted - pool was full of better txs - if (isPersistentBroadcast) + if (!isPersistentBroadcast || tx.SupportsBlobs) { - // we are adding only to persistent broadcast - not good enough for standard pool, - // but can be good enough for TxBroadcaster pool - for local txs only - _broadcaster.Broadcast(tx, isPersistentBroadcast); + Metrics.PendingTransactionsPassedFiltersButCannotCompeteOnFees++; + return AcceptTxResult.FeeTooLowToCompete; } - Metrics.PendingTransactionsPassedFiltersButCannotCompeteOnFees++; - return AcceptTxResult.FeeTooLowToCompete; + // we are adding only to persistent broadcast - not good enough for standard pool, + // but can be good enough for TxBroadcaster pool - for local txs only } relevantPool.UpdateGroup(tx.SenderAddress!, state.SenderAccount, UpdateBucketWithAddedTransaction); From 1e4670afe0cbc26f9643b44098372f548048bc11 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 1 Apr 2024 16:59:53 -0700 Subject: [PATCH 02/21] added own test --- .../Nethermind.TxPool.Test/TxPoolTests.cs | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index e2555cd1bd1..a7104562c33 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -508,6 +508,40 @@ public void should_add_underpaid_txs_to_full_TxPool_only_if_local(bool isLocal) result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.FeeTooLowToCompete) : nameof(AcceptTxResult.FeeTooLow)); } + [TestCase(true)] + [TestCase(false)] + public void should_accept_underpaid_txs_if_persistent(bool isPersistentBroadcast) { + // copy and past of the code above for my test use. + TxHandlingOptions txHandlingOptions = isPersistentBroadcast ? TxHandlingOptions.PersistentBroadcast : TxHandlingOptions.None; + + _txPool = CreatePool(new TxPoolConfig() { Size = 1 }); + + Transaction[] transactions = GetTransactions(GetPeers(3), true, false); + + foreach (Address address in transactions.Select(t => t.SenderAddress).Distinct()) + { + EnsureSenderBalance(address, UInt256.MaxValue); + } + + foreach (Transaction transaction in transactions) + { + transaction.GasPrice = 10; + _txPool.SubmitTx(transaction, TxHandlingOptions.None); + } + + Transaction tx = Build.A.Transaction + .WithGasPrice(UInt256.Zero) + .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA) + .TestObject; + EnsureSenderBalance(tx.SenderAddress, UInt256.MaxValue); + _txPool.GetPendingTransactionsCount().Should().Be(1); + _txPool.GetOwnPendingTransactions().Length.Should().Be(0); + AcceptTxResult result = _txPool.SubmitTx(tx, txHandlingOptions); + _txPool.GetPendingTransactionsCount().Should().Be(1); + _txPool.GetOwnPendingTransactions().Length.Should().Be(isPersistentBroadcast ? 1 : 0); + result.ToString().Should().Contain(isPersistentBroadcast ? nameof(AcceptTxResult.Accepted) : nameof(AcceptTxResult.FeeTooLow)); + } + [TestCase(0)] [TestCase(1)] [TestCase(2)] From 401e3181b9f1ffe964b45f22fa19a5ad7a2ef392 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 1 Apr 2024 17:05:21 -0700 Subject: [PATCH 03/21] Fix TxPool test cases to expect result according to the changes made --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index a7104562c33..fdd52b5bfc6 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -505,7 +505,7 @@ public void should_add_underpaid_txs_to_full_TxPool_only_if_local(bool isLocal) AcceptTxResult result = _txPool.SubmitTx(tx, txHandlingOptions); _txPool.GetPendingTransactionsCount().Should().Be(30); _txPool.GetOwnPendingTransactions().Length.Should().Be(isLocal ? 1 : 0); - result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.FeeTooLowToCompete) : nameof(AcceptTxResult.FeeTooLow)); + result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.Accepted) : nameof(AcceptTxResult.FeeTooLow)); } [TestCase(true)] @@ -1415,7 +1415,7 @@ public void should_increase_nonce_when_transaction_not_included_in_txPool_but_br .WithMaxFeePerGas(1) .WithMaxPriorityFeePerGas(1) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; - _txPool.SubmitTx(cheapTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); + _txPool.SubmitTx(cheapTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); _txPool.GetPendingTransactions().Should().NotContain(cheapTx); _txPool.GetOwnPendingTransactions().Should().Contain(cheapTx); peer.Received().SendNewTransaction(cheapTx); @@ -1427,7 +1427,7 @@ public void should_increase_nonce_when_transaction_not_included_in_txPool_but_br .WithMaxFeePerGas(1) .WithMaxPriorityFeePerGas(1) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; - _txPool.SubmitTx(fourthTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); + _txPool.SubmitTx(fourthTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); _txPool.GetPendingTransactions().Should().NotContain(fourthTx); _txPool.GetOwnPendingTransactions().Should().Contain(fourthTx); peer.Received().SendNewTransaction(fourthTx); @@ -1564,7 +1564,7 @@ public void Should_not_replace_better_txs_by_worse_ones() .SignedAndResolved(_ethereumEcdsa, privateKeyOfAttacker).TestObject; AcceptTxResult result = _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast); - result.Should().Be(AcceptTxResult.FeeTooLowToCompete); + result.Should().Be(AcceptTxResult.Accepted); // newly coming txs should evict themselves _txPool.GetPendingTransactionsBySender().Keys.Count.Should().Be(txPoolConfig.Size); @@ -1616,7 +1616,7 @@ public void Should_not_replace_ready_txs_by_nonce_gap_ones() .WithGasPrice(1000) .SignedAndResolved(_ethereumEcdsa, privateKeyOfAttacker).TestObject; - _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); + _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); // newly coming txs should evict themselves _txPool.GetPendingTransactionsBySender().Keys.Count.Should().Be(txPoolConfig.Size); @@ -1625,7 +1625,7 @@ public void Should_not_replace_ready_txs_by_nonce_gap_ones() _txPool.GetPendingTransactionsCount().Should().Be(txPoolConfig.Size); } - [TestCase(9, false)] + [TestCase(9, true)] [TestCase(11, true)] public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int gasPrice, bool expectedResult) { From 13a767a5797b9bb7ca8a99209f4b5dacbca7edb4 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Tue, 2 Apr 2024 16:51:46 -0700 Subject: [PATCH 04/21] update: persistent tx with low fees broadcasts and returns accepted --- src/Nethermind/Nethermind.TxPool/TxPool.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxPool.cs b/src/Nethermind/Nethermind.TxPool/TxPool.cs index 1540339e854..da87ee2108c 100644 --- a/src/Nethermind/Nethermind.TxPool/TxPool.cs +++ b/src/Nethermind/Nethermind.TxPool/TxPool.cs @@ -450,13 +450,15 @@ private AcceptTxResult AddCore(Transaction tx, TxFilteringState state, bool isPe if (tx.Hash == removed?.Hash) { // it means it was added and immediately evicted - pool was full of better txs - if (!isPersistentBroadcast || tx.SupportsBlobs) - { + if (isPersistentBroadcast) { + // we are adding only to persistent broadcast - not good enough for standard pool, + // but can be good enough for TxBroadcaster pool - for local txs only + _broadcaster.Broadcast(tx, isPersistentBroadcast); + return AcceptTxResult.Accepted; + } else { Metrics.PendingTransactionsPassedFiltersButCannotCompeteOnFees++; return AcceptTxResult.FeeTooLowToCompete; } - // we are adding only to persistent broadcast - not good enough for standard pool, - // but can be good enough for TxBroadcaster pool - for local txs only } relevantPool.UpdateGroup(tx.SenderAddress!, state.SenderAccount, UpdateBucketWithAddedTransaction); From 919bd2d8042902ee6c1c78028b1db4720398f883 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Fri, 5 Apr 2024 18:04:13 -0700 Subject: [PATCH 05/21] revert test changes --- .../Nethermind.TxPool.Test/TxPoolTests.cs | 46 +++---------------- 1 file changed, 6 insertions(+), 40 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index fdd52b5bfc6..e2555cd1bd1 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -505,41 +505,7 @@ public void should_add_underpaid_txs_to_full_TxPool_only_if_local(bool isLocal) AcceptTxResult result = _txPool.SubmitTx(tx, txHandlingOptions); _txPool.GetPendingTransactionsCount().Should().Be(30); _txPool.GetOwnPendingTransactions().Length.Should().Be(isLocal ? 1 : 0); - result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.Accepted) : nameof(AcceptTxResult.FeeTooLow)); - } - - [TestCase(true)] - [TestCase(false)] - public void should_accept_underpaid_txs_if_persistent(bool isPersistentBroadcast) { - // copy and past of the code above for my test use. - TxHandlingOptions txHandlingOptions = isPersistentBroadcast ? TxHandlingOptions.PersistentBroadcast : TxHandlingOptions.None; - - _txPool = CreatePool(new TxPoolConfig() { Size = 1 }); - - Transaction[] transactions = GetTransactions(GetPeers(3), true, false); - - foreach (Address address in transactions.Select(t => t.SenderAddress).Distinct()) - { - EnsureSenderBalance(address, UInt256.MaxValue); - } - - foreach (Transaction transaction in transactions) - { - transaction.GasPrice = 10; - _txPool.SubmitTx(transaction, TxHandlingOptions.None); - } - - Transaction tx = Build.A.Transaction - .WithGasPrice(UInt256.Zero) - .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA) - .TestObject; - EnsureSenderBalance(tx.SenderAddress, UInt256.MaxValue); - _txPool.GetPendingTransactionsCount().Should().Be(1); - _txPool.GetOwnPendingTransactions().Length.Should().Be(0); - AcceptTxResult result = _txPool.SubmitTx(tx, txHandlingOptions); - _txPool.GetPendingTransactionsCount().Should().Be(1); - _txPool.GetOwnPendingTransactions().Length.Should().Be(isPersistentBroadcast ? 1 : 0); - result.ToString().Should().Contain(isPersistentBroadcast ? nameof(AcceptTxResult.Accepted) : nameof(AcceptTxResult.FeeTooLow)); + result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.FeeTooLowToCompete) : nameof(AcceptTxResult.FeeTooLow)); } [TestCase(0)] @@ -1415,7 +1381,7 @@ public void should_increase_nonce_when_transaction_not_included_in_txPool_but_br .WithMaxFeePerGas(1) .WithMaxPriorityFeePerGas(1) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; - _txPool.SubmitTx(cheapTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); + _txPool.SubmitTx(cheapTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); _txPool.GetPendingTransactions().Should().NotContain(cheapTx); _txPool.GetOwnPendingTransactions().Should().Contain(cheapTx); peer.Received().SendNewTransaction(cheapTx); @@ -1427,7 +1393,7 @@ public void should_increase_nonce_when_transaction_not_included_in_txPool_but_br .WithMaxFeePerGas(1) .WithMaxPriorityFeePerGas(1) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; - _txPool.SubmitTx(fourthTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); + _txPool.SubmitTx(fourthTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); _txPool.GetPendingTransactions().Should().NotContain(fourthTx); _txPool.GetOwnPendingTransactions().Should().Contain(fourthTx); peer.Received().SendNewTransaction(fourthTx); @@ -1564,7 +1530,7 @@ public void Should_not_replace_better_txs_by_worse_ones() .SignedAndResolved(_ethereumEcdsa, privateKeyOfAttacker).TestObject; AcceptTxResult result = _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast); - result.Should().Be(AcceptTxResult.Accepted); + result.Should().Be(AcceptTxResult.FeeTooLowToCompete); // newly coming txs should evict themselves _txPool.GetPendingTransactionsBySender().Keys.Count.Should().Be(txPoolConfig.Size); @@ -1616,7 +1582,7 @@ public void Should_not_replace_ready_txs_by_nonce_gap_ones() .WithGasPrice(1000) .SignedAndResolved(_ethereumEcdsa, privateKeyOfAttacker).TestObject; - _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); + _txPool.SubmitTx(tx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); // newly coming txs should evict themselves _txPool.GetPendingTransactionsBySender().Keys.Count.Should().Be(txPoolConfig.Size); @@ -1625,7 +1591,7 @@ public void Should_not_replace_ready_txs_by_nonce_gap_ones() _txPool.GetPendingTransactionsCount().Should().Be(txPoolConfig.Size); } - [TestCase(9, true)] + [TestCase(9, false)] [TestCase(11, true)] public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int gasPrice, bool expectedResult) { From 14e8b791f8deb50564beddebdf12d9d10df116c2 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 8 Apr 2024 23:57:39 -0700 Subject: [PATCH 06/21] update broadcaster and underpaid tx broadcast logic --- .../Nethermind.TxPool/TxBroadcaster.cs | 26 +++++++++++-------- src/Nethermind/Nethermind.TxPool/TxPool.cs | 8 +++--- 2 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs index 1505b21e9fb..447aea648e5 100644 --- a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs +++ b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs @@ -97,31 +97,35 @@ internal class TxBroadcaster : IDisposable // only for testing reasons internal Transaction[] GetSnapshot() => _persistentTxs.GetSnapshot(); - public void Broadcast(Transaction tx, bool isPersistent) + public bool Broadcast(Transaction tx, bool isPersistent) { if (isPersistent) { - StartBroadcast(tx); - } - else - { - BroadcastOnce(tx); + return StartBroadcast(tx); } + + BroadcastOnce(tx); + + return true; } - private void StartBroadcast(Transaction tx) + private bool StartBroadcast(Transaction tx) { + if (tx is null) return false; + + bool txInserted = _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx); + + if (!txInserted) return false; + // broadcast local tx only if MaxFeePerGas is not lower than configurable percent of current base fee // (70% by default). Otherwise only add to persistent txs and broadcast when tx will be ready for inclusion if (tx.MaxFeePerGas >= _baseFeeThreshold || tx.IsFree()) { NotifyPeersAboutLocalTx(tx); + return true; } - if (tx.Hash is not null) - { - _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx); - } + return false; } private void BroadcastOnce(Transaction tx) diff --git a/src/Nethermind/Nethermind.TxPool/TxPool.cs b/src/Nethermind/Nethermind.TxPool/TxPool.cs index da87ee2108c..54f457f2747 100644 --- a/src/Nethermind/Nethermind.TxPool/TxPool.cs +++ b/src/Nethermind/Nethermind.TxPool/TxPool.cs @@ -450,14 +450,14 @@ private AcceptTxResult AddCore(Transaction tx, TxFilteringState state, bool isPe if (tx.Hash == removed?.Hash) { // it means it was added and immediately evicted - pool was full of better txs - if (isPersistentBroadcast) { + if (!isPersistentBroadcast || tx.SupportsBlobs || !_broadcaster.Broadcast(tx, true)) + { // we are adding only to persistent broadcast - not good enough for standard pool, // but can be good enough for TxBroadcaster pool - for local txs only - _broadcaster.Broadcast(tx, isPersistentBroadcast); - return AcceptTxResult.Accepted; - } else { Metrics.PendingTransactionsPassedFiltersButCannotCompeteOnFees++; return AcceptTxResult.FeeTooLowToCompete; + } else { + return AcceptTxResult.Accepted; } } From 7936a1ed82c67f430faddbce8af20b6c908635bb Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Tue, 9 Apr 2024 21:03:27 -0700 Subject: [PATCH 07/21] TxBroadcaster code refactor --- src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs index 447aea648e5..1391874f9d0 100644 --- a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs +++ b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs @@ -111,15 +111,11 @@ public bool Broadcast(Transaction tx, bool isPersistent) private bool StartBroadcast(Transaction tx) { - if (tx is null) return false; - - bool txInserted = _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx); - - if (!txInserted) return false; - // broadcast local tx only if MaxFeePerGas is not lower than configurable percent of current base fee // (70% by default). Otherwise only add to persistent txs and broadcast when tx will be ready for inclusion - if (tx.MaxFeePerGas >= _baseFeeThreshold || tx.IsFree()) + if (tx is not null + && _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx) + && (tx.MaxFeePerGas >= _baseFeeThreshold || tx.IsFree())) { NotifyPeersAboutLocalTx(tx); return true; From ca67a97bc549e9fc34cfe43d9b46f2cc7b1d1574 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Tue, 9 Apr 2024 21:04:51 -0700 Subject: [PATCH 08/21] TxPoolTest update should_add_underpaid_txs_to_full_TxPool_only_if_local(True) should expect AcceptTxResult.Accepted for underpaid persistent transactions that were broadcasted --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index e2555cd1bd1..f893aeb3103 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -505,7 +505,7 @@ public void should_add_underpaid_txs_to_full_TxPool_only_if_local(bool isLocal) AcceptTxResult result = _txPool.SubmitTx(tx, txHandlingOptions); _txPool.GetPendingTransactionsCount().Should().Be(30); _txPool.GetOwnPendingTransactions().Length.Should().Be(isLocal ? 1 : 0); - result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.FeeTooLowToCompete) : nameof(AcceptTxResult.FeeTooLow)); + result.ToString().Should().Contain(isLocal ? nameof(AcceptTxResult.Accepted) : nameof(AcceptTxResult.FeeTooLow)); } [TestCase(0)] From 6d0a22c7fe1f583fcd0a85b107d008f56b80c76b Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Tue, 9 Apr 2024 21:17:28 -0700 Subject: [PATCH 09/21] TxPoolTest update should_increase_nonce_when_transaction_not_included_in_txPool_but_broadcasted should expect AcceptTxResult.Accepted for underpaid persistent transactions that were broadcasted --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index f893aeb3103..f0513bc991b 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -1381,7 +1381,7 @@ public void should_increase_nonce_when_transaction_not_included_in_txPool_but_br .WithMaxFeePerGas(1) .WithMaxPriorityFeePerGas(1) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; - _txPool.SubmitTx(cheapTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); + _txPool.SubmitTx(cheapTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); _txPool.GetPendingTransactions().Should().NotContain(cheapTx); _txPool.GetOwnPendingTransactions().Should().Contain(cheapTx); peer.Received().SendNewTransaction(cheapTx); @@ -1393,7 +1393,7 @@ public void should_increase_nonce_when_transaction_not_included_in_txPool_but_br .WithMaxFeePerGas(1) .WithMaxPriorityFeePerGas(1) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; - _txPool.SubmitTx(fourthTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLowToCompete); + _txPool.SubmitTx(fourthTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); _txPool.GetPendingTransactions().Should().NotContain(fourthTx); _txPool.GetOwnPendingTransactions().Should().Contain(fourthTx); peer.Received().SendNewTransaction(fourthTx); From 7dfbdb63cf73bd2385c72ff1df207381280d4b0c Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Fri, 12 Apr 2024 11:58:57 -0700 Subject: [PATCH 10/21] fix white space formatting --- src/Nethermind/Nethermind.TxPool/TxPool.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxPool.cs b/src/Nethermind/Nethermind.TxPool/TxPool.cs index 54f457f2747..538e95b1588 100644 --- a/src/Nethermind/Nethermind.TxPool/TxPool.cs +++ b/src/Nethermind/Nethermind.TxPool/TxPool.cs @@ -456,7 +456,9 @@ private AcceptTxResult AddCore(Transaction tx, TxFilteringState state, bool isPe // but can be good enough for TxBroadcaster pool - for local txs only Metrics.PendingTransactionsPassedFiltersButCannotCompeteOnFees++; return AcceptTxResult.FeeTooLowToCompete; - } else { + } + else + { return AcceptTxResult.Accepted; } } From 4757f6f289b8d78d0e1db551a09e32fc63ddeb72 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Fri, 12 Apr 2024 12:05:40 -0700 Subject: [PATCH 11/21] fix startBroadcast check if persistentTx added to the local broadcasting pool is immediately removed or not --- src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs index 1391874f9d0..f0416b036a1 100644 --- a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs +++ b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs @@ -113,9 +113,11 @@ private bool StartBroadcast(Transaction tx) { // broadcast local tx only if MaxFeePerGas is not lower than configurable percent of current base fee // (70% by default). Otherwise only add to persistent txs and broadcast when tx will be ready for inclusion + if (tx is not null - && _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx) - && (tx.MaxFeePerGas >= _baseFeeThreshold || tx.IsFree())) + && _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx, out Transaction? removed) + && (tx.MaxFeePerGas >= _baseFeeThreshold || tx.IsFree()) + && removed?.Hash != tx.Hash) { NotifyPeersAboutLocalTx(tx); return true; From 018afc9e4ff9c71862363d8e4bd9c311781b5745 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Fri, 12 Apr 2024 13:26:02 -0700 Subject: [PATCH 12/21] fix StartBroadcast check fee before inserting tx to the local pool --- src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs index f0416b036a1..de7eb80c9d0 100644 --- a/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs +++ b/src/Nethermind/Nethermind.TxPool/TxBroadcaster.cs @@ -115,8 +115,8 @@ private bool StartBroadcast(Transaction tx) // (70% by default). Otherwise only add to persistent txs and broadcast when tx will be ready for inclusion if (tx is not null - && _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx, out Transaction? removed) && (tx.MaxFeePerGas >= _baseFeeThreshold || tx.IsFree()) + && _persistentTxs.TryInsert(tx.Hash, tx.SupportsBlobs ? new LightTransaction(tx) : tx, out Transaction? removed) && removed?.Hash != tx.Hash) { NotifyPeersAboutLocalTx(tx); From be126f52f6321a4586b9c989adc0e0064625066a Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Fri, 12 Apr 2024 14:09:35 -0700 Subject: [PATCH 13/21] TxPoolTest update should_not_broadcast_tx_with_MaxFeePerGas_lower_than_70_percent_of_CurrentBaseFee should not expect tx to be added to local pool when lower than 70% of current base fee --- src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs index c8cd8e1b4af..6cd66531054 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxBroadcasterTests.cs @@ -361,8 +361,8 @@ public void should_not_broadcast_tx_with_MaxFeePerGas_lower_than_70_percent_of_C // tx should be immediately broadcasted only if MaxFeePerGas is equal at least 70% of current base fee peer.Received(shouldBroadcast ? 1 : 0).SendNewTransaction(Arg.Any()); - // tx should always be added to persistent collection, without any fee restrictions - _broadcaster.GetSnapshot().Length.Should().Be(1); + // tx should only be added to persistent collection, if it is above the fee restriction + _broadcaster.GetSnapshot().Length.Should().Be(shouldBroadcast ? 1 : 0); } [Test] From b64dd506153aa78f6536c7343c91699aa79967bb Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Fri, 12 Apr 2024 21:25:20 -0700 Subject: [PATCH 14/21] add test to test the updated broadcaster/txpool functionality --- .../Nethermind.TxPool.Test/TxPoolTests.cs | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index f0513bc991b..b1087fb6582 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -1638,6 +1638,76 @@ public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int g result.Should().Be(expectedResult ? AcceptTxResult.Accepted : AcceptTxResult.FeeTooLowToCompete); } + [TestCase] + public void Should_only_add_legacy_and_1559_local_transactions_to_local_pool_when_underpaid() + { + ISpecProvider specProvider = GetLondonSpecProvider(); + TxPoolConfig txPoolConfig = new TxPoolConfig { Size = 30 }; + _txPool = CreatePool(txPoolConfig, specProvider); + + Transaction[] transactions = GetTransactions(GetPeers(3), true, false); + + foreach (Address address in transactions.Select(t => t.SenderAddress).Distinct()) + { + EnsureSenderBalance(address, UInt256.MaxValue); + } + + foreach (Transaction transaction in transactions) + { + transaction.GasPrice = 10.GWei(); + _txPool.SubmitTx(transaction, TxHandlingOptions.None); + } + + _txPool.GetPendingTransactionsCount().Should().Be(30); + + + // send legacy tx (gasPrice 9 gwei) + Transaction firstTx = Build.A.Transaction + .WithNonce(0) + .WithValue(0) + .WithType(TxType.Legacy) + .WithGasPrice(9.GWei()) + .WithTo(TestItem.AddressD) + .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; + + EnsureSenderBalance(TestItem.PrivateKeyA.Address, UInt256.MaxValue); + _txPool.SubmitTx(firstTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); + _txPool.GetOwnPendingTransactions().Length.Should().Be(1); + _txPool.GetPendingTransactions().Should().NotContain(firstTx); + + + + // send eip1559 tx (gasPrice 9 gwei) + Transaction secondTx = Build.A.Transaction + .WithNonce(0) + .WithValue(0) + .WithType(TxType.EIP1559) + .WithTo(TestItem.AddressD) + .WithMaxFeePerGas(9.GWei()) + .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyB).TestObject; + + EnsureSenderBalance(TestItem.PrivateKeyB.Address, UInt256.MaxValue); + _txPool.SubmitTx(secondTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); + _txPool.GetOwnPendingTransactions().Length.Should().Be(2); + _txPool.GetPendingTransactions().Should().NotContain(secondTx); + + + // send blop tx (gasPrice 9 gwei) + Transaction thirdTx = Build.A.Transaction + .WithNonce(0) + .WithValue(0) + .WithType(TxType.Blob) + .WithTo(TestItem.AddressD) + .WithBlobVersionedHashes(new byte[1][]) + .WithMaxFeePerBlobGas(9.GWei()) + .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyC).TestObject; + + EnsureSenderBalance(TestItem.PrivateKeyC.Address, UInt256.MaxValue); + _txPool.SubmitTx(thirdTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLow); + _txPool.GetOwnPendingTransactions().Length.Should().Be(2); + _txPool.GetPendingTransactions().Should().NotContain(thirdTx); + } + private IDictionary GetPeers(int limit = 100) { var peers = new Dictionary(); From 3c194622dfdc8344c10f23b04f19cf4233453f32 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 22 Apr 2024 18:07:48 -0700 Subject: [PATCH 15/21] test fixed --- .../Nethermind.TxPool.Test/TxPoolTests.cs | 65 ++++++------------- 1 file changed, 20 insertions(+), 45 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index b1087fb6582..86ec5ddf061 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -21,6 +21,7 @@ using Nethermind.Crypto; using Nethermind.Db; using Nethermind.Evm; +using Nethermind.Evm.Tracing.GethStyle.JavaScript; using Nethermind.Int256; using Nethermind.Logging; using Nethermind.Specs; @@ -1638,11 +1639,14 @@ public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int g result.Should().Be(expectedResult ? AcceptTxResult.Accepted : AcceptTxResult.FeeTooLowToCompete); } - [TestCase] - public void Should_only_add_legacy_and_1559_local_transactions_to_local_pool_when_underpaid() + [TestCase(TxType.Legacy, true)] + [TestCase(TxType.EIP1559, true)] + [TestCase(TxType.Blob, false)] + public void Should_correctly_add_tx_to_local_pool_when_underpaid(TxType txType, bool expectedResult) { - ISpecProvider specProvider = GetLondonSpecProvider(); - TxPoolConfig txPoolConfig = new TxPoolConfig { Size = 30 }; + // Should only add legacy and 1559 local transactions to local pool when underpaid + ISpecProvider specProvider = GetCancunSpecProvider(); + TxPoolConfig txPoolConfig = new TxPoolConfig { Size = 30, PersistentBlobStorageSize = 0 }; _txPool = CreatePool(txPoolConfig, specProvider); Transaction[] transactions = GetTransactions(GetPeers(3), true, false); @@ -1652,6 +1656,7 @@ public void Should_only_add_legacy_and_1559_local_transactions_to_local_pool_whe EnsureSenderBalance(address, UInt256.MaxValue); } + // setup full tx pool foreach (Transaction transaction in transactions) { transaction.GasPrice = 10.GWei(); @@ -1660,52 +1665,22 @@ public void Should_only_add_legacy_and_1559_local_transactions_to_local_pool_whe _txPool.GetPendingTransactionsCount().Should().Be(30); - - // send legacy tx (gasPrice 9 gwei) - Transaction firstTx = Build.A.Transaction + Transaction testTx = Build.A.Transaction .WithNonce(0) - .WithValue(0) - .WithType(TxType.Legacy) - .WithGasPrice(9.GWei()) - .WithTo(TestItem.AddressD) + .WithType(txType) + .WithShardBlobTxTypeAndFieldsIfBlobTx() + .WithMaxFeePerGas(9.GWei()) + .WithMaxPriorityFeePerGas(9.GWei()) + .WithTo(TestItem.AddressB) .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyA).TestObject; EnsureSenderBalance(TestItem.PrivateKeyA.Address, UInt256.MaxValue); - _txPool.SubmitTx(firstTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); - _txPool.GetOwnPendingTransactions().Length.Should().Be(1); - _txPool.GetPendingTransactions().Should().NotContain(firstTx); - - - // send eip1559 tx (gasPrice 9 gwei) - Transaction secondTx = Build.A.Transaction - .WithNonce(0) - .WithValue(0) - .WithType(TxType.EIP1559) - .WithTo(TestItem.AddressD) - .WithMaxFeePerGas(9.GWei()) - .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyB).TestObject; - - EnsureSenderBalance(TestItem.PrivateKeyB.Address, UInt256.MaxValue); - _txPool.SubmitTx(secondTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.Accepted); - _txPool.GetOwnPendingTransactions().Length.Should().Be(2); - _txPool.GetPendingTransactions().Should().NotContain(secondTx); - - - // send blop tx (gasPrice 9 gwei) - Transaction thirdTx = Build.A.Transaction - .WithNonce(0) - .WithValue(0) - .WithType(TxType.Blob) - .WithTo(TestItem.AddressD) - .WithBlobVersionedHashes(new byte[1][]) - .WithMaxFeePerBlobGas(9.GWei()) - .SignedAndResolved(_ethereumEcdsa, TestItem.PrivateKeyC).TestObject; - - EnsureSenderBalance(TestItem.PrivateKeyC.Address, UInt256.MaxValue); - _txPool.SubmitTx(thirdTx, TxHandlingOptions.PersistentBroadcast).Should().Be(AcceptTxResult.FeeTooLow); - _txPool.GetOwnPendingTransactions().Length.Should().Be(2); - _txPool.GetPendingTransactions().Should().NotContain(thirdTx); + AcceptTxResult result = _txPool.SubmitTx(testTx, TxHandlingOptions.PersistentBroadcast); + result.Should().Be(expectedResult ? AcceptTxResult.Accepted : AcceptTxResult.FeeTooLowToCompete); + _txPool.GetOwnPendingTransactions().Length.Should().Be(expectedResult ? 1 : 0); + _txPool.GetPendingBlobTransactionsCount().Should().Be(0); + _txPool.GetPendingTransactions().Should().NotContain(testTx); } private IDictionary GetPeers(int limit = 100) From 926c38177f1e9e2b8eb709bacc177d9c91535798 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 22 Apr 2024 18:17:40 -0700 Subject: [PATCH 16/21] remove invalid import --- src/Nethermind/Nethermind.Runner/NLog.config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.Runner/NLog.config b/src/Nethermind/Nethermind.Runner/NLog.config index 01f4f050a8f..5ae35fb207f 100644 --- a/src/Nethermind/Nethermind.Runner/NLog.config +++ b/src/Nethermind/Nethermind.Runner/NLog.config @@ -25,7 +25,7 @@ autoFlush="true" name="auto-colored-console-async" useDefaultRowHighlightingRules="false" - layout="${date:format=dd MMM HH\:mm\:ss} | ${message} ${exception:format=toString}"> + layout="${date:format=dd MMM HH\:mm\:ss} | ${level:uppercase=true} | ${message} ${exception:format=toString}"> @@ -36,6 +36,11 @@ + + + + + From f8546dddf71613993dccd8d7924dba5fe1292cad Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 22 Apr 2024 18:18:25 -0700 Subject: [PATCH 17/21] remove invalid import --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index 86ec5ddf061..79698b645d7 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -21,7 +21,6 @@ using Nethermind.Crypto; using Nethermind.Db; using Nethermind.Evm; -using Nethermind.Evm.Tracing.GethStyle.JavaScript; using Nethermind.Int256; using Nethermind.Logging; using Nethermind.Specs; From c695cc519b00e5e4c75d965d4b27748c5faab557 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Mon, 22 Apr 2024 18:22:51 -0700 Subject: [PATCH 18/21] revert commit 926c38177f1e9e2b8eb709bacc177d9c91535798 --- src/Nethermind/Nethermind.Runner/NLog.config | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Nethermind/Nethermind.Runner/NLog.config b/src/Nethermind/Nethermind.Runner/NLog.config index 5ae35fb207f..01f4f050a8f 100644 --- a/src/Nethermind/Nethermind.Runner/NLog.config +++ b/src/Nethermind/Nethermind.Runner/NLog.config @@ -25,7 +25,7 @@ autoFlush="true" name="auto-colored-console-async" useDefaultRowHighlightingRules="false" - layout="${date:format=dd MMM HH\:mm\:ss} | ${level:uppercase=true} | ${message} ${exception:format=toString}"> + layout="${date:format=dd MMM HH\:mm\:ss} | ${message} ${exception:format=toString}"> @@ -36,11 +36,6 @@ - - - - - From 031d15e242700863fe98a6cea2afca712b06ae24 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Wed, 24 Apr 2024 18:32:36 -0700 Subject: [PATCH 19/21] add another test case for TxType AccessList --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index 79698b645d7..d8b5bc2ec34 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -1639,11 +1639,12 @@ public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int g } [TestCase(TxType.Legacy, true)] + [TestCase(TxType.AccessList, true)] [TestCase(TxType.EIP1559, true)] [TestCase(TxType.Blob, false)] public void Should_correctly_add_tx_to_local_pool_when_underpaid(TxType txType, bool expectedResult) { - // Should only add legacy and 1559 local transactions to local pool when underpaid + // Should only add non-blob transactions to local pool when underpaid ISpecProvider specProvider = GetCancunSpecProvider(); TxPoolConfig txPoolConfig = new TxPoolConfig { Size = 30, PersistentBlobStorageSize = 0 }; _txPool = CreatePool(txPoolConfig, specProvider); From f97394e8baf54713005f9e51f15b01d00f703815 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Wed, 24 Apr 2024 19:08:36 -0700 Subject: [PATCH 20/21] change test to check all possible txtype cases and open to extension for potential tx types --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index d8b5bc2ec34..d46b39656ee 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -1638,13 +1638,15 @@ public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int g result.Should().Be(expectedResult ? AcceptTxResult.Accepted : AcceptTxResult.FeeTooLowToCompete); } - [TestCase(TxType.Legacy, true)] - [TestCase(TxType.AccessList, true)] - [TestCase(TxType.EIP1559, true)] - [TestCase(TxType.Blob, false)] - public void Should_correctly_add_tx_to_local_pool_when_underpaid(TxType txType, bool expectedResult) + [Test] + public void Should_correctly_add_tx_to_local_pool_when_underpaid([Values]TxType txType) { // Should only add non-blob transactions to local pool when underpaid + bool expectedResult = txType != TxType.Blob; + + // No need to check for deposit tx + if (txType == TxType.DepositTx) return; + ISpecProvider specProvider = GetCancunSpecProvider(); TxPoolConfig txPoolConfig = new TxPoolConfig { Size = 30, PersistentBlobStorageSize = 0 }; _txPool = CreatePool(txPoolConfig, specProvider); From a6150f16636a6b0686427a877659ce1282056458 Mon Sep 17 00:00:00 2001 From: Daniel Kyutae Jung Date: Wed, 24 Apr 2024 19:14:55 -0700 Subject: [PATCH 21/21] fix linting error --- src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs index d46b39656ee..b39e3a937bb 100644 --- a/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs +++ b/src/Nethermind/Nethermind.TxPool.Test/TxPoolTests.cs @@ -1639,7 +1639,7 @@ public void Should_not_add_underpaid_tx_even_if_lower_nonces_are_expensive(int g } [Test] - public void Should_correctly_add_tx_to_local_pool_when_underpaid([Values]TxType txType) + public void Should_correctly_add_tx_to_local_pool_when_underpaid([Values] TxType txType) { // Should only add non-blob transactions to local pool when underpaid bool expectedResult = txType != TxType.Blob;