-
Notifications
You must be signed in to change notification settings - Fork 38.6k
MOVEONLY: Move consensus functions out of main #7310
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
|
concept ACK, will review later |
|
utACK df57ab7 |
df57ab7 to
1c31e65
Compare
|
Rebased after #7287 has been merged. |
|
Also, in case it is useful to anyone, I have backported this with a few other merged consensus changes on top of 3cd836c (last-0.11.99) in 9877eb5 (on top of https://github.com/jtimon/bitcoin/commits/backports-0.12 ). |
|
re-ACK 1c31e65 MOVE-ONLY (bar 1 comment) |
|
So for TL; DR this moves the following functions to consensus:
AFAIK, all these functions are consensus critical. |
1c31e65 to
7c7cca2
Compare
|
EDIT: Rebase (1): Report non-mandatory script failures correctly #7276 |
7c7cca2 to
d0832f0
Compare
|
Rebased(8) [after #7184] |
src/test/transaction_tests.cpp
Outdated
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.
Shouldn't be part of a move only PR surely?
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.
In an older version I believe that allowed me to remove the main include, but since that's not the case anymore I guess I should leave this out.
|
Concept ACK. |
|
I always see the may15 tests |
Good catch. They were removed in #7490, and appear to be readded here. |
d0832f0 to
8f67d21
Compare
|
Oops, updated without nits. By the way, after #7184 I these two functions are moved as well: |
72f84d3 to
3a3cd39
Compare
|
Ping |
|
utACK 3a3cd39 |
src/consensus/consensus.h
Outdated
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.
I fail to see how this additional comment is move only. You may as well just keep it the way it was, as this comment is not adding much information.
Also two lines below this you are changing the white space. CValidationState &state.
Still, Concept ACK
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.
There's some other small documentation additions in consensus/consensus.h but they can all be postponed.
I'm happy to remove this extra doc line or any other as nit.
Regarding the withe space, the goal was to only change that kind of little style thing if it's to comply more with our style rules, but here I'm actually doing the opposite (https://github.com/bitcoin/bitcoin/blob/master/src/.clang-format#L41), so thank you for noticing on time. Probably lost in rebase at some point, I will change this.
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.
@jtimon I am happy to review again, if you stick to what is mentioned in the commit message... I mean, it is great that you are adding documentation and fixing white space but it is a lot harder to verify MOVEONLY if there are random changes in between.
There is no rule that says you can only use one commit per pull request. Each goal which can be achieved in a separate commit, should indeed go into a separate atomic commit. (This is not meant specifically for you but also for others, including me.)
3a3cd39 to
9001c60
Compare
|
@laanwj as predicted, people are afraid of doing this now to avoid "complicating backports" I keep thinking that just after branching is maybe the worse possible time for refactors. Closing for lack of interest (can reopen when there's more interest). |
|
@jtimon Yes sorry for that. On the other hand there's always some reason to delay stuff like this, at some point we have to just do it, "complicate backports" or not. |
|
Agreed, but apparently most potential reviewers disagree. |
Based on #7287 to avoid consensus/consensus.cpp having to depend on FormatStateMessage() (static function in main.cpp) temporarily.
This moves most of the remaining consensus-critical code in main.cpp to the consensus directory.
Even if I haven't published the promised document explaining the libconsensus longer term plan, all that is needed to review this is being able to tell whether all the moved functions are consensus critical or not; and then make sure that the code is only being moved without changes.
As other times, I have introduced trivial non-functional changes that those who check "moveonlyness" should notice.