From ec1b4817f7e01a185c88139f6bec4c4ab02012b2 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Wed, 18 Aug 2021 10:14:29 -0700 Subject: [PATCH] flashbots: fix bug in double counting gas for profit switcher Only add in the eth sent to coinbase, since the gas fees are counted already in commitTransaction --- miner/worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index 4712e3af75a9..c758b7a002d0 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1197,7 +1197,7 @@ func (w *worker) commitNewWork(interrupt *int32, noempty bool, timestamp int64) if w.commitBundle(bundleTxs, w.coinbase, interrupt) { return } - w.current.profit.Add(w.current.profit, bundle.totalEth) + w.current.profit.Add(w.current.profit, bundle.ethSentToCoinbase) } if w.flashbots.isMegabundleWorker { megabundle, err := w.eth.TxPool().GetMegabundle(w.flashbots.relayAddr, header.Number, header.Time)