Remove restriction about base fee on eth_sendRawTransaction (#1473)

Signed-off-by: Abdelhamid Bakhta <abdelhamid.bakhta@consensys.net>
pull/1482/head
Abdelhamid Bakhta 4 years ago committed by GitHub
parent 43abf832ef
commit 2374f3b704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java
  2. 18
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java

@ -273,8 +273,9 @@ public class PendingTransactions {
final TransactionInfo existingTransaction = final TransactionInfo existingTransaction =
getTrackedTransactionBySenderAndNonce(transactionInfo); getTrackedTransactionBySenderAndNonce(transactionInfo);
if (existingTransaction != null) { if (existingTransaction != null) {
if (!transactionReplacementHandler.shouldReplace( if (existingTransaction.transaction.isFrontierTransaction()
existingTransaction, transactionInfo, chainHeadHeaderSupplier.get())) { && !transactionReplacementHandler.shouldReplace(
existingTransaction, transactionInfo, chainHeadHeaderSupplier.get())) {
return REJECTED_UNDERPRICED_REPLACEMENT; return REJECTED_UNDERPRICED_REPLACEMENT;
} }
removeTransaction(existingTransaction.getTransaction()); removeTransaction(existingTransaction.getTransaction());

@ -160,14 +160,16 @@ public class TransactionPool implements BlockAddedObserver {
public ValidationResult<TransactionInvalidReason> addLocalTransaction( public ValidationResult<TransactionInvalidReason> addLocalTransaction(
final Transaction transaction) { final Transaction transaction) {
final Wei transactionGasPrice = minTransactionGasPrice(transaction); if (transaction.isFrontierTransaction()
if (transactionGasPrice.compareTo(minTransactionGasPrice) < 0) { && (!ExperimentalEIPs.eip1559Enabled || this.eip1559.isEmpty())) {
return ValidationResult.invalid(TransactionInvalidReason.GAS_PRICE_TOO_LOW); 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) { if (!configuration.getTxFeeCap().isZero()
return ValidationResult.invalid(TransactionInvalidReason.TX_FEECAP_EXCEEDED); && transactionGasPrice.compareTo(configuration.getTxFeeCap()) > 0) {
return ValidationResult.invalid(TransactionInvalidReason.TX_FEECAP_EXCEEDED);
}
} }
final ValidationResult<TransactionInvalidReason> validationResult = final ValidationResult<TransactionInvalidReason> validationResult =

Loading…
Cancel
Save