Skip to content

Commit

Permalink
chaincfg: Introduce subsidy split change r2 agenda.
Browse files Browse the repository at this point in the history
This adds a new definition for the upcoming agenda vote to change the
subsidy split to 1% PoW, 89% PoS, and 10% Treasury defined in DCP0012.

It does not include any code to make decisions based on the status of
the agenda or bump block versions.  It only adds the definition for the
agenda.
  • Loading branch information
davecgh committed Apr 12, 2023
1 parent 7db7325 commit 9aa79ec
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 0 deletions.
27 changes: 27 additions & 0 deletions blockchain/fullblocktests/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,33 @@ var regNetParams = &chaincfg.Params{
},
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}, {
Vote: chaincfg.Vote{
Id: chaincfg.VoteIDChangeSubsidySplitR2,
Description: "Change block reward subsidy split to 1/89/10 as defined in DCP0012",
Mask: 0x0060, // Bits 5 and 6
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: 0x0020, // Bit 5
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0040, // Bit 6
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
},

Expand Down
27 changes: 27 additions & 0 deletions chaincfg/mainnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,33 @@ func MainNetParams() *Params {
},
StartTime: 1682294400, // Apr 24th, 2023
ExpireTime: 1745452800, // Apr 24th, 2025
}, {
Vote: Vote{
Id: VoteIDChangeSubsidySplitR2,
Description: "Change block reward subsidy split to 1/89/10 as defined in DCP0012",
Mask: 0x0060, // Bits 5 and 6
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0020, // Bit 5
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0040, // Bit 6
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 1682294400, // Apr 24th, 2023
ExpireTime: 1745452800, // Apr 24th, 2025
}},
},

Expand Down
5 changes: 5 additions & 0 deletions chaincfg/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ const (
// VoteIDBlake3Pow is the vote ID for the agenda that changes the proof of
// work hashing algorithm to BLAKE3 as defined in DCP0011.
VoteIDBlake3Pow = "blake3pow"

// VoteIDChangeSubsidySplitR2 is the vote ID for the agenda that changes the
// block reward subsidy split to 1% PoW, 89% PoS, and 10% Treasury as
// defined in DCP0012.
VoteIDChangeSubsidySplitR2 = "changesubsidysplitr2"
)

// ConsensusDeployment defines details related to a specific consensus rule
Expand Down
27 changes: 27 additions & 0 deletions chaincfg/regnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,33 @@ func RegNetParams() *Params {
},
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}, {
Vote: Vote{
Id: VoteIDChangeSubsidySplitR2,
Description: "Change block reward subsidy split to 1/89/10 as defined in DCP0012",
Mask: 0x0060, // Bits 5 and 6
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0020, // Bit 5
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0040, // Bit 6
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
},

Expand Down
28 changes: 28 additions & 0 deletions chaincfg/simnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,34 @@ func SimNetParams() *Params {
ForcedChoiceID: "yes",
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}, {
Vote: Vote{
Id: VoteIDChangeSubsidySplitR2,
Description: "Change block reward subsidy split to 1/89/10 as defined in DCP0012",
Mask: 0x0060, // Bits 5 and 6
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0020, // Bit 5
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0040, // Bit 6
IsAbstain: false,
IsNo: false,
}},
},
ForcedChoiceID: "yes",
StartTime: 0, // Always available for vote
ExpireTime: math.MaxInt64, // Never expires
}},
},

Expand Down
27 changes: 27 additions & 0 deletions chaincfg/testnetparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,33 @@ func TestNet3Params() *Params {
},
StartTime: 1682294400, // Apr 24th, 2023
ExpireTime: 1745452800, // Apr 24th, 2025
}, {
Vote: Vote{
Id: VoteIDChangeSubsidySplitR2,
Description: "Change block reward subsidy split to 1/89/10 as defined in DCP0012",
Mask: 0x0060, // Bits 5 and 6
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsAbstain: true,
IsNo: false,
}, {
Id: "no",
Description: "keep the existing consensus rules",
Bits: 0x0020, // Bit 5
IsAbstain: false,
IsNo: true,
}, {
Id: "yes",
Description: "change to the new consensus rules",
Bits: 0x0040, // Bit 6
IsAbstain: false,
IsNo: false,
}},
},
StartTime: 1682294400, // Apr 24th, 2023
ExpireTime: 1745452800, // Apr 24th, 2025
}},
},

Expand Down

0 comments on commit 9aa79ec

Please sign in to comment.