Skip to content

Commit c93c97c

Browse files
cfflsmarcello33
authored andcommitted
Disable txn indexer in stateless mode
Since stateless nodes are using a different pruner from the regular pruner in geth, the transaction indexer will have problem with pruned blocks, resulting hanging goroutines in memory. This change prevents stateless node from running indexer on pruned blocks.
1 parent 55ee5ed commit c93c97c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

core/blockchain.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ func NewBlockChain(db ethdb.Database, genesis *Genesis, engine consensus.Engine,
621621
}
622622

623623
// Start tx indexer if it's enabled.
624-
if bc.cfg.TxLookupLimit >= 0 {
624+
// Disable tx indexer in stateless mode to avoid potential issues with pruning in stateless mode.
625+
if bc.cfg.TxLookupLimit >= 0 && !bc.cfg.Stateless {
625626
bc.txIndexer = newTxIndexer(uint64(bc.cfg.TxLookupLimit), bc)
626627
}
627628

0 commit comments

Comments
 (0)