-
Notifications
You must be signed in to change notification settings - Fork 38.7k
refactor: consensus/tx_verify.{h,cpp} tidy-ups #24833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
w0xlt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Thanks @w0xlt! If your question is why are they considered to be missing, see doc/developer-notes.md: |
|
@jonatack Thanks for the explanation. |
|
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. |
|
This is basically just formatting changes? Confused by calling it "fixups" - does it fix anything? |
|
It seemed like a good description for missing headers and how lockPair is passed; the last one is formatting. |
|
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. |
|
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.) |
This would still need to be touched again, as the includes fixups are not comprehensive. i.e: |
#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. |
|
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. |
e6dde9a to
5972ba4
Compare
|
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. |
5972ba4 to
16e9e1b
Compare
|
Rebased. |
16e9e1b to
585dd50
Compare
|
Squashed the three commits down to one. |
|
This now contains unrelated changes. Looks like from a rebase. |
|
Thanks, which changes? I verified that a rebase to master would be clean but didn't rebase. |
|
Ah, don't worry, looks like it's just a GitHub bug. |
|
Cool. Happy to drop some of the diff if people prefer. |
585dd50 to
cce8fbd
Compare
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}
cce8fbd to
a02c0cc
Compare
|
🐙 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". |
|
Closing 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. |
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}