-
Notifications
You must be signed in to change notification settings - Fork 38.7k
zmq: add rawmempooltx publisher #23624
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
Conversation
The rawtx ZMQ publisher publishes transactions added to the mempool and transactions in blocks. Often transactions are published multiple times. Some applications only want to subscribe to mempool transactions.
|
Have you seen #7753? |
|
For now, a workaround I found is to patch For reading only confirmed transactions (and throwing away the unconfirmed ones from the mempool), I believe a similar patch can be made to Of course, I know that such a modification cannot be merged, I'm just leaving this here for anyone else who finds themselves in a similar situation in the future. |
|
Concept ACK, I think having notifications to monitor the mempool makes sense, there has been interest in this in the past, I tried to do this at some point but lost interest. |
|
The mempool only contains unconfirmed transactions and I don't see that changing, therefore is the addition of the word "raw" to the flag/topic necessary? |
I think so, it tells you that it will send the raw bytes of the tx rather than the txid |
|
Concept ACK |
Good point. Though I think the use of "tx" and "txid" already provide context. |
|
This topic needs documentation and a rebase with #23471 merged. |
|
Concept ACK |
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
|
I haven't gotten around to pick this up again and will close it for now. It has a few Concept ACKs so might be worth adding an up-for-grabs label. |
This adds a
rawmempooltxpublisher that only notifies raw transactions that are added to the mempool. The existingrawtxpublisher notifies of transactions added to mempool and transactions appearing in blocks, causing raw transactions to often be published multiple times.This caused confusion in #23471 (comment), Ali Sherief [asked] for such a patch on the bitcoin-dev mailing list, and I've needed a ZMQ publisher for only mempool transactions multiple times. Also partially fixes #16180 from what I can tell.
I'll leave this as a draft for now until:
rawmempooltxI'd additionally find it useful to have an ZMQ multipart message part containing the transaction fee for mempool transactions. This requires us to change the interface though. I think this is out of scope for this PR.