Skip to content

Commit

Permalink
GoQuorum private tx use zero gas (mining) (hyperledger#1924)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
macfarla and mark-terry authored Feb 18, 2021
1 parent b605bf6 commit 343907a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,11 @@ Responsible for updating the state maintained between transaction validation (i.
*/
private void updateTransactionResultTracking(
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;
if (ExperimentalEIPs.eip1559Enabled && eip1559.isPresent()) {
cumulativeGasUsed =
Expand Down Expand Up @@ -285,7 +289,7 @@ private boolean transactionTooLargeForBlock(
default:
throw new IllegalStateException(
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()));
}
} else {
Expand Down

0 comments on commit 343907a

Please sign in to comment.