From 9a7864f1bc457a06ca0774fc346f64398dd95d28 Mon Sep 17 00:00:00 2001 From: Fabio Di Fabio Date: Fri, 22 Sep 2023 11:20:07 +0200 Subject: [PATCH] Add option to select the txpool implementation --- README.md | 9 +++++---- defaults/main.yml | 1 + templates/config.toml.j2 | 5 ++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 4b16b0d..1e0b056 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,11 @@ All variables which can be overridden are stored in [defaults/main.yml](defaults | `besu_privacy_marker_tx_signing_key_file` | "" | Path of the private key file used to sign Privacy Marker Transactions. If you do not specify this option, Besu signs each transaction with a different randomly generated key. | | `besu_xdns_enabled` | "false" | DNS support with a trusted DNS provider in private networks because of limitations where IP addresses can change. For example, when using Kubernetes pods | | `besu_target_gas_limit` | ___unset___ | Configuration of the target gas limit | -| `besu_tx_pool_limit_by_account_percentage` | 0.001 | The maximum number of transactions, relative to the max pool size, for the same sender allowed in the transaction pool. Defaults to 5 to prevent a DoS attack. This uses a float value [0..1], so setting it to 1 means a single sender can fill the entire tx pool. | -| `besu_tx_pool_max_size` | 4096 | The maximum number of transactions kept in the transaction pool | +| `besu_tx_pool` | layered | Select the transaction pool implementation, set to `legacy` to switch to the old implementation | | `besu_tx_pool_price_bump` | 10 | The price bump percentage to replace an existing transaction | -| `besu_tx_pool_retention_hours` | 13 | The maximum period, in hours, to hold pending transactions in the transaction pool | +| `besu_tx_pool_limit_by_account_percentage` | 0.001 | The maximum number of transactions, relative to the max pool size, for the same sender allowed in the transaction pool. Defaults to 5 to prevent a DoS attack. This uses a float value [0..1], so setting it to 1 means a single sender can fill the entire tx pool. Only apply if `legacy` implementation is selected | +| `besu_tx_pool_max_size` | 4096 | The maximum number of transactions kept in the transaction pool. Only apply if `legacy` implementation is selected | +| `besu_tx_pool_retention_hours` | 13 | The maximum period, in hours, to hold pending transactions in the transaction pool. Only apply if `legacy` implementation is selected | ### Example Playbook @@ -174,4 +175,4 @@ Apache ### Author Information -Consensys, 2021 +Consensys, 2023 diff --git a/defaults/main.yml b/defaults/main.yml index 161fb12..a173913 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -76,6 +76,7 @@ besu_local_permissions_accounts: [] besu_local_permissions_nodes: [] besu_xdns_enabled: "false" besu_static_nodes: [] +besu_tx_pool: layered # float values in the range [0..1], 1=single sender can fill the entire tx pool # https://github.com/hyperledger/besu/issues/4611 besu_tx_pool_limit_by_account_percentage: 0.001 diff --git a/templates/config.toml.j2 b/templates/config.toml.j2 index 90ce56c..188e650 100644 --- a/templates/config.toml.j2 +++ b/templates/config.toml.j2 @@ -121,10 +121,13 @@ max-peers={{besu_max_peers}} {% endif %} # tx pool +{% if besu_tx_pool == "legacy" %} +tx-pool=legacy tx-pool-limit-by-account-percentage={{ besu_tx_pool_limit_by_account_percentage }} tx-pool-max-size={{ besu_tx_pool_max_size }} -tx-pool-price-bump={{ besu_tx_pool_price_bump }} tx-pool-retention-hours={{ besu_tx_pool_retention_hours }} +{% endif %} +tx-pool-price-bump={{ besu_tx_pool_price_bump }} # metrics metrics-enabled=true