Replace BIP34: Require height commitment in the generation transactions's locktime instead#3
Conversation
| // Enforce rule that the coinbase starts with serialized block height | ||
| if (nHeight >= consensusParams.BIP34Height) | ||
| { | ||
| if (block.nTime >= consensusParams.HardforkTime) { |
There was a problem hiding this comment.
This is just part of a larger hardfork. The height isn't known at header-validation time.
There was a problem hiding this comment.
how is the height not known at header-validation time? Don't you know the height of your predecessor block?
There was a problem hiding this comment.
I'm referring to CheckBlockHeader, not ContextualCheckBlockHeader. This would mean we cannot verify the PoW until we have the block context, which could possibly (?) make a DoS vector. (But maybe some restructuring of the code to ignore all headers without context makes sense?)
There was a problem hiding this comment.
In any case, there's little harm to using time here. This is intended to only be deployed after the final SHA2 block is found, which means there is a very well-defined time to specify (in fact, PR #2 requires the time specified is exactly the second after the final SHA2 block). No real benefit to using height.
No description provided.