Skip to content

Conversation

@jtimon
Copy link
Contributor

@jtimon jtimon commented Jul 13, 2016

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 #8329
It's analogous to #8329 but with the functions necessary for VerifyHeader().

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 19ed8f4 to 8697b78 Compare July 14, 2016 02:09
@jtimon jtimon changed the title Consensus: MOVEONLY: Move functions for tx verification Consensus: MOVEONLY: Move functions for header verification Jul 14, 2016
@jonasschnelli
Copy link
Contributor

This PR contains identical commits then #8328 and #8329.
Can you explain why there are multiple PRs?
IMO opening a single small PR and trying to get this merge would be more efficient (and only open/PR further work when the first part has been merged).

@jtimon
Copy link
Contributor Author

jtimon commented Jul 14, 2016

Each PR contains more things than the previous one. I could make them
independent for easier review instead of each one building on top of the
previous, but that would more work. Or I can just close them. Only the
first one seems to be getting any review anyway...
On Jul 14, 2016 1:52 PM, "Jonas Schnelli" [email protected] wrote:

This PR contains identical commits then #8328
#8328 and #8329
#8329.
Can you explain why there are multiple PRs?
IMO opening a single small PR and trying to get this merge would be more
efficient (and only open/PR further work when the first part has been
merged).


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#8337 (comment), or mute
the thread
https://github.com/notifications/unsubscribe/AA9jSkECkHcKe1bhOGYzTNkqWpxVKaa2ks5qViK9gaJpZM4JLak4
.

@afk11
Copy link
Contributor

afk11 commented Jul 14, 2016

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 8697b78 to d935e1d Compare July 14, 2016 22:49
@jtimon
Copy link
Contributor Author

jtimon commented Jul 14, 2016

Updated as independent from #8329 and #8328 (closed).
@afk11 Thanks for the selected diffs, I think they're very useful for review.
Perhaps I should do the same on any PR I make dependent on another one.
But please keep looking for diffs you think you're interesting, I'm always open to squashes and interactive rebasing for things that have not been merged.

@btcdrak
Copy link
Contributor

btcdrak commented Aug 29, 2016

needs rebase

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from ffe96f0 to 6bd9296 Compare August 30, 2016 12:21
@jtimon
Copy link
Contributor Author

jtimon commented Aug 30, 2016

Rebased.

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 6bd9296 to ee5ba72 Compare August 31, 2016 21:12
@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from ee5ba72 to 6d559b2 Compare September 1, 2016 16:21
@CodeShark
Copy link
Contributor

Verified it is move only. ACK

@btcdrak
Copy link
Contributor

btcdrak commented Oct 10, 2016

utACK, move only 6d559b2af4925404ba2542d3c644da15a337dbc7

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 6d559b2 to d324e01 Compare October 20, 2016 01:35
@jtimon
Copy link
Contributor Author

jtimon commented Oct 20, 2016

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
Copy link
Contributor

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.

@morcos
Copy link
Contributor

morcos commented Nov 27, 2016

utACK d324e016a

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from d324e01 to 6a66d7a Compare November 27, 2016 19:02
@jtimon
Copy link
Contributor Author

jtimon commented Nov 27, 2016

Fixed @morcos 's nit.

@NicolasDorier
Copy link
Contributor

utACK 6a66d7a242387ea73bf5f40154ef011b246c1a02

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 6a66d7a to 4d17675 Compare December 3, 2016 06:16
@jtimon
Copy link
Contributor Author

jtimon commented Dec 3, 2016

Needed rebase after renaming main.o, see #9260 (although needed, the rebase was clean in this case)

@dcousens
Copy link
Contributor

utACK 4d17675

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 4d17675 to 7365a8b Compare March 23, 2017 19:03
@jtimon
Copy link
Contributor Author

jtimon commented Mar 23, 2017

Needed rebase after #9908 and after [some other PR to locate that introduces the assert in ContextualCheckBlockHeader].
After #9908 , added a commit to move MAX_FUTURE_BLOCK_TIME from chain.h to consensus/consensus.h

@jtimon
Copy link
Contributor Author

jtimon commented May 18, 2017

Needed trivial rebase in the makefile after #8329 was merged. For next rebase (which will hopefully be needed soon, see #9717 and #10339 ), I'm thinking of directly moving CheckBlockHeader to pow.o instead of consensus/header_verify.o. People are even talking about removing it. Thoughts?

@jtimon jtimon force-pushed the 0.12.99-consensus-moveonly-header branch from 7365a8b to dd7836a Compare May 18, 2017 20:38
Copy link
Contributor

@ryanofsky ryanofsky left a 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;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@jtimon
Copy link
Contributor Author

jtimon commented Jun 19, 2017

Needs rebase again and this was for #8493 anyway, closing.

@jtimon jtimon closed this Jun 19, 2017
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants