From e5ba0f6bd9038ba81dcf3fa7410bc07bad3aa455 Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Mon, 23 Aug 2021 00:35:55 -0500 Subject: [PATCH] chaincfg: Introduce explicit ver upgrades agenda. This adds a new definition for the upcoming agenda vote to reject new transaction and script versions until they are explicitly enabled via a consensus vote as defined by DCP0008. It does not include any code to make decisions or bump the versions. It is only the definition. --- blockchain/fullblocktests/params.go | 29 ++++++++++++++++++++++++++++- chaincfg/mainnetparams.go | 29 ++++++++++++++++++++++++++++- chaincfg/params.go | 7 ++++++- chaincfg/regnetparams.go | 29 ++++++++++++++++++++++++++++- chaincfg/testnetparams.go | 29 ++++++++++++++++++++++++++++- 5 files changed, 118 insertions(+), 5 deletions(-) diff --git a/blockchain/fullblocktests/params.go b/blockchain/fullblocktests/params.go index 95ecca27..6d67a4c2 100644 --- a/blockchain/fullblocktests/params.go +++ b/blockchain/fullblocktests/params.go @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2020 The Decred developers +// Copyright (c) 2016-2021 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -338,6 +338,33 @@ var regNetParams = &chaincfg.Params{ }, StartTime: 0, // Always available for vote ExpireTime: math.MaxInt64, // Never expires + }, { + Vote: chaincfg.Vote{ + Id: chaincfg.VoteIDExplicitVersionUpgrades, + Description: "Enable explicit version upgrades as defined in DCP0008", + Mask: 0x0018, // Bits 3 and 4 + Choices: []chaincfg.Choice{{ + Id: "abstain", + Description: "abstain from voting", + Bits: 0x0000, + IsAbstain: true, + IsNo: false, + }, { + Id: "no", + Description: "keep the existing consensus rules", + Bits: 0x0008, // Bit 3 + IsAbstain: false, + IsNo: true, + }, { + Id: "yes", + Description: "change to the new consensus rules", + Bits: 0x0010, // Bit 4 + IsAbstain: false, + IsNo: false, + }}, + }, + StartTime: 0, // Always available for vote + ExpireTime: math.MaxInt64, // Never expires }}, }, diff --git a/chaincfg/mainnetparams.go b/chaincfg/mainnetparams.go index b1e74cf3..5bb191e4 100644 --- a/chaincfg/mainnetparams.go +++ b/chaincfg/mainnetparams.go @@ -1,5 +1,5 @@ // Copyright (c) 2014-2016 The btcsuite developers -// Copyright (c) 2015-2019 The Decred developers +// Copyright (c) 2015-2021 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -352,6 +352,33 @@ func MainNetParams() *Params { }, StartTime: 1631750400, // Sep 16th, 2021 ExpireTime: 1694822400, // Sep 16th, 2023 + }, { + Vote: Vote{ + Id: VoteIDExplicitVersionUpgrades, + Description: "Enable explicit version upgrades as defined in DCP0008", + Mask: 0x0018, // Bits 3 and 4 + Choices: []Choice{{ + Id: "abstain", + Description: "abstain from voting", + Bits: 0x0000, + IsAbstain: true, + IsNo: false, + }, { + Id: "no", + Description: "keep the existing consensus rules", + Bits: 0x0008, // Bit 3 + IsAbstain: false, + IsNo: true, + }, { + Id: "yes", + Description: "change to the new consensus rules", + Bits: 0x0010, // Bit 4 + IsAbstain: false, + IsNo: false, + }}, + }, + StartTime: 1631750400, // Sep 16th, 2021 + ExpireTime: 1694822400, // Sep 16th, 2023 }}, }, diff --git a/chaincfg/params.go b/chaincfg/params.go index cbfa9a68..a2dc4d9f 100644 --- a/chaincfg/params.go +++ b/chaincfg/params.go @@ -1,5 +1,5 @@ // Copyright (c) 2014-2016 The btcsuite developers -// Copyright (c) 2015-2019 The Decred developers +// Copyright (c) 2015-2021 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -150,6 +150,11 @@ const ( // reverts the maximum expenditure policy of the treasury account as // defined by DCP0007. VoteIDRevertTreasuryPolicy = "reverttreasurypolicy" + + // VoteIDExplicitVersionUpgrades is the vote ID for the agenda that enables + // rejection of new transaction and script versions until they are + // explicitly enabled via a consensus vote as defined by DCP0008. + VoteIDExplicitVersionUpgrades = "explicitverupgrades" ) // ConsensusDeployment defines details related to a specific consensus rule diff --git a/chaincfg/regnetparams.go b/chaincfg/regnetparams.go index 0b5af3b3..ce99cc71 100644 --- a/chaincfg/regnetparams.go +++ b/chaincfg/regnetparams.go @@ -1,4 +1,4 @@ -// Copyright (c) 2018-2019 The Decred developers +// Copyright (c) 2018-2021 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -322,6 +322,33 @@ func RegNetParams() *Params { }, StartTime: 0, // Always available for vote ExpireTime: math.MaxInt64, // Never expires + }, { + Vote: Vote{ + Id: VoteIDExplicitVersionUpgrades, + Description: "Enable explicit version upgrades as defined in DCP0008", + Mask: 0x0018, // Bits 3 and 4 + Choices: []Choice{{ + Id: "abstain", + Description: "abstain from voting", + Bits: 0x0000, + IsAbstain: true, + IsNo: false, + }, { + Id: "no", + Description: "keep the existing consensus rules", + Bits: 0x0008, // Bit 3 + IsAbstain: false, + IsNo: true, + }, { + Id: "yes", + Description: "change to the new consensus rules", + Bits: 0x0010, // Bit 4 + IsAbstain: false, + IsNo: false, + }}, + }, + StartTime: 0, // Always available for vote + ExpireTime: math.MaxInt64, // Never expires }}, }, diff --git a/chaincfg/testnetparams.go b/chaincfg/testnetparams.go index 9467e07f..9496c7a2 100644 --- a/chaincfg/testnetparams.go +++ b/chaincfg/testnetparams.go @@ -1,5 +1,5 @@ // Copyright (c) 2014-2016 The btcsuite developers -// Copyright (c) 2015-2019 The Decred developers +// Copyright (c) 2015-2021 The Decred developers // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. @@ -244,6 +244,33 @@ func TestNet3Params() *Params { }, StartTime: 1631750400, // Sep 16th, 2021 ExpireTime: 1694822400, // Sep 16th, 2023 + }, { + Vote: Vote{ + Id: VoteIDExplicitVersionUpgrades, + Description: "Enable explicit version upgrades as defined in DCP0008", + Mask: 0x0018, // Bits 3 and 4 + Choices: []Choice{{ + Id: "abstain", + Description: "abstain from voting", + Bits: 0x0000, + IsAbstain: true, + IsNo: false, + }, { + Id: "no", + Description: "keep the existing consensus rules", + Bits: 0x0008, // Bit 3 + IsAbstain: false, + IsNo: true, + }, { + Id: "yes", + Description: "change to the new consensus rules", + Bits: 0x0010, // Bit 4 + IsAbstain: false, + IsNo: false, + }}, + }, + StartTime: 1631750400, // Sep 16th, 2021 + ExpireTime: 1694822400, // Sep 16th, 2023 }}, },