diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java index f260453f41..a5bdd84ec8 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java @@ -273,8 +273,9 @@ public class PendingTransactions { final TransactionInfo existingTransaction = getTrackedTransactionBySenderAndNonce(transactionInfo); if (existingTransaction != null) { - if (!transactionReplacementHandler.shouldReplace( - existingTransaction, transactionInfo, chainHeadHeaderSupplier.get())) { + if (existingTransaction.transaction.isFrontierTransaction() + && !transactionReplacementHandler.shouldReplace( + existingTransaction, transactionInfo, chainHeadHeaderSupplier.get())) { return REJECTED_UNDERPRICED_REPLACEMENT; } removeTransaction(existingTransaction.getTransaction()); diff --git a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java index 099d75211d..c13afe5762 100644 --- a/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java +++ b/ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java @@ -160,14 +160,16 @@ public class TransactionPool implements BlockAddedObserver { public ValidationResult addLocalTransaction( final Transaction transaction) { - final Wei transactionGasPrice = minTransactionGasPrice(transaction); - if (transactionGasPrice.compareTo(minTransactionGasPrice) < 0) { - return ValidationResult.invalid(TransactionInvalidReason.GAS_PRICE_TOO_LOW); - } - - if (!configuration.getTxFeeCap().isZero() - && transactionGasPrice.compareTo(configuration.getTxFeeCap()) > 0) { - return ValidationResult.invalid(TransactionInvalidReason.TX_FEECAP_EXCEEDED); + if (transaction.isFrontierTransaction() + && (!ExperimentalEIPs.eip1559Enabled || this.eip1559.isEmpty())) { + final Wei transactionGasPrice = minTransactionGasPrice(transaction); + if (transactionGasPrice.compareTo(minTransactionGasPrice) < 0) { + return ValidationResult.invalid(TransactionInvalidReason.GAS_PRICE_TOO_LOW); + } + if (!configuration.getTxFeeCap().isZero() + && transactionGasPrice.compareTo(configuration.getTxFeeCap()) > 0) { + return ValidationResult.invalid(TransactionInvalidReason.TX_FEECAP_EXCEEDED); + } } final ValidationResult validationResult =