@@ -164,10 +164,9 @@ type task struct {
164164 block * types.Block
165165 createdAt time.Time
166166
167- profit * big.Int
168- isFlashbots bool
169- worker int
170- isMegabundle bool
167+ profit * big.Int
168+ isFlashbots bool
169+ worker int
171170}
172171
173172const (
@@ -233,7 +232,6 @@ type worker struct {
233232 exitCh chan struct {}
234233 resubmitIntervalCh chan time.Duration
235234 resubmitAdjustCh chan * intervalAdjust
236- newMegabundleCh chan * types.MevBundle
237235
238236 wg sync.WaitGroup
239237
@@ -583,11 +581,6 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
583581 timestamp = time .Now ().Unix ()
584582 commit (false , commitInterruptNewHead )
585583
586- case <- w .newMegabundleCh :
587- if w .isRunning () {
588- commit (true , commitInterruptNone )
589- }
590-
591584 case <- timer .C :
592585 // If sealing is running resubmit a new work cycle periodically to pull in
593586 // higher priced transactions. Disable this overhead for pending blocks.
@@ -796,7 +789,7 @@ func (w *worker) taskLoop() {
796789 // Interrupt previous sealing operation
797790 interrupt ()
798791 stopCh , prev = make (chan struct {}), sealHash
799- log .Info ("Proposed miner block" , "blockNumber" , task .block .Number (), "profit" , ethIntToFloat (prevProfit ), "isFlashbots" , task .isFlashbots , "sealhash" , sealHash , "parentHash" , prevParentHash , "worker" , task .worker , "isMegabundle" , task . isMegabundle )
792+ log .Info ("Proposed miner block" , "blockNumber" , task .block .Number (), "profit" , ethIntToFloat (prevProfit ), "isFlashbots" , task .isFlashbots , "sealhash" , sealHash , "parentHash" , prevParentHash , "worker" , task .worker )
800793 if w .skipSealHook != nil && w .skipSealHook (task ) {
801794 continue
802795 }
@@ -1309,7 +1302,7 @@ func (w *worker) fillTransactions(interrupt *int32, env *environment, validatorC
13091302 return err
13101303 }
13111304 }
1312- if w .flashbots .isFlashbots && ! w . flashbots . isMegabundleWorker {
1305+ if w .flashbots .isFlashbots {
13131306 bundles , err := w .eth .TxPool ().MevBundles (env .header .Number , env .header .Time )
13141307 if err != nil {
13151308 log .Error ("Failed to fetch pending transactions" , "err" , err )
@@ -1330,40 +1323,6 @@ func (w *worker) fillTransactions(interrupt *int32, env *environment, validatorC
13301323 }
13311324 env .profit .Add (env .profit , bundle .ethSentToCoinbase )
13321325 }
1333- if w .flashbots .isMegabundleWorker {
1334- megabundle , err := w .eth .TxPool ().GetMegabundle (w .flashbots .relayAddr , env .header .Number , env .header .Time )
1335- log .Info ("Starting to process a Megabundle" , "relay" , w .flashbots .relayAddr , "megabundle" , megabundle , "error" , err )
1336- if err != nil {
1337- return err // no valid megabundle for this relay, nothing to do
1338- }
1339-
1340- // Flashbots bundle merging duplicates work by simulating TXes and then committing them once more.
1341- // Megabundles API focuses on speed and runs everything in one cycle.
1342- coinbaseBalanceBefore := env .state .GetBalance (env .coinbase )
1343- if err := w .commitBundle (env , megabundle .Txs , interrupt ); err != nil {
1344- log .Info ("Could not commit a Megabundle" , "relay" , w .flashbots .relayAddr , "megabundle" , megabundle , "err" , err )
1345- return err
1346- }
1347- var txStatuses = map [common.Hash ]bool {}
1348- for _ , receipt := range env .receipts {
1349- txStatuses [receipt .TxHash ] = receipt .Status == types .ReceiptStatusSuccessful
1350- }
1351- for _ , tx := range megabundle .Txs {
1352- status , ok := txStatuses [tx .Hash ()]
1353- if ! ok {
1354- log .Error ("No TX receipt after megabundle simulation" , "TxHash" , tx .Hash ())
1355- return errors .New ("no tx receipt after megabundle simulation" )
1356- }
1357- if ! status && ! containsHash (megabundle .RevertingTxHashes , tx .Hash ()) {
1358- log .Info ("Ignoring megabundle because of failing TX" , "relay" , w .flashbots .relayAddr , "TxHash" , tx .Hash ())
1359- return errors .New ("megabundle contains failing tx" )
1360- }
1361- }
1362- coinbaseBalanceAfter := env .state .GetBalance (env .coinbase )
1363- coinbaseDelta := big .NewInt (0 ).Sub (coinbaseBalanceAfter , coinbaseBalanceBefore )
1364- env .profit = coinbaseDelta
1365- log .Info ("Megabundle processed" , "relay" , w .flashbots .relayAddr , "totalProfit" , ethIntToFloat (env .profit ))
1366- }
13671326
13681327 if len (localTxs ) > 0 {
13691328 txs := types .NewTransactionsByPriceAndNonce (env .signer , localTxs , env .header .BaseFee )
@@ -1524,7 +1483,7 @@ func (w *worker) commit(env *environment, interval func(), update bool, start ti
15241483 // If we're post merge, just ignore
15251484 if ! w .isTTDReached (block .Header ()) {
15261485 select {
1527- case w .taskCh <- & task {receipts : env .receipts , state : env .state , block : block , createdAt : time .Now (), profit : env .profit , isFlashbots : w .flashbots .isFlashbots , worker : w .flashbots .maxMergedBundles , isMegabundle : w . flashbots . isMegabundleWorker }:
1486+ case w .taskCh <- & task {receipts : env .receipts , state : env .state , block : block , createdAt : time .Now (), profit : env .profit , isFlashbots : w .flashbots .isFlashbots , worker : w .flashbots .maxMergedBundles }:
15281487 w .unconfirmed .Shift (block .NumberU64 () - 1 )
15291488
15301489 fees := totalFees (block , env .receipts )
0 commit comments