Skip to content

Commit d7eea0e

Browse files
committed
feat: always recheck txs in mempool
Enables more verbose logging of the rechecking process, as with mempool lanes the app is very dependent on parity between app and comet mempools.
1 parent 464e5c9 commit d7eea0e

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

mempool/clist_mempool.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -626,9 +626,9 @@ func (mem *CListMempool) Update(
626626
}
627627

628628
// Recheck txs left in the mempool to remove them if they became invalid in the new state.
629-
if mem.config.Recheck {
630-
mem.recheckTxs()
631-
}
629+
//if mem.config.Recheck {
630+
mem.recheckTxs()
631+
//}
632632

633633
// Notify if there are still txs left in the mempool.
634634
if mem.Size() > 0 {
@@ -645,12 +645,14 @@ func (mem *CListMempool) Update(
645645
// recheckTxs sends all transactions in the mempool to the app for re-validation. When the function
646646
// returns, all recheck responses from the app have been processed.
647647
func (mem *CListMempool) recheckTxs() {
648-
mem.logger.Debug("recheck txs", "height", mem.height.Load(), "num-txs", mem.Size())
648+
mem.logger.Info("recheck txs", "height", mem.height.Load(), "num-txs", mem.Size())
649649

650650
if mem.Size() <= 0 {
651651
return
652652
}
653653

654+
startTs := time.Now()
655+
654656
mem.recheck.init(mem.txs.Front(), mem.txs.Back())
655657

656658
// NOTE: globalCb may be called concurrently, but CheckTx cannot be executed concurrently
@@ -685,7 +687,7 @@ func (mem *CListMempool) recheckTxs() {
685687
if n := mem.recheck.numPendingTxs.Load(); n > 0 {
686688
mem.logger.Error("not all txs were rechecked", "not-rechecked", n)
687689
}
688-
mem.logger.Debug("done rechecking txs", "height", mem.height.Load(), "num-txs", mem.Size())
690+
mem.logger.Info("done rechecking txs", "height", mem.height.Load(), "num-txs", mem.Size(), "duration", time.Since(startTs).String())
689691
}
690692

691693
// The cursor and end pointers define a dynamic list of transactions that could be rechecked. The

0 commit comments

Comments
 (0)