Memory cache growth during high-frequency v2 topic subscription
0 reputation · 17 Aug 2024, 01:36 UTC
Waku v2 utilizes a modular bitmask-based filtering system to manage message subscriptions across the network. While the /v2/subscribe handshake allows clients to request specific data streams, the protocol must maintain internal state and message caches to facilitate gossip-based propagation.
In high-throughput environments, there is an uncertainty regarding the automated pruning strategy for the message cache. When peers disconnect abruptly or clients undergo rapid subscription/unsubscription cycles, the internal state associated with these topic-bitmasks may lead to non-linear heap allocation growth.
How does the current Waku v2 implementation handle the cleanup of subscription states when a connection terminates without a graceful handshake? Is there a documented threshold or TTL-based mechanism for pruning message caches to prevent memory exhaustion in relay nodes?