From b151d2d580e6e2f9c4d1149f704d5a3fdab3dcb9 Mon Sep 17 00:00:00 2001 From: Marco Peereboom Date: Tue, 28 Feb 2017 12:35:52 -0600 Subject: [PATCH] multi: add LN support and new SDiff algorithm agendas. 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 #597 #593 #592 --- chaincfg/params.go | 68 ++++++++++++++++++++++++++++++++++++++++++++++ mining.go | 4 +-- 2 files changed, 70 insertions(+), 2 deletions(-) diff --git a/chaincfg/params.go b/chaincfg/params.go index c1689f0198..1bff8e9e03 100644 --- a/chaincfg/params.go +++ b/chaincfg/params.go @@ -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 @@ -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. diff --git a/mining.go b/mining.go index 4d7e7f17cd..4dddc9d5a0 100644 --- a/mining.go +++ b/mining.go @@ -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. @@ -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.