From ceab2ea57f8abf6499d001ef1052756541db4d41 Mon Sep 17 00:00:00 2001 From: Jason Paryani Date: Wed, 2 Jun 2021 11:06:51 -0700 Subject: [PATCH] Add floor gas price for bundle inclusion in merged bundle --- miner/worker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/miner/worker.go b/miner/worker.go index e029ed8af96e..f7631fc14e5b 100644 --- a/miner/worker.go +++ b/miner/worker.go @@ -1248,8 +1248,12 @@ func (w *worker) mergeBundles(bundles []simulatedBundle, parent *types.Block, he prevState = state.Copy() prevGasPool = new(core.GasPool).AddGas(gasPool.Gas()) + // the floor gas price is 99/100 what was simulated at the top of the block + floorGasPrice := new(big.Int).Mul(bundle.mevGasPrice, big.NewInt(99)) + floorGasPrice = floorGasPrice.Div(floorGasPrice, big.NewInt(100)) + simmed, err := w.computeBundleGas(bundle.originalBundle, parent, header, state, gasPool, pendingTxs, len(finalBundle)) - if err != nil || simmed.totalEth.Cmp(new(big.Int)) <= 0 { + if err != nil || simmed.mevGasPrice.Cmp(floorGasPrice) <= 0 { state = prevState gasPool = prevGasPool continue