0xMiden / 0xMiden/rust-sdk

Feature to subscribe based on attachment and tag, instead of just tag.

Offen
#2,209 4 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
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

Beitragsleitfaden öffnen

Rechercherichtung

Review the existing subscription logic in the client library, likely in a module handling note subscriptions. Understand how tags are currently matched. Examine the linked issue #2130 for context on attachment data structure. Determine where to add filter inputs and how the node would apply them. Check if there are existing tests for subscription flows to extend.

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

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.