Skip to content
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

Consensus: Remove ISM #8391

Merged
merged 1 commit into from
Aug 4, 2016
Merged

Consensus: Remove ISM #8391

merged 1 commit into from
Aug 4, 2016

Conversation

NicolasDorier
Copy link
Contributor

I hard coded ISM SF in regtest and adapted the tests.
Will try a sync on mainnet and testnet soon.

Note that even if the activation threshold (75% which enforce a rule for block version above a number) and enforcement threshold (95% reject old versions) are different, only the enforcement one really matter post fork.

flags |= SCRIPT_VERIFY_DERSIG;
}

// Start enforcing CHECKLOCKTIMEVERIFY, (BIP65) for block.nVersion=4
// blocks, when 75% of the network has upgraded:
if (block.nVersion >= 4 && IsSuperMajority(4, pindex->pprev, chainparams.GetConsensus().nMajorityEnforceBlockUpgrade, chainparams.GetConsensus())) {
if (block.nVersion >= 4 && pindex->nHeight >= chainparams.GetConsensus().BIP65Height) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually, I don't need to compare the version. BIP65Height represent the 95% threshold height, so the first condition is always true.

nFound;
pstart = pstart->pprev;
case 2:
activated = consensusParams.BIP34Height >= pindex->nHeight;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this comparison be the other way around?

@NicolasDorier
Copy link
Contributor Author

NicolasDorier commented Jul 22, 2016

  • Fixed the inverted condition of activation of ISM soft fork in RPC
  • Fix outdated rpc documentation for getblockchaininfo

@NicolasDorier NicolasDorier force-pushed the remove-ism branch 2 times, most recently from 4610c9f to 705d731 Compare July 22, 2016 12:55
@@ -817,22 817,23 @@ UniValue verifychain(const UniValue& params, bool fHelp)
}

/** Implementation of IsSuperMajority with better feedback */
static UniValue SoftForkMajorityDesc(int minVersion, CBlockIndex* pindex, int nRequired, const Consensus::Params& consensusParams)
static UniValue SoftForkMajorityDesc(int minVersion, CBlockIndex* pindex, const Consensus::Params& consensusParams)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"minVersion" is a bit confusing after this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would be better ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"version", like the caller SoftForkDesc

@NicolasDorier NicolasDorier force-pushed the remove-ism branch 2 times, most recently from eca5b6f to 316ecbd Compare July 22, 2016 14:32
/** Block height and hash at which BIP34 becomes active */
int BIP34Height;
uint256 BIP34Hash;
/** Block height at which BIP65 becomes active */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make an array with an enum, like with vDeployments. Say, vPastDeployments, vOldDeployments, vBuriedDeployments, or something of the sort.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer keeping change of logic and refactoring done in different PR. I want this PR to be easy to review, so I'm using the previous way of doing with BIP34Height.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, you can leave BIP34 as it is and put the new things in the array if you think that is less disruptive, no?
Anyway, if you feel strongly against doing it now, we can do it later. It's just feel cleaner not to put code to destroy it "right afterwards" (I can foresee the same "we can do the refactor later" argument when moving BIP113 there...).

@jtimon
Copy link
Contributor

jtimon commented Jul 22, 2016

utACK besides nits.

@NicolasDorier
Copy link
Contributor Author

NicolasDorier commented Jul 22, 2016

@NicolasDorier
Copy link
Contributor Author

NicolasDorier commented Jul 23, 2016

Sync of Testnet succeed, the Travis error is unrelated to this PR is it possible to run it again ? (still going on for mainnet)

@NicolasDorier
Copy link
Contributor Author

Intial sync of testnet and mainnet succeed.

@jtimon
Copy link
Contributor

jtimon commented Jul 26, 2016

Here are my proposed changes in code: jtimon/bitcoin@remove-ism...consensus-post-remove-ism

In any case, utACK 122786d

@sipa
Copy link
Member

sipa commented Jul 28, 2016

Note that #8418 adds a means to override the activation times for BIP9 activations in regtest mode. Perhaps a compatible approach can be followed here? Or is there no need for testing with different softforks activate in regtest?

@sipa
Copy link
Member

sipa commented Jul 31, 2016

utACK 122786d

@NicolasDorier
Copy link
Contributor Author

NicolasDorier commented Jul 31, 2016

I'll do a separate PR on top of this one for using the approach of #8418 alongs with @jtimon suggestion.
I prefer keeping this PR as simple as I can.

EDIT: something like NicolasDorier@e4844f7

@laanwj
Copy link
Member

laanwj commented Aug 4, 2016

ACK 122786d

@laanwj laanwj merged commit 122786d into bitcoin:master Aug 4, 2016
laanwj added a commit that referenced this pull request Aug 4, 2016
122786d Consensus: Remove ISM (NicolasDorier)
@sdaftuar
Copy link
Member

sdaftuar commented Aug 4, 2016

@morcos and I were discussing this, and I think this change is subtle enough that it deserves some kind of BIP write-up.

Technically this change is a hardfork: old ISM-based code, when presented with an alternate chain history in which one of these softforks activated earlier, would then reject a subsequent block that violated the softfork before the hardcoded heights here, whereas this code would not reject such a block (since the softfork would not yet be enforced). This seems like a fundamental consequence of removing the ISM code (excluding doing something like checkpointing the whole headers chain to detect this kind of thing, which seems like obvious overkill).

In my judgement this is fine, as by the time we deploy this code in 0.14, it'll have been over a year since the most recent one of these softforks deployed. But to further everyone's understanding of how these kinds of consensus changes are made (especially for future developers, as well as authors of alternate implementations) I think it'd be beneficial to document this change along with the considerations and rationale that went into it.

@jtimon
Copy link
Contributor

jtimon commented Aug 4, 2016

I agree a BIP makes sense.

@NicolasDorier
Copy link
Contributor Author

will write BIP

@mruddy mruddy mentioned this pull request Oct 18, 2016
codablock pushed a commit to codablock/dash that referenced this pull request Jan 20, 2018
122786d Consensus: Remove ISM (NicolasDorier)
andvgal pushed a commit to energicryptocurrency/gen2-energi that referenced this pull request Jan 6, 2019
122786d Consensus: Remove ISM (NicolasDorier)
random-zebra added a commit to PIVX-Project/PIVX that referenced this pull request Mar 18, 2020
8375bd8 [Tests] Use blocks v7 on regtest (random-zebra)
596902f [Core] Remove IsSuperMajority (random-zebra)
9cd2f81 [Consensus] Reject outdated blocks by enforcement height (random-zebra)

Pull request description:

  `IsSuperMajority` checks are slow, and not needed after enforcement.
  Also ISM is not a good mechanism for deployment, so will not likely be used again after BIP65.
  (based on bitcoin#8391)

  We should implement better fork signal/activation solutions such as [BIP 9](https://github.com/bitcoin/bips/blob/master/bip-0009.mediawiki) in the future.

  **Note:** testnet resync completed. currently checking resync on mainnet.

ACKs for top commit:
  furszy:
    Tested ACK 8375bd8
  Fuzzbawls:
    ACK 8375bd8

Tree-SHA512: 587b08ab25b92661a362494023d914af606acce5af8ddb9bd4f4f36dc9dd621c6d5dfbe2a530c73aab3e9c47af90a98ff319cd4116e72eff2fdb424f4df517bd
@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.

7 participants