|
|
|
@ -42,7 +42,6 @@ import org.hyperledger.besu.ethereum.mainnet.TransactionValidationParams; |
|
|
|
|
import org.hyperledger.besu.ethereum.mainnet.ValidationResult; |
|
|
|
|
import org.hyperledger.besu.ethereum.transaction.TransactionInvalidReason; |
|
|
|
|
import org.hyperledger.besu.metrics.BesuMetricCategory; |
|
|
|
|
import org.hyperledger.besu.plugin.data.TransactionType; |
|
|
|
|
import org.hyperledger.besu.plugin.services.MetricsSystem; |
|
|
|
|
import org.hyperledger.besu.plugin.services.metrics.Counter; |
|
|
|
|
import org.hyperledger.besu.plugin.services.metrics.LabelledMetric; |
|
|
|
@ -143,18 +142,10 @@ public class TransactionPool implements BlockAddedObserver { |
|
|
|
|
|
|
|
|
|
public ValidationResult<TransactionInvalidReason> addLocalTransaction( |
|
|
|
|
final Transaction transaction) { |
|
|
|
|
if (transaction.getType().equals(TransactionType.FRONTIER) |
|
|
|
|
&& (!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); |
|
|
|
|
} |
|
|
|
|
if (!configuration.getTxFeeCap().isZero() |
|
|
|
|
&& minTransactionGasPrice(transaction).compareTo(configuration.getTxFeeCap()) > 0) { |
|
|
|
|
return ValidationResult.invalid(TransactionInvalidReason.TX_FEECAP_EXCEEDED); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
final ValidationResult<TransactionInvalidReason> validationResult = |
|
|
|
|
validateTransaction(transaction); |
|
|
|
|
if (validationResult.isValid()) { |
|
|
|
|