Skip to content

Commit

Permalink
Change flashbots bundle pricing formula to ignore gas fees
Browse files Browse the repository at this point in the history
  • Loading branch information
jparyani committed Jul 14, 2021
1 parent 88247f3 commit b94943e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -1277,6 +1277,7 @@ func (w *worker) computeBundleGas(bundle types.Transactions, parent *types.Block

var totalGasUsed uint64 = 0
var tempGasUsed uint64
gasFees := new(big.Int)

coinbaseBalanceBefore := env.state.GetBalance(w.coinbase)

Expand All @@ -1286,13 +1287,12 @@ func (w *worker) computeBundleGas(bundle types.Transactions, parent *types.Block
return nil, 0, err
}
totalGasUsed += receipt.GasUsed
gasFees.Add(gasFees, new(big.Int).Mul(big.NewInt(int64(totalGasUsed)), tx.GasPrice()))
}
coinbaseBalanceAfter := env.state.GetBalance(w.coinbase)
coinbaseDiff := new(big.Int).Sub(coinbaseBalanceAfter, coinbaseBalanceBefore)
totalEth := new(big.Int)
totalEth.Add(totalEth, coinbaseDiff)
coinbaseDiff := new(big.Int).Sub(new(big.Int).Sub(coinbaseBalanceAfter, gasFees), coinbaseBalanceBefore)

return totalEth, totalGasUsed, nil
return coinbaseDiff, totalGasUsed, nil
}

// copyReceipts makes a deep copy of the given receipts.
Expand Down

0 comments on commit b94943e

Please sign in to comment.