-
Notifications
You must be signed in to change notification settings - Fork 570
[ppcoin v0.6] Prevent premature activation of BIP34 softfork #132
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
src/kernel.h
Outdated
| // Whether a given transaction is subject to new v0.5 protocol | ||
| bool IsProtocolV05(unsigned int nTimeTx); | ||
| // Whether a given block or transaction is subject to new v0.6 protocol | ||
| bool IsProtocolV06(unsigned int nTimeTx); |
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.
This appears to refer to block timestamp only for the version requirements of blocks (iirc version 2 adds block height info to coinbase)
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.
So better use nTimeBlock instead?
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 didn't notice the difference between nTimeBlock and nTimeTx.
Why would you ever use nTimeTx?
It is not reliable as the sender can pick any time he likes.
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.
For v0.5 it's only supposed to be used for coinstake transactions I think, whose nTime cannot be picked arbitrarily
|
Changed to nTimeBlock |
|
On second thought, why do we need to make a hard fork upgrade for this feature, as the purpose of IsSuperMajority() is to allow miners/pools to migrate at their own schedule? |
|
I can understand it's a problem on testnet, our testnet has no mining majority as likely no one is mining on testnet most of times, so if your new node mines 100 blocks your node would falsely think 'the majority' has upgraded so it starts rejecting other miners' blocks |
|
It is not hard fork, it is a soft fork. The v06 activation time prevents the softfork from being activated prematurely, which happens on testnet and therefore testnet fails to sync. Just try to sync the testnet with the client without this fix, you'll see. IsSuperMajority() check both PoW and PoS blocks, it's not about miners only on peercoin. |
|
Yes, I meant both miners and minters. If I understand correctly, is it not only limited to testnet? On the testnet, isn't it only a problem as there is no consistent minting/mining body? Or else how did you reach 75 blocks of 100 to trigger the enforcement of version 2 blocks? What was the concern such that mainnet must use a delayed turn-on of this feature? |
|
The soft fork get's activated on testnet because someone experimented with version 2 blocks on it. What alternative do you suggest? |
|
I am thinking maybe we should choose only one of the two: |
|
I don't know if you see that this pull request currently implements a) using bitcoin's IsSuperMajority() I believe we should go for a) if we won't make any protocol changes anymore, as it would allow old clients to still validate the chain, they will just fail to mint. I agree that if we are going to hard fork for other reasons, we should hard fork this change too. Because all of this is not yet clear, I suggest to just merge this pull request. Currently the soft fork is disabled anyway (see code snippet below). At least we'll have a working client on testnet, I've been running and minting with this code on testnet for a few weeks now. |
On testnet, the BIP34 softfork get's accidently activated prematurely. Probably due to experimentation with the version number on testnet.
A protocol v0.6 switchtime should still be decided on.
Note that BIP34 is just a soft fork, legacy clients will still accept blocks created after activation.