@ -27,6 +27,7 @@ import org.hyperledger.besu.ethereum.core.Wei;
import org.hyperledger.besu.ethereum.core.WorldUpdater ;
import org.hyperledger.besu.ethereum.core.WorldUpdater ;
import org.hyperledger.besu.ethereum.core.fees.CoinbaseFeePriceCalculator ;
import org.hyperledger.besu.ethereum.core.fees.CoinbaseFeePriceCalculator ;
import org.hyperledger.besu.ethereum.core.fees.TransactionPriceCalculator ;
import org.hyperledger.besu.ethereum.core.fees.TransactionPriceCalculator ;
import org.hyperledger.besu.ethereum.mainnet.TransactionValidator.TransactionInvalidReason ;
import org.hyperledger.besu.ethereum.vm.BlockHashLookup ;
import org.hyperledger.besu.ethereum.vm.BlockHashLookup ;
import org.hyperledger.besu.ethereum.vm.Code ;
import org.hyperledger.besu.ethereum.vm.Code ;
import org.hyperledger.besu.ethereum.vm.GasCalculator ;
import org.hyperledger.besu.ethereum.vm.GasCalculator ;
@ -208,6 +209,7 @@ public class MainnetTransactionProcessor implements TransactionProcessor {
final BlockHashLookup blockHashLookup ,
final BlockHashLookup blockHashLookup ,
final Boolean isPersistingPrivateState ,
final Boolean isPersistingPrivateState ,
final TransactionValidationParams transactionValidationParams ) {
final TransactionValidationParams transactionValidationParams ) {
try {
LOG . trace ( "Starting execution of {}" , transaction ) ;
LOG . trace ( "Starting execution of {}" , transaction ) ;
ValidationResult < TransactionValidator . TransactionInvalidReason > validationResult =
ValidationResult < TransactionValidator . TransactionInvalidReason > validationResult =
@ -234,7 +236,10 @@ public class MainnetTransactionProcessor implements TransactionProcessor {
final Wei transactionGasPrice =
final Wei transactionGasPrice =
transactionPriceCalculator . price ( transaction , blockHeader . getBaseFee ( ) ) ;
transactionPriceCalculator . price ( transaction , blockHeader . getBaseFee ( ) ) ;
LOG . trace (
LOG . trace (
"Incremented sender {} nonce ({} -> {})" , senderAddress , previousNonce , sender . getNonce ( ) ) ;
"Incremented sender {} nonce ({} -> {})" ,
senderAddress ,
previousNonce ,
sender . getNonce ( ) ) ;
final Wei upfrontGasCost = transaction . getUpfrontGasCost ( transactionGasPrice ) ;
final Wei upfrontGasCost = transaction . getUpfrontGasCost ( transactionGasPrice ) ;
final Wei previousBalance = senderMutableAccount . decrementBalance ( upfrontGasCost ) ;
final Wei previousBalance = senderMutableAccount . decrementBalance ( upfrontGasCost ) ;
@ -396,6 +401,13 @@ public class MainnetTransactionProcessor implements TransactionProcessor {
validationResult ,
validationResult ,
initialFrame . getRevertReason ( ) ) ;
initialFrame . getRevertReason ( ) ) ;
}
}
} catch ( final RuntimeException re ) {
LOG . error ( "Critical Exception Processing Transaction" , re ) ;
return Result . invalid (
ValidationResult . invalid (
TransactionInvalidReason . INTERNAL_ERROR ,
"Internal Error in Besu - " + re . toString ( ) ) ) ;
}
}
}
private static void clearEmptyAccounts ( final WorldUpdater worldState ) {
private static void clearEmptyAccounts ( final WorldUpdater worldState ) {