From aa142514a4b58561f0a2b6883929ba4073d2c3a2 Mon Sep 17 00:00:00 2001 From: Matthew Whitehead Date: Thu, 9 Nov 2023 10:41:47 +0000 Subject: [PATCH] Apply the same reverse sort order as https://github.com/hyperledger/besu/pull/6106 but to the base fee sorter Signed-off-by: Matthew Whitehead --- .../sorter/BaseFeePendingTransactionsSorter.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsSorter.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsSorter.java index 2ccb4d476ee..88781fc622b 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsSorter.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/sorter/BaseFeePendingTransactionsSorter.java @@ -73,8 +73,7 @@ public BaseFeePendingTransactionsSorter( .orElse(Wei.ZERO) .getAsBigInteger() .longValue()) - .thenComparing(PendingTransaction::getAddedAt) - .thenComparing(PendingTransaction::getSequence) + .thenComparing(PendingTransaction::getSequence, Comparator.reverseOrder()) .reversed()); private final NavigableSet prioritizedTransactionsDynamicRange = @@ -87,8 +86,7 @@ public BaseFeePendingTransactionsSorter( .getMaxFeePerGas() .map(maxFeePerGas -> maxFeePerGas.getAsBigInteger().longValue()) .orElse(pendingTx.getGasPrice().toLong())) - .thenComparing(PendingTransaction::getAddedAt) - .thenComparing(PendingTransaction::getSequence) + .thenComparing(PendingTransaction::getSequence, Comparator.reverseOrder()) .reversed()); @Override