Throwing some ideas out there. Trying to build a mental model on how we can solve devices offline “for too long”. Keen to get some opinions. Experimenting and dogfooding will likely drive final design.
Scenario
Alice was offline for a while, she comes back online and start retrieving latest messages from store node.
Thanks to SDS [1], she realizes she is missing message 12345
from SDS’ causal history.
Retrieving from store
Alice tries to retrieve message 12345
from store nodes, as per SDS.
How many store nodes should she try before giving up?
Can she infer the timestamp of 12345
?
- by looking at timestamp of other messages in the same SDS channel?
- by having message ordering embedded in the message id?
If she can infer the timestamp, and if store nodes expose their oldest message/time range: she can save queries and just look (probably connecting and asking time range) for a store node likely to have the message
Solution 1: ask for re-broadcast
Alice cannot find the message, she asks in the group for a re-broadcast:
- Original sender may be the only one that tries to re-broadcast
- OR some logic for all group member to wait a random time and if such random time hit and no-one re-broadcast, proceed with re-broadcast
- re-broadcast means high bandwidth usage
- what if Alice missed thousands of messages? rate limit still applies
My conclusion:
- has potential
- but high impact on bandwidth makes it unlikely to be viable
- if Alice was offline long enough to miss a message not in store, then how likely it is she missed lots of messages?
- Still not clear how a rebroadcast would work as it would change the Waku message id, which I believe is used in the SDS causal history.
Solution 2: Alice checks on Codex (app logic)
Alice cannot find the message, was it stored on Codex?
Some assumptions:
- Messages are bundled on Codex after a while, similarly to how it is done for Status communities and BitTorrent
- Retrieval from BitTorrent is not driven by known missing message (SDS), but regular check from archive afaik, meaning high latency.
- There is some way for Alice to find the right bundle
- Alice needs to be able to directly access Codex network (not currently possible from the web, is it from mobile?)
- If Alice pays for download (I think not implemented now but future plan) she needs to be certain her message is in there
Solution 3: Store node checks on Codex
- There is a generalized protocol for messages to be archived on Codex
- A store node can check if a message is on codex
- Who pays for the generalized archiving → could be handled by app owner, store node just knows how to read codex archive
- who pays for download from codex - probably needs to be tied in with Waku incentivization
- Solves problem of accessibility from the web
Further thoughts
Keen to understand how 2 & 3 seem feasible from Codex and Waku PoV.
References
- [1] Scalable Data Sync specs docs: add SDS protocol for scalable e2e reliability by jm-clius · Pull Request #108 · vacp2p/rfc-index · GitHub