@@ -25,23 +25,8 @@ const (
2525 // DataDAIncludedPrefix is the store key prefix for data DA inclusion tracking.
2626 DataDAIncludedPrefix = "cache/data-da-included/"
2727
28- // DefaultTxCacheRetention is how long tx hashes stay in the
29- // seen-tx cache before CleanupOldTxs evicts them.
30- //
31- // HACK(fiber-throughput): dropped from 24h to 30s while we chase
32- // throughput, but the previous default was itself wrong: 24h is
33- // retention × tps in memory, so any rollup with meaningful TPS
34- // would OOM (we hit ~16 GB in under a minute at ~1.5M tx/s).
35- // What this should be properly:
36- // - Bounded by entry count, not wall time. The dedup window
37- // should be "the last N txs we saw", LRU-evicted, so cache
38- // memory is fixed regardless of throughput.
39- // - Or expressed in DA blocks: "drop hashes once their txs
40- // would have been retried out of the mempool", which is a
41- // property of mempool TTL × DA block time, not 24 hours.
42- // - 30s is a fine measurement default and a reasonable upper
43- // bound for pretty much any rollup; pick the right number
44- // when the cache structure itself is reworked.
28+ // DefaultTxCacheRetention is the default time to keep transaction hashes in cache.
29+ // Keeping a too high value can lead to OOM during heavy transaction load.
4530 DefaultTxCacheRetention = 30 * time .Second
4631)
4732
0 commit comments