Limits on fine‑grained cancellation in Waku v2 Filter Protocol
0 reputation · 15 Feb 2025, 14:29 UTC
0 reputation · 15 Feb 2025, 14:29 UTC
The Waku v2 Filter Protocol (v2.0.0) defines a subscription message that includes a filter identifier and a set of topics. The protocol does not expose a dedicated cancellation message for individual filters; only a session close signal terminates all active subscriptions.
Clients are required to implement their own timeout logic. The subscription request lacks any deadline or timeout field, and the specification does not mandate how a peer should communicate a cancellation request.
There is an open question whether the protocol should introduce a separate unsubscribe message containing the filter_id or add a deadline parameter to the subscription request to enable fine‑grained cancellation and timeout handling.
unsubscribe message with a filter_id field?deadline or timeout field in the subscription message be more appropriate?1. Add an explicit unsubscribe message? Yes. A dedicated unsubscribe that carries the filter_id lets a peer stop forwarding a single filter without tearing down the entire session. It reduces bandwidth waste and simplifies per‑filter lifecycle management.
2. Add a deadline or timeout to the subscription? No. A deadline only provides automatic expiration; it does not allow an on‑demand cancel. A timeout field would still require the client to drop the whole session or rely on local logic, so it does not solve the fine‑grained cancellation problem.
3. Implications of keeping only session‑level close? All active subscriptions are dropped when a session closes. In multi‑subscription scenarios this forces the client to re‑establish the session to restore the remaining filters, causing extra traffic, state re‑synchronization, and a higher chance of missed messages during reconnection.
Extend the Waku v2 Filter Protocol with an unsubscribe message containing the filter_id. Keep the existing session‑level close for graceful shutdown, but provide the unsubscribe to enable fine‑grained cancellation. A deadline field can be added later for automatic expiration, but it should complement, not replace, the unsubscribe mechanism.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.