You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These approaches would further require adding a new enum variant Address to NoteTagSource (or potentially change NoteTagSource::Account to NoteTagSource::AccountIdAddress if we choose option 3).
Query the store for NoteTags based on the source.
This part could be potentially to be split out into a separate issue, depending on the decisions above^.
It would also be great if we could query the store for tags coming from a specific source.
This would allow us to limit the amount of notes downloaded from the note transport layer to only Address-derived tags. So in Fetch notes section here, instead of:
let note_tags:BTreeSet<NoteTag> = self.store.get_unique_note_tags().await?;// query the gRPC node for these note_tags AND query the transport layer for these tags
we could define a new store-querying source interface: NoteTagStoreSource:
pubenumNoteTagStoreSource{// name TBDAddress(AddressSource),Note(NoteSource),User(UserSource),}pubenumAddressSource{All,Exact(Address)}// etc. for NoteSource, UserSource
And then query as:
let public_note_tags:BTreeSet<NoteTag> = self.store.get_unique_note_tags().await?;// this doesn't change, gets all note tags// query the gRPC node for public_note_tagslet public_note_tags:BTreeSet<NoteTag> = self.store.get_unique_note_tags_from_source(NoteTagStoreSource::Address(AddressSource:All)).await?;// query the transport layer for private note tags
Address-derived vs.AccountId-derivedNoteTagThe tag derived from an
Addressis (potentially) different than the tag derived from anAccountId.Currently, when we add a new account to the client store, we fall back to
AccountId-derived tag (viaAccount->NoteTagRecordconversion): https://github.com/0xMiden/miden-client/blob/ba14ca5e765c7c81c45a56a7114b0a156374387b/crates/rust-client/src/account/mod.rs#L155But,
client.add_accountdoesn't provide any option to specify theAddressas a parameter.There are two paths:
add_account, derive the "default"Address::AccountIdAddressby passing in theAccountIdandAddressInterface::Unspecified.Addresses, for example by exposing a newadd_addressmethod, similar toadd_account. Potentially deprecateadd_account.add_accountto acceptAccountIdAddressinstead ofAccountId. This is akin to what @PhilippGackstatter suggested increate_p2id_noteshould takeAddressas parameter (or should it?) protocol#1837 (comment).These approaches would further require adding a new enum variant
AddresstoNoteTagSource(or potentially changeNoteTagSource::AccounttoNoteTagSource::AccountIdAddressif we choose option 3).Query the store for
NoteTags based on the source.This part could be potentially to be split out into a separate issue, depending on the decisions above^.
It would also be great if we could query the store for tags coming from a specific source.
This would allow us to limit the amount of notes downloaded from the note transport layer to only
Address-derived tags. So in Fetch notes section here, instead of:we could define a new store-querying source interface:
NoteTagStoreSource:And then query as: