doc: Fix several references in txmempool comments#21436
doc: Fix several references in txmempool comments#21436kiminuo wants to merge 1 commit intobitcoin:masterfrom
Conversation
d8a942c to
09adbcc
Compare
@JeremyRubin FWIW, I read the docs today - by chance and out of curiosity - and the documentation got me confused. So count me in. :)
👍 Fixed.
@jonatack My original goal was to learn more about mempool today, so my contribution here is meant as fixing "obviously wrong things" and certainly not details as I don't know them. There are two remaining cases returned by |
|
|
Also, please adjust the title to something more meaningful. Otherwise it will be hard to understand what the changes are by looking at the title. |
As I wrote above:
|
|
These mostly look like correct incremental improvements. I still worry the docs are generally stale/misleading, but that's a much larger effort that shouldn't preclude minor fixups. |
09adbcc to
106f9bb
Compare
| // we are sure that all in-mempool descendants have already been processed. | ||
| // This maximizes the benefit of the descendant cache and guarantees that | ||
| // CTxMemPool::m_children will be updated, an assumption made in | ||
| // CTxMemPoolEntry::m_children will be updated, an assumption made in |
There was a problem hiding this comment.
while here maybe refactor into a doxygen comment
There was a problem hiding this comment.
+1, I think the assumptions made by the function are something that should be in the doxygen comment above its signature in txmempool.h
There was a problem hiding this comment.
ACK 106f9bb
The new comments look correct to me. Feel free to ignore my suggestions, they're just my opinions.
Edit: also, if you have the chance in this PR or another, should remove all mentions of mapLinks as a followup to #19478 #21436 (comment)
| // we are sure that all in-mempool descendants have already been processed. | ||
| // This maximizes the benefit of the descendant cache and guarantees that | ||
| // CTxMemPool::m_children will be updated, an assumption made in | ||
| // CTxMemPoolEntry::m_children will be updated, an assumption made in |
There was a problem hiding this comment.
+1, I think the assumptions made by the function are something that should be in the doxygen comment above its signature in txmempool.h
src/txmempool.h
Outdated
| * errString = populated with error reason if any limits are hit | ||
| * fSearchForParents = whether to search a tx's vin for in-mempool parents, or | ||
| * look up parents from mapLinks. Must be true for entries not in the mempool | ||
| * look up parents from CTxMemPoolEntry::m_parents. Must be true for entries not in the mempool |
There was a problem hiding this comment.
This is just my opinion, but I think it's more helpful to refer to the specific parameter here. Same thing for the other docs.
| * look up parents from CTxMemPoolEntry::m_parents. Must be true for entries not in the mempool | |
| * look up parents from entry.m_parents. Must be true for entries not in the mempool |
There was a problem hiding this comment.
I think the suggestion is very good in general. But let me just show what I would actually love:
* look up parents from <see cref="entry.m_parents"/>. Must be true for entries not in the mempool(Syntax borrowed from C#)
This is, of course, just made up syntax but it would be great to reference parameter's member (m_parents) in Doxygen. The only problem is that I'm unable to find the syntax for Doxygen, if it actually supports it.
Do you possibly know?
There was a problem hiding this comment.
🎉 \link CTxMemPoolEntry::m_children updateIt.m_children \endlink seems to do the job.
Resources:
- https://www.doxygen.nl/manual/autolink.html
- https://www.doxygen.nl/manual/examples/autolink/html/class_autolink___test.html
Edit: This is an example from generated Doxygen page:
There was a problem hiding this comment.
Not sure if there have been discussions about this, but my feeling is that most devs read the source rather than the actual doxygen-generated file (at least I do), so I don't like special commands like \link ... \endlink that improve the doxygen-generated documentation, but come at the cost of disturbing the reading flow when looking at the source.
There was a problem hiding this comment.
I understand your point of view. An alternative point of view is that doxygen can warn us that a reference no longer exists so that it can be fixed in a PR and it would not be necessary to dig where something changed and why (this PR).
Personally, I don't think it would be that bad to have \link ... \endlink (I agree it's not visually nice). However, we already use doxygen syntax so a clear rule explaining why this is "too much" should be presented I think.
Having said that, I can remove it if you insist but I would rather not.
…data structure member)
106f9bb to
e54a411
Compare
|
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. |
|
Remove other mentions of mapLinks as well? #21436 (comment) |
I'm not sure how to fix it really as I said here: #21436 (comment) and here #21436 (comment). I'm open to suggestions! |
|
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |

It seems that not all documentation comments were updated in #19478 correctly.