@@ -164,10 +164,9 @@ type task struct {
164
164
block * types.Block
165
165
createdAt time.Time
166
166
167
- profit * big.Int
168
- isFlashbots bool
169
- worker int
170
- isMegabundle bool
167
+ profit * big.Int
168
+ isFlashbots bool
169
+ worker int
171
170
}
172
171
173
172
const (
@@ -233,7 +232,6 @@ type worker struct {
233
232
exitCh chan struct {}
234
233
resubmitIntervalCh chan time.Duration
235
234
resubmitAdjustCh chan * intervalAdjust
236
- newMegabundleCh chan * types.MevBundle
237
235
238
236
wg sync.WaitGroup
239
237
@@ -583,11 +581,6 @@ func (w *worker) newWorkLoop(recommit time.Duration) {
583
581
timestamp = time .Now ().Unix ()
584
582
commit (false , commitInterruptNewHead )
585
583
586
- case <- w .newMegabundleCh :
587
- if w .isRunning () {
588
- commit (true , commitInterruptNone )
589
- }
590
-
591
584
case <- timer .C :
592
585
// If sealing is running resubmit a new work cycle periodically to pull in
593
586
// higher priced transactions. Disable this overhead for pending blocks.
@@ -796,7 +789,7 @@ func (w *worker) taskLoop() {
796
789
// Interrupt previous sealing operation
797
790
interrupt ()
798
791
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 )
800
793
if w .skipSealHook != nil && w .skipSealHook (task ) {
801
794
continue
802
795
}
@@ -1309,7 +1302,7 @@ func (w *worker) fillTransactions(interrupt *int32, env *environment, validatorC
1309
1302
return err
1310
1303
}
1311
1304
}
1312
- if w .flashbots .isFlashbots && ! w . flashbots . isMegabundleWorker {
1305
+ if w .flashbots .isFlashbots {
1313
1306
bundles , err := w .eth .TxPool ().MevBundles (env .header .Number , env .header .Time )
1314
1307
if err != nil {
1315
1308
log .Error ("Failed to fetch pending transactions" , "err" , err )
@@ -1330,40 +1323,6 @@ func (w *worker) fillTransactions(interrupt *int32, env *environment, validatorC
1330
1323
}
1331
1324
env .profit .Add (env .profit , bundle .ethSentToCoinbase )
1332
1325
}
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
- }
1367
1326
1368
1327
if len (localTxs ) > 0 {
1369
1328
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
1524
1483
// If we're post merge, just ignore
1525
1484
if ! w .isTTDReached (block .Header ()) {
1526
1485
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 }:
1528
1487
w .unconfirmed .Shift (block .NumberU64 () - 1 )
1529
1488
1530
1489
fees := totalFees (block , env .receipts )
0 commit comments