GoQuorum private tx use zero gas (mining) (#1924)

* set gas used to zero for goQuorum private tx

Signed-off-by: Sally MacFarlane <sally.macfarlane@consensys.net>

Co-authored-by: mark-terry <36909937+mark-terry@users.noreply.github.com>
pull/1928/head
Sally MacFarlane 4 years ago committed by GitHub
parent b605bf6c66
commit 343907ac78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      ethereum/blockcreation/src/main/java/org/hyperledger/besu/ethereum/blockcreation/BlockTransactionSelector.java

@ -247,7 +247,11 @@ public class BlockTransactionSelector {
*/ */
private void updateTransactionResultTracking( private void updateTransactionResultTracking(
final Transaction transaction, final TransactionProcessingResult result) { final Transaction transaction, final TransactionProcessingResult result) {
final long gasUsedByTransaction = transaction.getGasLimit() - result.getGasRemaining(); final long gasUsedByTransaction =
transaction.isGoQuorumPrivateTransaction()
? 0
: transaction.getGasLimit() - result.getGasRemaining();
final long cumulativeGasUsed; final long cumulativeGasUsed;
if (ExperimentalEIPs.eip1559Enabled && eip1559.isPresent()) { if (ExperimentalEIPs.eip1559Enabled && eip1559.isPresent()) {
cumulativeGasUsed = cumulativeGasUsed =
@ -285,7 +289,7 @@ public class BlockTransactionSelector {
default: default:
throw new IllegalStateException( throw new IllegalStateException(
String.format( String.format(
"Developer error. Supported transaction type %s deoesn't have a block gas budget calculator", "Developer error. Supported transaction type %s doesn't have a block gas budget calculator",
transaction.getType())); transaction.getType()));
} }
} else { } else {

Loading…
Cancel
Save