Feature to subscribe based on attachment and tag, instead of just tag.
- Vorherrschende Sprache
- Rust
- Sterne
- 78
- Forks
- 129
- Ø Merge
- 4 T. 14 Std.
- Gemergte PRs (30 T.)
- 52
Beschreibung
### Feature description
In the current setup, clients can subscribe only to tags. Once the client receives all notes corresponding to a subscribed tag, it locally filters out the notes that are actually relevant to it.
This leads to unnecessary bandwidth usage, since the node may send a large number of notes that the client ultimately discards.
Based on the discussion from @bobbinth here:
https://github.com/0xMiden/miden-client/issues/2130#issuecomment-4338048109
I think we could support a more sophisticated subscription model where:
* the client subscribes to a note category (represented by the tag), and
* additionally provides filter inputs derived from the attachment data.
Under this model, the node would first match notes by tag, and then apply the attachment-level filters before forwarding notes to the client.
Conceptually, I am thinking about this similarly to how event subscriptions work in the EVM ecosystem:
* tags are analogous to contract addresses, and
* attachments are analogous to emitted event data/topics.
In that sense, clients would subscribe not just to a broad category, but to a filtered event stream, similar to how dapps consume indexed event data through subgraphs or indexing services.
One open question is whether this functionality belongs directly in the node, or whether it should live in a separate indexing sidecar.
A dedicated sidecar/indexer could provide:
* more advanced querying capabilities,
* richer filtering semantics,
* and potentially better scalability for sophisticated subscription patterns.
Beitragsleitfaden
Rechercherichtung
Überprüfen Sie die bestehende Abonnementlogik in der Client-Bibliothek, wahrscheinlich in einem Modul, das Notiz-Abonnements verwaltet. Verstehen Sie, wie Tags derzeit abgeglichen werden. Untersuchen Sie das verlinkte Issue #2130 für Kontext zur Anhangsdatenstruktur. Bestimmen Sie, wo Filtereingaben hinzugefügt werden müssen und wie der Node sie anwenden würde. Prüfen Sie, ob bereits Tests für Abonnementabläufe existieren, die erweitert werden können.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- api, backend, databases
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100