You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 17, 2025. It is now read-only.
Fix tx OOC (node level) when first empty L2 block in batch (#3744)
* Fix tx OOC (node level) for first empty L2 block in batch
* change log level for ooc (node level) when adding tx to the worker
* fix check OOC (node level) when preexecuting the tx in RPC
* Fix linter and test
// If we have txs pending to process but none of them fits into the wip batch, we close the wip batch and open a new one
409
+
// Set as invalid txs in the worker pool that will never fit into an empty batch
410
+
for_, oocTx:=rangeoocTxs {
411
+
log.Infof("tx %s doesn't fits in empty batch %d (node OOC), setting tx as invalid in the pool", oocTx.HashStr, f.wipL2Block.trackingNum, f.wipBatch.batchNumber)
log.Infof("current tx %s reserved resources exceeds the max limit for batch resources (node OOC), setting tx as invalid in the pool, error: %v", tx.HashStr, err)
// If we are looking for a tx for the first empty L2 block in the batch and this tx doesn't fits in the batch, then this tx will never fit in any batch.
463
+
// We add the tx to the oocTxs slice. That slice will be returned to set these txs as invalid (and delete them from the worker) from the finalizer code
464
+
ifisFistL2BlockAndEmpty {
465
+
oocTxsMutex.Lock()
466
+
oocTxs=append(oocTxs, txCandidate)
467
+
oocTxsMutex.Unlock()
468
+
}
469
+
// We continue looking for a tx that fits in the batch
461
470
continue
462
471
}
463
472
@@ -477,9 +486,15 @@ func (w *Worker) GetBestFittingTx(remainingResources state.BatchResources, highR
477
486
iffoundAt!=-1 {
478
487
log.Debugf("best fitting tx %s found at index %d with gasPrice %d", tx.HashStr, foundAt, tx.GasPrice)
479
488
w.wipTx=tx
480
-
returntx, nil
489
+
returntx, oocTxs, nil
481
490
} else {
482
-
returnnil, ErrNoFittingTransaction
491
+
// If the length of the oocTxs slice is equal to the length of the txSortedList this means that all the txs are ooc,
492
+
// therefore we need to return an error indicating that the list is empty
0 commit comments