-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose get_notes_by_id()
to selectively get a note from a miden node
#354
Comments
@daedlock
do you mean the network + memory overhead, or do you mean literally storing them in the database (this last one shouldn't be the case but perhaps we're missing a use case where this happens)? Lastly if it's something that's blocking you there is a workaround to work with in the meantime which is to create a separate |
I had a similar question: would it make sense to use the |
A little bit of context: We are building an orderbook where there will be a backend service responsible for routing, matching orders in addition to maintaining and updating orderbook state. Traders will interface with such service to request information that will allow them to execute trades. A trader would typically receive note_ids they need to consume in order to fill their order.
Trader's client will use
Yes, I think so. The assets and recipient should be enough to allow traders to build consumption transactions.
All of the above. Having the trader's client to track a static tag means that the client has to fetch, process, store all the notes which involves network, cpu, memory and storage. If I am not mistaken, this is an unneeded overhead specially when the orderbook gets bigger and bigger in the future.
Thanks! @bobbinth mentioned this to me yesterday. I will give it a try, but I assume I will have to take care of the deserialization part? |
Yeah, the client does check that well-known note types (like P2ID) are consumable by the client's accounts before adding them to the store. However, right now, for more custom-type notes, it can't decide whether a note relevant so it stores them by default anyway.
The |
The notes in my use case are consumable by any account, it's a modified swap note basically representing a limit order.
Got it thanks. One question however, what are the cons/downsides of exposing the |
For me the only issue regarding that, is that we end up with different ways of achieving the same action (either instantiating the RPC client or calling The
Does the trader's client actually run a TX via the client? Or does it submit a TX request to the backend service and that takes care of executing the transaction? In case of the former, the store still needs to be updated with both the note's inclusion proof in its block and the block's inclusion proof in the Node's MMR in order to consume the note. |
I think this boils down to what is the reason for getting the note by ID:
|
@daedlock did the above solve your issue? |
Yes. I made it work via TonicRpcClient. Can be closed nowSent from my iPhoneOn 17 Jun 2024, at 12:48 PM, Dominik Schmid ***@***.***> wrote:
@daedlock did the above solve your issue?
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Is already being addressed as part of #375 |
Feature description
Right now, the only way to fetch notes from a node is via tags. However, this might not be the desired way of selectively fetching a specific note if other notes share the same tag. Exposing
get_notes_by_id()
to the public api could be beneficial.Why is this feature needed?
If a client is interested in individual notes, they should not be forced to fetch and keep track of other notes sharing the same tag as this will add unneeded storage overhead.
The text was updated successfully, but these errors were encountered: