Fix lockpair in-param passing in EvaluateSequenceLocks() and other tidy-ups:
pass lockPair by reference to const instead of by value, per https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in
make nBlockTime const
rename lockPair to lock_pair
rename nBlockTime to block_time
add brackets to conditionals
add consensus/tx_verify.{h,cpp} to the iwyu (include what you use) CI checks, along with missing include headers to satisfy the checks
apply clang-format to consensus/tx_verify.{h,cpp}
refactor: consensus/tx_verify.{h,cpp} tidy-ups #24833
pull jonatack wants to merge 1 commits into bitcoin:master from jonatack:consensus-tx_verify-fixups changing 3 files +36 −28-
jonatack commented at 10:46 AM on April 12, 2022: contributor
- DrahtBot added the label Refactoring on Apr 12, 2022
- w0xlt approved
-
w0xlt commented at 3:22 PM on April 12, 2022: contributor
ACK https://github.com/bitcoin/bitcoin/pull/24833/commits/e6dde9a3e7aeb2eeb00950dd3a7231ae94d33017
But why is the first commit (https://github.com/bitcoin/bitcoin/pull/24833/commits/0b095dd52e846ae7c228bf52144d3470c34b00da) necessary ?
-
jonatack commented at 3:59 PM on April 12, 2022: contributor
Thanks @w0xlt! If your question is why are they considered to be missing, see doc/developer-notes.md:
- Every `.cpp` and `.h` file should `#include` every header file it directly uses classes, functions or other definitions from, even if those headers are already included indirectly through other headers. - *Rationale*: Excluding headers because they are already indirectly included results in compilation failures when those indirect dependencies change. Furthermore, it obscures what the real code dependencies are. -
DrahtBot commented at 6:13 PM on April 12, 2022: contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #24567 (Enforce BIP 68 from genesis by MarcoFalke)
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.
-
luke-jr commented at 2:23 AM on April 13, 2022: member
This is basically just formatting changes? Confused by calling it "fixups" - does it fix anything?
-
jonatack commented at 2:50 AM on April 13, 2022: contributor
It seemed like a good description for missing headers and how lockPair is passed; the last one is formatting.
-
maflcko commented at 7:22 AM on April 13, 2022: member
I find the include ones hard to review and there doesn't seem to be any benefit absent a report that compilation fails. If this is something we want to do, it might be better done via #24831. Otherwise we'll have daily pulls to "fix" the includes, remove random ones and add random ones without affecting the resulting binary and only causing merge conflicts.
-
jonatack commented at 10:01 AM on April 15, 2022: contributor
This has enough review for merge? See #24740 for a similar recent example.
(#24831 is a POC/draft; if it were to be merged at some point, we would still need to review the changes and this reduces the burden as that has already been done here.)
(If you disagree, please LMK how best to proceed most productively.)
-
fanquake commented at 11:28 AM on April 15, 2022: member
and this reduces the burden as that has already been done here.
This would still need to be touched again, as the includes fixups are not comprehensive. i.e:
<cassert>and<cstdint>are missing, among others. -
maflcko commented at 11:47 AM on April 15, 2022: member
This has enough review for merge? See #24740 for a similar recent example.
#24740 actually fixed an incorrect comment, whereas this pull doesn't fix anything that is wrong?
I don't have a strong opinion, but I still think we should first try iwyu and defer to it instead of doing it with manual review work. In the meantime it might be best to not touch the include stuff unless there is a reproducible compile error.
-
fanquake commented at 1:59 PM on April 21, 2022: member
Not sure what to do here. 0b095dd52e846ae7c228bf52144d3470c34b00da should probably either be updated to add all the missing includes, so we don't have to touch them again for IWYU, or be dropped. Besides that, as others have commented, it's not clear what is being fixed, given nothing seems to be broken, so maybe wordings can be improved.
- jonatack renamed this:
refactor: consensus/tx_verify.{h,cpp} fixups
refactor: consensus/tx_verify.{h,cpp} tidy-ups
on Apr 21, 2022 - jonatack force-pushed on Apr 21, 2022
-
jonatack commented at 2:26 PM on April 21, 2022: contributor
Sorry for not updating sooner. Added a cassert include to the cpp file and renamed the pull and second commit from fixups to tidy-ups. Happy to drop the first commit if preferred.
- DrahtBot added the label Needs rebase on May 6, 2022
- jonatack force-pushed on May 6, 2022
-
jonatack commented at 4:02 PM on May 6, 2022: contributor
Rebased.
- DrahtBot removed the label Needs rebase on May 6, 2022
- jonatack force-pushed on Jun 27, 2022
-
jonatack commented at 11:16 AM on June 27, 2022: contributor
Squashed the three commits down to one.
-
fanquake commented at 11:18 AM on June 27, 2022: member
This now contains unrelated changes. Looks like from a rebase.
-
jonatack commented at 11:31 AM on June 27, 2022: contributor
Thanks, which changes? I verified that a rebase to master would be clean but didn't rebase.
-
fanquake commented at 11:35 AM on June 27, 2022: member
Ah, don't worry, looks like it's just a GitHub bug.
-
jonatack commented at 11:36 AM on June 27, 2022: contributor
Cool. Happy to drop some of the diff if people prefer.
-
in src/consensus/tx_verify.cpp:25 in 585dd509e1 outdated
13 | @@ -14,7 +14,13 @@ 14 | #include <util/check.h> 15 | #include <util/moneystr.h> 16 | 17 | -bool IsFinalTx(const CTransaction &tx, int nBlockHeight, int64_t nBlockTime) 18 | +#include <algorithm> 19 | +#include <cassert> 20 | +#include <cstdint> 21 | +#include <utility> 22 | +#include <vector>
maflcko commented at 12:48 PM on June 27, 2022:I don't think we should be fixing up includes manually and review it manually, unless there is a reproducible bug.
I think, either this is done with iwyu in the CI task or not at all.
jonatack commented at 1:01 PM on June 27, 2022:Good point, SGTM, added the file to the CI to see (failing which will remove the added headers).
jonatack commented at 2:20 PM on June 27, 2022:Re-pushed with the changes suggested by iwyu.
jonatack force-pushed on Jun 27, 2022a02c0ccf88refactor: consensus/tx_verify.{h,cpp} tidy-ups
1. Fix lockpair in-param passing in EvaluateSequenceLocks() and other tidy-ups: - pass lockPair by reference to const instead of by value, per https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-in - make nBlockTime const - rename lockPair to lock_pair - rename nBlockTime to block_time - add brackets to conditional 2. add missing include headers to consensus/tx_verify.{h,cpp} and add the files to the iwyu (include what you use) CI checks 3. apply clang-format to consensus/tx_verify.{h,cpp}jonatack force-pushed on Jun 27, 2022DrahtBot commented at 9:15 PM on July 19, 2022: contributor<!--cf906140f33d8803c4a75a2196329ecb-->
🐙 This pull request conflicts with the target branch and needs rebase.
<sub>Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft".</sub>
DrahtBot added the label Needs rebase on Jul 19, 2022achow101 commented at 7:10 PM on October 12, 2022: memberClosing this as it has not had any activity in a while. If you are interested in continuing work on this, please leave a comment so that it can be reopened.
achow101 closed this on Oct 12, 2022bitcoin locked this on Oct 12, 2023Labels
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-14 21:13 UTC
More mirrored repositories can be found on mirror.b10c.me