-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Bury bip9 deployments #12360
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
Bury bip9 deployments #12360
Conversation
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. |
src/rpc/blockchain.cpp
Outdated
rv.push_back(Pair("reject", SoftForkMajorityDesc(version, pindex, consensusParams))); | ||
return rv; | ||
rv.pushKV("type", "buried"); | ||
rv.pushKV("type", "buried"); |
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.
Duplicated line?
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.
Yes?
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.
Fixed
src/chainparams.cpp
Outdated
@@ -59,6 +59,11 @@ void CChainParams::UpdateVersionBitsParameters(Consensus::DeploymentPos d, int64 | |||
consensus.vDeployments[d].nTimeout = nTimeout; | |||
} | |||
|
|||
void CChainParams::UpdateSegwitHeight(const int& height) |
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.
Any good reason for reference?
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.
None. Removed.
b58d560
to
caab009
Compare
src/consensus/params.h
Outdated
@@ -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 */ |
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.
Is it helpful to continue referencing the BIP numbers in these comments? I would guess so.
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.
Sure. Comments added.
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.
Why not refer to the BIP numbers solely instead of alternating?
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.
the segwit deployment covered more than one bip
caab009
to
32cbe48
Compare
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.
Concept ACK 32cbe48
src/rpc/blockchain.cpp
Outdated
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)); |
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.
Nit: any reason this isn't just rv.pushKV("active", ...);
for consistency?
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.
Requires #12193
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.
ah. It's just been merged. Will rebase.
src/rpc/blockchain.cpp
Outdated
" \"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" |
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.
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.
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.
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.
src/rpc/blockchain.cpp
Outdated
@@ -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" |
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.
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?
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.
Oops. Bad rebase. Should be fixed now.
07f8153
to
0be1f9d
Compare
0be1f9d
to
916aa73
Compare
916aa73
to
0be1f9d
Compare
Biased ACK 0be1f9d |
utACK 0be1f9d8a6bb2b8c47d6816b46d6764aee3cc06e |
0be1f9d
to
818b7af
Compare
rebased |
818b7af
to
3abc65f
Compare
Rebased. |
3abc65f
to
fc32e68
Compare
Rebased |
@@ -1158,6 +1159,21 @@ bool AppInitParameterInteraction() | |||
} | |||
} | |||
} | |||
|
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 can be done directly in CRegtestParams's constructor, that way, the function UpdateSegwitHeight would not be needed.
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.
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.
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 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...
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 think I'll leave it as is for now. It may be possible to tidy this up in a future commit.
fc32e68
to
49c5e7d
Compare
Rebased |
49c5e7d
to
2507a45
Compare
rebased |
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. |
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.
bef29cf
to
e25d4de
Compare
rebased |
The ACK are outdated and would need to be re-ACKed on the new commits anyway. |
Hardcode segwit deployment height to 481824 for mainnet.
e25d4de
to
ab740a0
Compare
Fixed failing p2p_segwit.py |
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. |
Needs rebase |
Closing - 6 concept ACKs but no review so I guess this isn't worth rebasing. |
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
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.