#35480 doc: document ZMQ notification behavior during reorgs and evictions
https://github.com/bitcoin/bitcoin/pull/35480 · · +74/-0 in 2 files, 2 commits · labels: Docs
Goal
- Document existing ZMQ notification behavior during chain reorgs and mempool evictions
- Clarify sequence order and event coverage for developers of external services and indexers
Expands `doc/zmq.md` to document ZMQ notification behavior during chain reorganizations and mempool evictions, including re-publication on `rawtx`/`hashtx`, suppression under assumeutxo background validation, and mempool removal reasons under `sequence`. It also adds a functional test verifying the ordering of `D`, `R`, and `C` events on the `sequence` topic during a reorg.
Problem: ZMQ behavior during chain reorganizations and mempool evictions was implemented in the source code but undocumented, forcing external client developers to deduce notification guarantees directly from C++ internals.
Category: Documentation (#5 of 9)
P3 · cleanup
- P3 because it clarifies undocumented ZMQ behavior during reorgs, evictions, and assumeutxo
- Prevents downstream service developers and indexers from making incorrect assumptions
P3 because it documents previously undocumented ZMQ behavior during reorgs and mempool evictions, partially addressing tracking issue #14278. While valuable for external developers building services on Bitcoin Core's ZMQ feed, the lack of this documentation does not cause node crashes or fund safety risks.
Membership: Updates doc/zmq.md and carries the Docs label.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 1
Category: RPC / REST / ZMQ (#44 of 52)
P4 · test coverage
- P3 because it pins existing ZMQ notification ordering behavior with functional tests
- Validates the interface without changing any core RPC or ZMQ source code
P4 because no RPC or ZMQ interface or code logic is modified; it only documents existing behavior and adds functional test coverage verifying sequence notification order during reorgs.
Membership: Documents ZMQ notification semantics and adds a functional test to test/functional/interface_zmq.py.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0
Reviewability: Ready
- Ready for review
- All reviewer suggestions addressed with wording updates and a new functional test
The PR is ready for review; CI is passing, there are no merge conflicts, and the author addressed initial reviewer feedback by adding the requested functional test.
Author status: active, pushed commits implementing reviewer suggestions
Resolved concerns:
- sedited asked for a functional test to exercise the claimed reorg notification ordering before documenting it; author added test_reorg_eviction_ordering in commit 6379cce4eb.
Agreement: Mild
- Constructive feedback requesting text condensation and a functional test (sedited)
- Author implemented all requested changes with no further follow-up yet
Mild: nonblocking objection open (sedited)
Nobody has yet provided an ACK for the overall PR, and the one nonblocking request from sedited to back up the documentation with a test was addressed by the author.
- sedited suggested collapsing wording on removal notifications and asked for a test for reorg sequence ordering (2026-07-24)
- fernandguil force-pushed commits adding test_reorg_eviction_ordering and incorporating the suggested wording (2026-08-13, 2026-08-28)
Objections:
| Reviewer | Kind | Harm | Status | Blocking | Author replied | Quote |
|---|---|---|---|---|---|---|
| sedited | correctness | documenting notification ordering guarantees without automated test coverage to ensure the behavior holds | open | no | no | 2026-07-24 'I would only claim this in the docs, if there is a corresponding functional test exercising this.' Settled: 2026-08-13 commit 6379cce4eb 'test: check sequence notification ordering during a reorg' added test_reorg_eviction_ordering |
Participants: sedited (objection)
State derived from the lists: nonblocking objection open (sedited) (model's own read: Neutral)
Review verdicts (DrahtBot): 0
Files
59 lines under test/bench/ci.
- test/functional/interface_zmq.py +59/-0
- doc/zmq.md +15/-0
Card
This PR expands doc/zmq.md to explain node notification behavior during chain reorgs and mempool evictions, and adds a functional test in test/functional/interface_zmq.py to verify reorg event ordering on the sequence topic. It clarifies that rawtx and hashtx re-publish transactions from disconnected blocks, suppresses them for assumeutxo background validation, and documents the D-R-C notification order. The documentation addresses part of open issue #14278. Review is ready, with the author having pushed the test requested by sedited.