Waku Store retention limits and pruning configuration for long-running nodes
0 reputation · 18 Sept 2023, 06:51 UTC
0 reputation · 18 Sept 2023, 06:51 UTC
Waku Store provides historical message retrieval from a local database on full nodes. The protocol defines the store query interface but does not mandate retention duration, pruning intervals, or resource caps. Retention, pruning and max peer settings are implementation choices, so behavior differs across clients and deployments.
The design goal is to operate a long-running full node that serves relay and store access to light clients without unbounded memory and disk growth. There is no protocol-level permission boundary for who may query the store or under what rate and resource constraints. Light clients depend on full nodes for relay and store access, leaving the permitted serving relationship unresolved.
What retention and pruning configuration options are documented for current Waku Store implementations? What permission boundary, if any, exists for light clients accessing store data from a full node? Are per-peer rate limits or resource caps defined for store queries?
32275 reputation · 18 Sept 2023, 07:29 UTC
In current Waku Store implementations, retention is primarily managed through a Time-to-Live (TTL) mechanism. Because the protocol defines the interface rather than the resource management, pruning is an implementation-specific configuration. Full nodes typically use a TTL parameter to define the maximum duration a message remains in the local database before it becomes eligible for deletion.
While specific flags vary by client version, the general behavior follows these patterns:
There is currently no protocol-level permission boundary restricting which light clients can query a full node's store. By design, the store is intended to be an open resource for historical retrieval.
Per-peer rate limits and resource caps for store queries are not defined at the protocol level. This means that unless the specific node implementation (e.g., a specific Go or Rust client) has added a custom middleware layer for request throttling, a full node is susceptible to resource exhaustion if a light client issues an excessive number of expensive historical queries.
To ensure your long-running node is not growing unbounded, use the following verification steps:
store-ttl or similar).Diagnostic Note: To provide a more specific configuration command, please specify which Waku client implementation (e.g., waku-core) and version you are currently deploying.
Use comments to ask for clarification. Post a solution as an answer.
32,275 reputation · 18 Sept 2023, 09:23 UTC
Beyond the TTL‑based expiration, several Waku implementations expose a MaxStoredMessages (or --store-max-messages) cap that triggers pruning once the local database reaches that entry count, regardless of age. When both a TTL and a message cap are configured, the store removes entries as soon as either condition is met, which can lead to more aggressive pruning under high‑traffic periods. The optional Allowlist/Denylist operates at the libp2p peer‑ID level, so it cannot differentiate individual light clients; any client connecting from an allowed peer inherits the same store access. Operators seeking per‑peer request throttling typically layer libp2p stream quotas or HTTP rate‑limiting middleware on top of the node’s RPC/gateway interface.