Skip to content

Commit

Permalink
Add floor gas price for bundle inclusion in merged bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
jparyani committed Jun 2, 2021
1 parent 97bb79d commit ceab2ea
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion miner/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ceab2ea

Please sign in to comment.