Xahau / xahaud

Codebase for Xahaud - The consensus, RPC & blockchain app for the Xahau network.
https://xahau.network
ISC License
22 stars 11 forks source link

Report RPC `id` in follow up subscription reports too [XRPL+Xahau] #291

Open WietseWind opened 3 months ago

WietseWind commented 3 months ago

When you send an id in RPC commands, the repsonse contains the same id. Super useful because this way in middleware and as a client you know it's the reponse at whatever you flagged with the id.

If you start a subscription (e.g. pathfinding, ledger stream, ...) this id is lost in the subsequent subscription messages.

If you cater multiple clients from one piece of software, this makes it impossible to know which client to route the subscription message to.

Proposal:

  1. Report the id that was used to start the subscription in the subsequent subscription messages
  2. Allow for an unsubscribe based on that id (right now one has to specify the entire subscribe command as an unsubscribe, e.g. streams: ledger, accounts: [...] while if already reporting an id, one can immediately cancel out that entire subscription based on that id.

It would be most useful for all XRPL protocol networks, so this should be isolated as a change and PRred into rippled too.

dangell7 commented 3 months ago

Koen: If I subscribe to accounts and ledger, I get 2 transactions back but dont know which stream it came .

WietseWind commented 3 months ago

Koen: If I subscribe to accounts and ledger, I get 2 transactions back but dont know which stream it came .

Which would be solved too if the subscription referred to the id as well :)