From c474dea066f34bcb3a04036b767fc438d3330d56 Mon Sep 17 00:00:00 2001 From: Matthew Whitehead Date: Wed, 11 Oct 2023 22:18:47 +0100 Subject: [PATCH] Add bool TX pool flag to allow TX selection to skip finding all TXs for the same sender Signed-off-by: Matthew Whitehead --- CHANGELOG.md | 4 +++- .../cli/options/stable/TransactionPoolOptions.java | 12 ++++++++++++ .../options/stable/TransactionPoolOptionsTest.java | 9 +++++++++ besu/src/test/resources/everything_config.toml | 1 + .../transactions/TransactionPoolConfiguration.java | 11 +++++++++++ 5 files changed, 36 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 359b1135ad4..aaf7f608ca8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,13 @@ # Changelog -## Next Release +## 24.1.0 ### Breaking Changes ### Additions and Improvements + - Add option to avoid grouping transactions from a single sender when selecting candidate transactions for a block [#6022](https://github.com/hyperledger/besu/pull/6022) + ### Bug Fixes ### Download Links diff --git a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/TransactionPoolOptions.java b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/TransactionPoolOptions.java index 6353618d24d..276ae8e29c3 100644 --- a/besu/src/main/java/org/hyperledger/besu/cli/options/stable/TransactionPoolOptions.java +++ b/besu/src/main/java/org/hyperledger/besu/cli/options/stable/TransactionPoolOptions.java @@ -42,6 +42,7 @@ public class TransactionPoolOptions implements CLIOptions assertThat(config.getNoSenderTXGrouping()).isEqualTo(senderTXGrouping), + "--tx-pool-disable-sender-grouping", + senderTXGrouping.toString()); + } + @Test public void invalidPriceBumpShouldFail() { internalTestFailure( diff --git a/besu/src/test/resources/everything_config.toml b/besu/src/test/resources/everything_config.toml index e88acec6dc9..3bea49584c9 100644 --- a/besu/src/test/resources/everything_config.toml +++ b/besu/src/test/resources/everything_config.toml @@ -177,6 +177,7 @@ strict-tx-replay-protection-enabled=true tx-pool-disable-locals=false tx-pool-enable-save-restore=true tx-pool-save-file="txpool.dump" +tx-pool-disable-sender-grouping=false ## Layered tx-pool-layer-max-capacity=12345678 tx-pool-max-prioritized=9876 diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java index aaf8c326c0a..9b3e00b8721 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPoolConfiguration.java @@ -62,6 +62,7 @@ enum Implementation { Wei DEFAULT_RPC_TX_FEE_CAP = Wei.fromEth(1); boolean DEFAULT_DISABLE_LOCAL_TXS = false; boolean DEFAULT_ENABLE_SAVE_RESTORE = false; + boolean DEFAULT_DISABLE_SENDER_TX_GROUPING = false; File DEFAULT_SAVE_FILE = new File(DEFAULT_SAVE_FILE_NAME); long DEFAULT_PENDING_TRANSACTIONS_LAYER_MAX_CAPACITY_BYTES = 12_500_000L; @@ -96,6 +97,11 @@ default Percentage getPriceBump() { return DEFAULT_PRICE_BUMP; } + @Value.Default + default Boolean getNoSenderTXGrouping() { + return DEFAULT_DISABLE_SENDER_TX_GROUPING; + } + @Value.Default default Wei getTxFeeCap() { return DEFAULT_RPC_TX_FEE_CAP; @@ -121,6 +127,11 @@ default File getSaveFile() { return DEFAULT_SAVE_FILE; } + @Value.Default + default Boolean getDisableSenderTXGrouping() { + return DEFAULT_DISABLE_SENDER_TX_GROUPING; + } + @Value.Default default Implementation getTxPoolImplementation() { return DEFAULT_TX_POOL_IMPLEMENTATION;