Skip to content

Commit

Permalink
Add bool TX pool flag to allow TX selection to skip finding all TXs f…
Browse files Browse the repository at this point in the history
…or the same sender
  • Loading branch information
matthew1001 committed Oct 11, 2023
1 parent 4276a40 commit 8746c69
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public class TransactionPoolOptions implements CLIOptions<TransactionPoolConfigu
private static final String TX_POOL_ENABLE_SAVE_RESTORE = "--tx-pool-enable-save-restore";
private static final String TX_POOL_SAVE_FILE = "--tx-pool-save-file";
private static final String TX_POOL_PRICE_BUMP = "--tx-pool-price-bump";
private static final String TX_POOL_DISABLE_SENDER_GROUPING = "--tx-pool-disable-sender-grouping";
private static final String RPC_TX_FEECAP = "--rpc-tx-feecap";
private static final String STRICT_TX_REPLAY_PROTECTION_ENABLED_FLAG =
"--strict-tx-replay-protection-enabled";
Expand Down Expand Up @@ -88,6 +89,14 @@ public class TransactionPoolOptions implements CLIOptions<TransactionPoolConfigu
arity = "1")
private Percentage priceBump = TransactionPoolConfiguration.DEFAULT_PRICE_BUMP;

@CommandLine.Option(
names = {TX_POOL_DISABLE_SENDER_GROUPING},
paramLabel = "<Boolean>",
description =
"Disable sender grouping of transactions during selection. (default: ${DEFAULT-VALUE})",
arity = "0..1")
private Boolean disableSenderTXGrouping = TransactionPoolConfiguration.DEFAULT_DISABLE_SENDER_TX_GROUPING;

@CommandLine.Option(
names = {RPC_TX_FEECAP},
description =
Expand Down Expand Up @@ -202,6 +211,7 @@ public static TransactionPoolOptions fromConfig(final TransactionPoolConfigurati
options.saveRestoreEnabled = config.getEnableSaveRestore();
options.disableLocalTxs = config.getDisableLocalTransactions();
options.priceBump = config.getPriceBump();
options.disableSenderTXGrouping = config.getDisableSenderTXGrouping();
options.txFeeCap = config.getTxFeeCap();
options.saveFile = config.getSaveFile();
options.strictTxReplayProtectionEnabled = config.getStrictTransactionReplayProtectionEnabled();
Expand Down Expand Up @@ -244,6 +254,7 @@ public TransactionPoolConfiguration toDomainObject() {
.enableSaveRestore(saveRestoreEnabled)
.disableLocalTransactions(disableLocalTxs)
.priceBump(priceBump)
.disableSenderTXGrouping(disableSenderTXGrouping)
.txFeeCap(txFeeCap)
.saveFile(saveFile)
.strictTransactionReplayProtectionEnabled(strictTxReplayProtectionEnabled)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 8746c69

Please sign in to comment.