-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Consensus: MOVEONLY: Move functions for header verification #8337
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
19ed8f4 to
8697b78
Compare
|
Each PR contains more things than the previous one. I could make them
|
|
A diff wrt. #8329 (since it builds on it) jtimon/bitcoin@jtimon:0.12.99-consensus-moveonly-tx...0.12.99-consensus-moveonly-header |
8697b78 to
d935e1d
Compare
|
Updated as independent from #8329 and #8328 (closed). |
d935e1d to
ffe96f0
Compare
|
needs rebase |
ffe96f0 to
6bd9296
Compare
|
Rebased. |
6bd9296 to
ee5ba72
Compare
ee5ba72 to
6d559b2
Compare
|
Verified it is move only. ACK |
|
utACK, move only 6d559b2af4925404ba2542d3c644da15a337dbc7 |
6d559b2 to
d324e01
Compare
|
Sorry for breaking the reviews, but it was suggested that declaring the functions in consensus/header_verify.h instead of consensus/consensus.h would be more clear. |
src/main.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.
same issue here. this should not be removed.
|
utACK d324e016a |
d324e01 to
6a66d7a
Compare
|
Fixed @morcos 's nit. |
|
utACK 6a66d7a242387ea73bf5f40154ef011b246c1a02 |
6a66d7a to
4d17675
Compare
|
Needed rebase after renaming main.o, see #9260 (although needed, the rebase was clean in this case) |
|
utACK 4d17675 |
4d17675 to
7365a8b
Compare
7365a8b to
dd7836a
Compare
ryanofsky
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.
utACK dd7836a confirmed move only.
| * Maximum amount of time that a block timestamp is allowed to exceed the | ||
| * current network-adjusted time before the block will be accepted. | ||
| */ | ||
| static const int64_t MAX_FUTURE_BLOCK_TIME = 2 * 60 * 60; |
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 commit "MOVEONLY: MAX_FUTURE_BLOCK_TIME to consensus/consensus.h"
Not sure if if it's exactly right to make this a consensus constant, because even in the worst case if this is set inconsistently, consensus should eventually be reached when system clock times catch up. IIRC, this was the reasoning @morcos gave me for not defining this constant in consensus.h.
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.
The goal is more to take it out of chain.h than to put it in consensus/consensus.h. consensus/header_verify would be fine as well. As an example, #8493 puts the check in libconsensus without putting chain.o in libconsensus too. Whether blocks eventually become valid when violating this rule or not, I think the question that should be asked is "in a hypothetical finished libconsensus, is this check included or not?", and I also think the answer is yes.
|
Needs rebase again and this was for #8493 anyway, closing. |
Moves code for header verification out of main, to consensus.
EDIT:
Partially replaces #7310, only for the header verification part.
Like in core_io.h we can separate the cpp files instead of using a single consensus.cpp.Continues #8329It's analogous to #8329 but with the functions necessary for VerifyHeader().