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. 3
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/PendingTransactions.java
  2. 4
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/transactions/TransactionPool.java

@ -273,7 +273,8 @@ 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()
&& !transactionReplacementHandler.shouldReplace(
existingTransaction, transactionInfo, chainHeadHeaderSupplier.get())) { existingTransaction, transactionInfo, chainHeadHeaderSupplier.get())) {
return REJECTED_UNDERPRICED_REPLACEMENT; return REJECTED_UNDERPRICED_REPLACEMENT;
} }

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

Loading…
Cancel
Save