Skip to content

Commit

Permalink
chaincfg: Add DCP0007 deployment.
Browse files Browse the repository at this point in the history
This adds the deployment and agenda parameters for the DCP0007 vote.
  • Loading branch information
matheusd authored and davecgh committed Aug 13, 2021
1 parent f6fd7d3 commit 0b99183
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
28 changes: 28 additions & 0 deletions blockchain/fullblocktests/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,34 @@ var regNetParams = &chaincfg.Params{
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
10: {{
Vote: chaincfg.Vote{
Id: chaincfg.VoteIDRevertTreasuryPolicy,
Description: "Change maximum treasury expenditure policy as defined in DCP0007",
Mask: 0x0006, // Bits 1 and 2
Choices: []chaincfg.Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0002, // Bit 1
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0004, // Bit 2
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
},

// Enforce current block version once majority of the network has
Expand Down
28 changes: 28 additions & 0 deletions chaincfg/mainnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,34 @@ func MainNetParams() *Params {
StartTime: 1596240000, // Aug 1st, 2020
ExpireTime: 1627776000, // Aug 1st, 2021
}},
9: {{
Vote: Vote{
Id: VoteIDRevertTreasuryPolicy,
Description: "Change maximum treasury expenditure policy as defined in DCP0007",
Mask: 0x0006, // Bits 1 and 2
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0002, // Bit 1
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0004, // Bit 2
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 1631750400, // Sep 16th, 2021
ExpireTime: 1694822400, // Sep 16th, 2023
}},
},

// Enforce current block version once majority of the network has
Expand Down
5 changes: 5 additions & 0 deletions chaincfg/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ const (
// VoteIDTreasury is the vote ID for the agenda that enables the
// decentralized treasury opcodes defined by DCP0006.
VoteIDTreasury = "treasury"

// VoteIDRevertTreasuryPolicy is the vote ID for the agenda that
// reverts the maximum expenditure policy of the treasury account as
// defined by DCP0007.
VoteIDRevertTreasuryPolicy = "reverttreasurypolicy"
)

// ConsensusDeployment defines details related to a specific consensus rule
Expand Down
28 changes: 28 additions & 0 deletions chaincfg/regnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,34 @@ func RegNetParams() *Params {
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
10: {{
Vote: Vote{
Id: VoteIDRevertTreasuryPolicy,
Description: "Change maximum treasury expenditure policy as defined in DCP0007",
Mask: 0x0006, // Bits 1 and 2
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0002, // Bit 1
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0004, // Bit 2
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
},

// Enforce current block version once majority of the network has
Expand Down
28 changes: 28 additions & 0 deletions chaincfg/testnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,34 @@ func TestNet3Params() *Params {
StartTime: 1596240000, // Aug 1st, 2020
ExpireTime: 1627776000, // Aug 1st, 2021
}},
10: {{
Vote: Vote{
Id: VoteIDRevertTreasuryPolicy,
Description: "Change maximum treasury expenditure policy as defined in DCP0007",
Mask: 0x0006, // Bits 1 and 2
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0002, // Bit 1
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0004, // Bit 2
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 1631750400, // Sep 16th, 2021
ExpireTime: 1694822400, // Sep 16th, 2023
}},
},

// Enforce current block version once majority of the network has
Expand Down

0 comments on commit 0b99183

Please sign in to comment.