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
Multi address tracking #4137
Multi address tracking #4137
Conversation
ecf5a8a
to
72773cb
Compare
ddb94fa
to
41f731b
Compare
41f731b
to
78c19d3
Compare
I can see how this can be abused with no limits. Perhaps there needs to be a backend config with a default limit of 10 (or something) maximum subscriptions per client, with the possibility to raise the limits on servers dedicated to enterprise customers. |
I'm not sure this is any more vulnerable to abuse than individual subscriptions, and might actually be less so since it reduces the overhead of maintaining different websockets, although I suppose it depends how effective our rate limiting is for websocket initiations. We also improved performance and scalability quite a bit in #4095. |
ced2a49
to
fdf9053
Compare
rebased on current master |
Added a Attempts to subscribe to more than that number of addresses or scriptpubkeys will result in an error message returned in the websocket response object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
approve
8058dde
to
0cddfcf
Compare
Fixed bad error response and rebased on master |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested ACK @ [0cddfcf]
(builds on #4209)
This PR adds support for subscribing to multiple addresses and scripthashes over the websocket.
The behavior of the existing
track-address
subscription is unchanged.The PR adds two new subscriptions:
Each client may have one active subscription of each type (
track-address
,track-addresses
, andtrack-scriptpubkeys
). Subsequent requests replace open subscriptions of the same type.Sending a
track-addresses
ortrack-scriptpubkeys
request with an empty array payload ([]
) ends the current subscription.Relevant events are passed to subscribed clients under the
multi-address-transactions
andmulti-scriptpubkey-transactions
keys respectively, in the format:where for each subscribed address,
mempool
is a list of relevant new transactions entering the mempool,confirmed
is a list of transactions included in a new block, andremoved
is a list of transactions evicted from the mempool.Note that transactions may be
confirmed
without a corresponding priormempool
event.