doc: ZMQ documentation fix regarding topics #24318

pull dev7ba wants to merge 1 commits into bitcoin:master from dev7ba:zmqDocFix changing 1 files +4 −3
  1. dev7ba commented at 3:51 PM on February 11, 2022: none

    Rationale: Part of the bitcoin zmq interface documentation regarding topics can be improved to avoid ambiguity, this can save time for other people using this interface.

    The main point is that rawTx or hashTx topics notifies about all transactions, both when they are added to mempool or when a block has been disconnected ( as opposed to when a block arrives as in current documentation).

    Also, when a block is disconnected only the transactions that were not in the mempool already are notified.

    Finally, I've added a clarification about the expected sequence of topics when a chain reorganization occur:

    The secuence of topics when a chain reorganisation occur is the following: first arrives all block disconnections, then transactions not already in our mempool from the disconnected blocks are notified, and finally, the new blocks overriding the disconnected ones.

  2. ZMQ documentation fix regarding topics 1fb18f4e8c
  3. dev7ba marked this as ready for review on Feb 11, 2022
  4. laanwj added the label Docs on Feb 11, 2022
  5. 0xB10C commented at 9:35 AM on February 12, 2022: member

    Thanks for improving the ZMQ documentation. Will review soon.

    ref #23471 (a recent, merged ZMQ doc improvement)

  6. in doc/zmq.md:107 in 1fb18f4e8c
     103 | @@ -104,15 +104,14 @@ The topics are:
     104 |  
     105 |  Where the 8-byte uints correspond to the mempool sequence number.
     106 |  
     107 | -`rawtx`: Notifies about all transactions, both when they are added to mempool or when a new block arrives. This means a transaction could be published multiple times. First, when it enters the mempool and then again in each block that includes it. The messages are ZMQ multipart messages with three parts. The first part is the topic (`rawtx`), the second part is the serialized transaction, and the last part is a sequence number (representing the message count to detect lost messages).
    


    luke-jr commented at 1:36 AM on February 13, 2022:

    Does this functionality (tx events for every tx in a block) not work?


    dev7ba commented at 8:49 AM on February 14, 2022:

    It doesn't work. I've never seen that behavior. I changed from mempool long pooling to zmq interface on november 2020. Maybe it worked before, maybe not, and that's the expected behavior and it's wrong explained in the docs.

    For me, the actual behaviour it's fine, and the one explained in the docs it's trickier, since it forces you into checking if an incoming transaction is from last block or was added to mempool to be mined.


    0xB10C commented at 10:45 AM on February 16, 2022:

    Which Bitcoin Core version (e.g. v22.0 or a master build) are you running?

    Last time I checked this functionality (mempool + block tx via rawtx) did work. IIRC the rawtx topic gave me both mempool and block tx around taproot activation. I remember adding a custom ZMQ publisher for my taproot activation monitoring livestream to either v22 or master. I also PR'ed a WIP implementation of a rawmempooltx publisher in #23624 as other users were getting mempool and block transactions through rawtx too, but were only looking for mempool transactions.


    dev7ba commented at 12:18 PM on February 16, 2022:

    Currently running v22.0. But I've used hashtx. Different behaviors for each one? I'm going to do tests for both and comment here the results ASAP.

  7. luke-jr changes_requested
  8. luke-jr commented at 1:36 AM on February 13, 2022: member

    At least spellcheck it too

  9. dev7ba commented at 1:04 PM on February 16, 2022: none

    I was using the sequence topic, nor rawTx or hashTx. Documentation was right. Sorry for the inconvenience.

  10. dev7ba closed this on Feb 16, 2022

  11. dev7ba deleted the branch on Feb 16, 2022
  12. dev7ba restored the branch on Feb 16, 2022
  13. DrahtBot locked this on Feb 16, 2023
Labels

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-22 18:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me