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 =
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());

@ -160,14 +160,16 @@ public class TransactionPool implements BlockAddedObserver {
public ValidationResult<TransactionInvalidReason> 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<TransactionInvalidReason> validationResult =

Loading…
Cancel
Save