Skip to content

Commit

Permalink
multi: add LN support and new SDiff algorithm agendas.
Browse files Browse the repository at this point in the history
Add agendas to obtain feedback from the community to determine:
- If it wants to add LN support.
- If it supports the new SDiff algorithm.

Bump block version.

Fixes decred#597 decred#593 decred#592
  • Loading branch information
marcopeereboom authored and alexlyp committed Apr 13, 2017
1 parent ff07aac commit b151d2d
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 2 deletions.
68 changes: 68 additions & 0 deletions chaincfg/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,14 @@ const (
// VoteIDMaxBlockSize is the vote ID for the the maximum block size
// increase agenda used for the hard fork demo.
VoteIDMaxBlockSize = "maxblocksize"

// VoteIDLNSupport is the vote ID for determining if we want to adopt
// Lightning Network support.
VoteIDLNSupport = "lnsupport"

// VoteIDSDiffAlgorithm is the vote ID for determining if we want to
// adopt the new SDiff algorithm.
VoteIDSDiffAlgorithm = "sdiffalgorithm"
)

// ConsensusDeployment defines details related to a specific consensus rule
Expand Down Expand Up @@ -501,6 +509,66 @@ var MainNetParams = Params{
RuleChangeActivationMultiplier: 3, // 75%
RuleChangeActivationDivisor: 4,
RuleChangeActivationInterval: 2016 * 4, // 4 weeks
Deployments: map[uint32][]ConsensusDeployment{
4: {
{
Vote: Vote{
Id: VoteIDLNSupport,
Description: "Should decred add Lightning Support (LN)?",
Mask: 0x0006, // Bits 1 and 2
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsIgnore: true,
IsNo: false,
}, {
Id: "no",
Description: "reject adding LN support",
Bits: 0x0002, // Bit 1
IsIgnore: false,
IsNo: true,
}, {
Id: "yes",
Description: "accept adding LN support",
Bits: 0x0004, // Bit 2
IsIgnore: false,
IsNo: false,
}},
},
StartTime: 1496275200, // Jun 1st 2017
ExpireTime: 1504224000, // Sep 1st, 2017
},
{
Vote: Vote{
Id: VoteIDSDiffAlgorithm,
Description: "Should decred adopt the new SDiff algorithm?",
Mask: 0x0018, // Bits 3 and 4
Choices: []Choice{{
Id: "abstain",
Description: "abstain voting for change",
Bits: 0x0000,
IsIgnore: true,
IsNo: false,
}, {
Id: "no",
Description: "reject new SDiff algorithm",
Bits: 0x0008, // Bit 3
IsIgnore: false,
IsNo: true,
}, {
Id: "yes",
Description: "accept new SDiff algorithm",
Bits: 0x0010, // Bit 4
IsIgnore: false,
IsNo: false,
}},
},
StartTime: 1496275200, // Jun 1st 2017
ExpireTime: 1504224000, // Sep 1st, 2017
},
},
},

// Enforce current block version once majority of the network has
// upgraded.
Expand Down
4 changes: 2 additions & 2 deletions mining.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2014-2016 The btcsuite developers
// Copyright (c) 2015-2016 The Decred developers
// Copyright (c) 2015-2017 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.

Expand Down Expand Up @@ -36,7 +36,7 @@ const (
// will require changes to the generated block. Using the wire constant
// for generated block version could allow creation of invalid blocks
// for the updated version.
generatedBlockVersion = 3
generatedBlockVersion = 4

// generatedBlockVersionTest is the version of the block being generated
// for networks other than the main network.
Expand Down

0 comments on commit b151d2d

Please sign in to comment.