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.
This commit is contained in:
Dave Collins 2021-08-23 00:35:55 -05:00
parent 08b7b89b25
commit e5ba0f6bd9
No known key found for this signature in database
GPG Key ID: B8904D9D9C93D1F2
5 changed files with 118 additions and 5 deletions

View File

@ -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
}},
},

View File

@ -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
}},
},

View File

@ -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

View File

@ -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
}},
},

View File

@ -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
}},
},