Skip to content

Conversation

jnewbery
Copy link
Contributor

@jnewbery jnewbery commented Feb 5, 2018

This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66.

Both CSV and segwit have been active for over 8 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt.

@jtimon
Copy link
Contributor

jtimon commented Feb 5, 2018

This will need rebase after #11739 , won't it?

@jnewbery
Copy link
Contributor Author

jnewbery commented Feb 5, 2018

This will need rebase after #11739 , won't it?

There are no dependencies between the two, but you're correct that there are some minor conflicts in the implementations. I'm happy to rebase if 11739 is merged first.

rv.push_back(Pair("reject", SoftForkMajorityDesc(version, pindex, consensusParams)));
return rv;
rv.pushKV("type", "buried");
rv.pushKV("type", "buried");
Copy link
Member

Choose a reason for hiding this comment

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

Duplicated line?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes? :trollface:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -59,6 +59,11 @@ void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64
consensus.vDeployments[d].nTimeout = nTimeout;
}

void CChainParams::UpdateSegwitHeight(const int& height)
Copy link
Contributor

Choose a reason for hiding this comment

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

Any good reason for reference?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

None. Removed.

@@ -58,6 +56,10 @@ struct Params {
int BIP65Height;
/** Block height at which BIP66 becomes active */
int BIP66Height;
/** Block height at which CSV becomes active */
int CSVHeight;
/** Block height at which Segwit 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.

Is it helpful to continue referencing the BIP numbers in these comments? I would guess so.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Comments added.

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not refer to the BIP numbers solely instead of alternating?

Copy link
Member

Choose a reason for hiding this comment

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

the segwit deployment covered more than one bip

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from caab009 to 32cbe48 Compare February 8, 2018 21:27
Copy link
Contributor

@jamesob jamesob left a comment

Choose a reason for hiding this comment

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

Concept ACK 32cbe48

rv.pushKV("type", "buried");
// getblockchaininfo reports the softfork as active from when the chain height is
// one below the activation height
rv.push_back(Pair("active", chainActive.Tip()->nHeight + 1 >= height));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: any reason this isn't just rv.pushKV("active", ...); for consistency?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Requires #12193

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ah. It's just been merged. Will rebase.

" \"chainwork\": \"xxxx\" (string) total amount of work in active chain, in hexadecimal\n"
" \"pruned\": xx, (boolean) if the blocks are subject to pruning\n"
" \"pruneheight\": xxxxxx, (numeric) lowest-height complete block stored\n"
" \"softforks\": { (object) status of softforks\n"
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't seem to have any testing for the contents of this key - is this the case? Happy to either write some for this PR or file a follow-up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. rpc_blockchain.py should be updated. If you're happy to contribute a commit to add tests, I can include it in this PR.

@@ -1160,36 +1155,28 @@ UniValue getblockchaininfo(const JSONRPCRequest& request)
" \"difficulty\": xxxxxx, (numeric) the current difficulty\n"
" \"mediantime\": xxxxxx, (numeric) median time for the current best block\n"
" \"verificationprogress\": xxxx, (numeric) estimate of verification progress [0..1]\n"
" \"initialblockdownload\": xxxx, (bool) (debug information) estimate of whether this node is in Initial Block Download mode.\n"
Copy link
Contributor

@jamesob jamesob Feb 12, 2018

Choose a reason for hiding this comment

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

Curious why removal of this key and others (e.g. size_on_disk) is bundled with this changeset. Seems like RPC interface changes should be handled separately.

Edit: looks like these were just removed from the help message; still probably don't want to do that in this changeset, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops. Bad rebase. Should be fixed now.

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch 2 times, most recently from 07f8153 to 0be1f9d Compare February 13, 2018 16:08
@jnewbery
Copy link
Contributor Author

Rebased now that #12193 has been merged.

ACK @jamesob's 0be1f9d8a6bb2b8c47d6816b46d6764aee3cc06e commit.

@jamesob jamesob force-pushed the bury_bip9_deployments branch from 0be1f9d to 916aa73 Compare February 13, 2018 20:17
@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from 916aa73 to 0be1f9d Compare February 13, 2018 20:22
@jamesob
Copy link
Contributor

jamesob commented Feb 14, 2018

Biased ACK 0be1f9d

@jtimon
Copy link
Contributor

jtimon commented Feb 14, 2018

utACK 0be1f9d8a6bb2b8c47d6816b46d6764aee3cc06e

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from 0be1f9d to 818b7af Compare March 7, 2018 18:39
@jnewbery
Copy link
Contributor Author

jnewbery commented Mar 7, 2018

rebased

@jamesob jamesob force-pushed the bury_bip9_deployments branch from 818b7af to 3abc65f Compare March 8, 2018 15:35
@jamesob
Copy link
Contributor

jamesob commented Mar 8, 2018

Rebased.

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from 3abc65f to fc32e68 Compare March 19, 2018 13:31
@jnewbery
Copy link
Contributor Author

Rebased

@@ -1158,6 +1159,21 @@ bool AppInitParameterInteraction()
}
}
}

Copy link
Contributor

@jtimon jtimon Mar 19, 2018

Choose a reason for hiding this comment

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

This can be done directly in CRegtestParams's constructor, that way, the function UpdateSegwitHeight would not be needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Seems like a good idea, but segwit height is also updated in one of the unit tests:

https://github.com/bitcoin/bitcoin/pull/12360/files#diff-d5ba361c5f8be78eb4cc0c787c1fc78eR118

I think we need the UpdateSegwitHeight() function call there.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess we still need UpdateSegwitHeight() then, or perhaps we can pass the other args (instead of g_args, or rather g_args plus "-segwitheight=432") to SelectParams in https://github.com/bitcoin/bitcoin/pull/12360/files#diff-d5ba361c5f8be78eb4cc0c787c1fc78eR54 ?
I guess not all BasicTestingSetup want 432 there...

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 think I'll leave it as is for now. It may be possible to tidy this up in a future commit.

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from fc32e68 to 49c5e7d Compare March 27, 2018 13:35
@jnewbery
Copy link
Contributor Author

Rebased

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from 49c5e7d to 2507a45 Compare March 29, 2018 14:56
@jnewbery
Copy link
Contributor Author

rebased

@maflcko
Copy link
Member

maflcko commented Jun 6, 2018

Could the rpc changes potentially be split up into a separate pull request, to not distract from the consensus changes?

@jnewbery
Copy link
Contributor Author

jnewbery commented Jun 6, 2018

Could the rpc changes potentially be split up into a separate pull request, to not distract from the consensus changes?

It's possible, but this PR already has two ACKs and a Concept ACK. I think that splitting it up would be generating more work for reviewers.

jl2012 added 2 commits June 12, 2018 11:42
This combines reporting of buried (formally ISM) softfork deployments
and BIP9 versionbits softfork deployments into one JSON object in the
getblockchaininfo return object.

It also removes the redundant feature_bip9_softforks.py.
feature_bip9_sofforks.py was intended to be a generic test for versionbits
deployments. However, it only tests CSV activation and was not updated
to test segwit activation. CSV activation is tested by
feature_csv_activation.py, so this test is duplicated effort.
Hard code CSV deployment height to 419328 for mainnet.
@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from bef29cf to e25d4de Compare June 12, 2018 16:06
@jnewbery
Copy link
Contributor Author

rebased

@maflcko
Copy link
Member

maflcko commented Jun 12, 2018

It's possible, but this PR already has two ACKs and a Concept ACK. I think that splitting it up would be generating more work for reviewers.

The ACK are outdated and would need to be re-ACKed on the new commits anyway.

@jnewbery jnewbery force-pushed the bury_bip9_deployments branch from e25d4de to ab740a0 Compare June 12, 2018 20:07
@jnewbery
Copy link
Contributor Author

jnewbery commented Jun 12, 2018

Fixed failing p2p_segwit.py

@jnewbery
Copy link
Contributor Author

This is a revamped version of @jl2012's #11398, which had concept ACKs from @gmaxwell @dcousens and @sdaftuar . This PR also has ACKs from @jamesob and @jtimon .

Are people still interested in this? I haven't had any feedback for the last three rebases (except @MarcoFalke's NACKs), and I'd rather not continue rebasing if people have cooled on this idea.

@DrahtBot
Copy link
Contributor

DrahtBot commented Jul 7, 2018

Needs rebase

@jnewbery
Copy link
Contributor Author

jnewbery commented Jul 9, 2018

Closing - 6 concept ACKs but no review so I guess this isn't worth rebasing.

@jnewbery jnewbery closed this Jul 9, 2018
@jnewbery jnewbery mentioned this pull request May 20, 2019
maflcko pushed a commit that referenced this pull request Aug 15, 2019
e78aaf4 [docs] Add release notes for burying bip 9 soft fork deployments (John Newbery)
8319e73 [tests] Add coverage for the content of getblockchaininfo.softforks (James O'Beirne)
0328dcd [Consensus] Bury segwit deployment (John Newbery)
1c93b9b [Consensus] Bury CSV deployment height (John Newbery)
3862e47 [rpc] Tidy up reporting of buried and ongoing softforks (John Newbery)

Pull request description:

  This hardcodes CSV and segwit activation heights, similar to the BIP 90 buried deployments for BIPs 34, 65 and 66.

  CSV and segwit have been active for over 18 months. Hardcoding the activation height is a code simplification, makes it easier to understand segwit activation status, and reduces technical debt.

  This was originally attempted by jl2012 in #11398 and again by me in #12360.

ACKs for top commit:
  ajtowns:
    ACK e78aaf4 ; checked diff to previous acked commit, checked tests still work
  ariard:
    ACK e78aaf4, check diff, run the tests again and successfully activated csv/segwit heights on mainnet as expected.
  MarcoFalke:
    ACK e78aaf4 (still didn't check if the mainnet block heights are correct, but the code looks good now)

Tree-SHA512: 7e951829106e21a81725f7d3e236eddbb59349189740907bb47e33f5dbf95c43753ac1231f47ae7bee85c8c81b2146afcdfdc11deb1503947f23093a9c399912
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 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.