src/init and src/policy directories.
src/init and src/policy
#33725
src/init and src/policy directories.
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/33725.
See the guideline for information on the review process.
| Type | Reviewers |
|---|---|
| Stale ACK | maflcko |
If your review is incorrectly listed, please react with π to this comment and the bot will ignore it on the next update.
Reviewers, this pull request conflicts with the following ones:
CBlockPolicyEstimator return sub 1 sat/vb fee rate estimates by ismaelsadeeq)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.
11+#include <primitives/transaction.h>
12 #include <tinyformat.h>
13+#include <txmempool.h>
14 #include <util/check.h>
15
16+#include <boost/multi_index/detail/hash_index_iterator.hpp>
nit in 30e5b015c973c1ac375e1eae6649238c6c2e2b28: This seems wrong, as there is no boost usage here?
See also my previous comment on this: #32668 (comment)
It’d also be good if that commit message was more explanatory:
Additional header changes were required due to visibility adjustments.
Which additional changes? What visibility adjustments?
It’d also be good if that commit message was more explanatory:
Additional header changes were required due to visibility adjustments.
Which additional changes? What visibility adjustments?
The commit message has been updated. Is it clearer now?
nit in 30e5b01: This seems wrong, as there is no boost usage here?
It is used as in https://github.com/bitcoin/bitcoin/blob/a36b9320300d1fa1e5dbd1b4d493acf3578ac11a/src/policy/truc_policy.cpp#L218 the type of mempool_ancestors.begin() is boost::multi_index::detail::hashed_index_iterator<...>.
However, the detail namespace should be hidden with a Boost-specifc mapping file.
It is used as in
I understand, but I wonder what value there is in listing the detailed internal boost includes. The mempool_ancestors already requires the txmempool.h include, which contains all required boost includes. No other module will have to include them to be able to compile.
To me those just seems like bloat for no benefit and the downside of making it harder to change a mempool implementation detail, because headers all over the codebase will have to be adjusted to please iwyu.
You’re right.
Reworked.
17@@ -18,9 +18,11 @@
18 #include <script/solver.h>
19 #include <serialize.h>
20 #include <span.h>
21+#include <util/check.h>
22
23 #include <algorithm>
24 #include <cstddef>
25+#include <span>
src/crypto.but the benefit of including span, when span.h is included, seems limited.
That is not the right rationale. Since span.h may get phased out by future refactoring, it is advantageous to have an indicator at the top of the file whether <span> is used purely directly or directly and indirectly.
To give a more concrete example: If I refactor a piece of code such that no code from span.h is used anymore, I want iwyu to tell me that the #include <span.h> directive can be removed. When that file exports symbols from <span>, it will depend on the include order whether iwyu will suggest the removal or not.
Yeah, I can see it both ways. I think the possible harm from including span.h over span is limited with this trivial header. Just noting I did the same with the time.h include: https://github.com/bitcoin/bitcoin/blob/3bb30658e631ed45b6c8609292facc7ae3dd0f61/src/util/time.h#L9
Also for the validation.h include: https://github.com/bitcoin/bitcoin/blob/3bb30658e631ed45b6c8609292facc7ae3dd0f61/src/validation.h#L19. There, the harm could be larger, as the validation header is a bit larger than the cs_main header, but it feels a bit verbose to redundantly include cs_main where validation is included.
Though, no strong opinion. This is just my thinking and anything is fine here, as long as reviewers are happy with it.
review ACK 8ae41ae6f2c2ccc129a84f8f2cc8ae415e2125e0 π
Signature:
0untrusted comment: signature from minisign secret key on empty file; verify via: minisign -Vm "${path_to_any_empty_file}" -P RWTRmVTMeKV5noAMqVlsMugDDCyyTSbA3Re5AkUrhvLVln0tSaFWglOw -x "${path_to_this_whole_four_line_signature_blob}"
1RUTRmVTMeKV5npGrKx1nqXCw5zeVHdtdYURB/KlyA/LMFgpNCs+SkW9a8N95d+U4AP1RJMi+krxU1A3Yux4bpwZNLvVBKy0wLgM=
2trusted comment: review ACK 8ae41ae6f2c2ccc129a84f8f2cc8ae415e2125e0 π
3/yGQlCLoD+y92eefuzREel2J883stbBwa/+Pt1X3bzg5mC8jGDGvjG7pgVwg7TuvT7ZyPcl1EZc2Tk7H1ZdqDg==
Headers that are no longer available via transitive includes are now
included directly in `bitcoin-tx.cpp` and sources in `src/test`.
this pull request conflicts with the following ones: #33629 (Cluster mempool by sdaftuar) #33591 (Cluster mempool followups by sdaftuar)
I think if you want to continue these refactors, it might be better if you picked code that doesn’t conflict with Cluster Mempool or Kernel work, or things we are trying to ship in v31. Could instead do directories that rarely change, like qt, or zmq?
223@@ -224,8 +224,10 @@ if [ "${RUN_TIDY}" = "true" ]; then
224 run_iwyu() {
225 mv "${BASE_BUILD_DIR}/$1" "${BASE_BUILD_DIR}/compile_commands.json"
226 python3 "/include-what-you-use/iwyu_tool.py" \
227- -p "${BASE_BUILD_DIR}" "${MAKEJOBS}" \
228- -- -Xiwyu --cxx17ns -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
229+ -p "${BASE_BUILD_DIR}" "${MAKEJOBS}" -- \
230+ -Xiwyu --cxx17ns \
231+ -Xiwyu --mapping_file="${BASE_ROOT_DIR}/contrib/devtools/iwyu/bitcoin.core.imp" \
232+ -Xiwyu --mapping_file=/include-what-you-use/boost-1.75-all.imp \
include-what-you-use/boost-1.75-all.imp
I guess this is still correct-enough to use here, but are we making any effort to usptream updates, given it’s 14 Boost releases out of date (current release is 1.89.0)? Seems possible that this could lead to incorrect IWYU suggestions, given any recent Boost refactorings?
this pull request conflicts with the following ones: #33629 (Cluster mempool by sdaftuar) #33591 (Cluster mempool followups by sdaftuar)
I think if you want to continue these refactors, it might be better if you picked code that doesn’t conflict with Cluster Mempool or Kernel work, or things we are trying to ship in
v31.
I agree, and when I noticed these conflicts, I checked that those PRs don’t have any ACKs yet.
Could instead do directories that rarely change, like
qt, orzmq?
Right.
common/ compat/ primitives/ script/ support/ util/ zmq/