summaryrefslogtreecommitdiff
path: root/ea/0840279fb4ca192a451a7bb41e372f2fedc5a9
blob: 5a80794755c14032e2cfd7db65defa60ac58d120 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
Return-Path: <btcdrak@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id 8D5C0A18
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 19 Aug 2015 17:25:40 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-io0-f175.google.com (mail-io0-f175.google.com
	[209.85.223.175])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 216FC106
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 19 Aug 2015 17:25:40 +0000 (UTC)
Received: by iods203 with SMTP id s203so17166162iod.0
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Wed, 19 Aug 2015 10:25:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-type:content-transfer-encoding;
	bh=Eeo8lMqRIm6QdzuAwCJ5BbNIIeaMe5FUf1RxRHpZo2g=;
	b=MUEHqf5Yyx1HTTE1LdZCD4OLKcVEzecM47LAvKyQ4e6cjqVaHXpg7qBs2mRuukUveU
	ka9D8zfDgNjcJNsy+c0btXqd5z04swlEsUDYwaTa2NYqMIOIFPVIlq6QuGCrZmwxdGDO
	Gdhvb7OgmQdi1aFqqZztWg8J040QckkIf20dO4glu/KCo957xBzFYuZI3ERKgQTo4Okn
	jC8JZ/Wrw4HnZZuJKbDu2RTmWi0tnAz2R2fTHzp+I6XKCMpe21DVh17QdwVFYHl4pZcd
	z8wa8W62qL7Jfpr+XFv1c0L8ypU6lz8ibpw6URCnGLqW/OVHEgsGZmAh9072ud8Vf1sU
	ZOPA==
X-Received: by 10.107.36.140 with SMTP id k134mr13607945iok.5.1440005139654;
	Wed, 19 Aug 2015 10:25:39 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.79.81.199 with HTTP; Wed, 19 Aug 2015 10:25:20 -0700 (PDT)
In-Reply-To: <CAE-z3OVAJcnFn21F9QTGCf=NZrLQ9hAtj_tqSCboQGCfFSvq=Q@mail.gmail.com>
References: <20150819055036.GA19595@muck>
	<CAOG=w-unJ+xnWFgiBO3jmgj4Q72ZH6-LOn08TwUF58trc-_WWg@mail.gmail.com>
	<CABm2gDpBLKxKbHyWocOuyfO1VZ45yM7U1t+zVL_13LP9veXmcA@mail.gmail.com>
	<CADJgMztmgUzy70sJ+_Xj-OFe-kvEi6eSAYoGTb4yg-yGQ9u1dw@mail.gmail.com>
	<CABm2gDqRycGY2diXoTvL+d5JE0EgccgGdiQdgWj8c_9SMokJEw@mail.gmail.com>
	<CADJgMztysqVya1nnRatyav5rqcpEZ81CmXxW0ZqwJoLN7W2=hg@mail.gmail.com>
	<CAE-z3OVAJcnFn21F9QTGCf=NZrLQ9hAtj_tqSCboQGCfFSvq=Q@mail.gmail.com>
From: Btc Drak <btcdrak@gmail.com>
Date: Wed, 19 Aug 2015 18:25:20 +0100
Message-ID: <CADJgMzsvAfJnW1DDD6t3qkBcQRLb4HMqG27k51LhXJqxC6-z4g@mail.gmail.com>
To: Tier Nolan <tier.nolan@gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, HK_RANDOM_ENVFROM,
	HK_RANDOM_FROM, RCVD_IN_DNSWL_LOW autolearn=no version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
Cc: Bitcoin Dev <bitcoin-dev@lists.linuxfoundation.org>
Subject: Re: [bitcoin-dev] CLTV/CSV/etc. deployment considerations due to
 XT/Not-BitcoinXT miners
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Bitcoin Development Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>,
	<mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Wed, 19 Aug 2015 17:25:40 -0000

On Wed, Aug 19, 2015 at 2:24 PM, Tier Nolan via bitcoin-dev
<bitcoin-dev@lists.linuxfoundation.org> wrote:
> On Wed, Aug 19, 2015 at 2:15 PM, Btc Drak via bitcoin-dev <bitcoin-dev@li=
sts.linuxfoundation.org> wrote:
>> What problem am I missing if we just mask of the offending bits. For my =
own project which uses auxpow (and thus has weird nVersion), I also used th=
e bitmasking method to get rid of auxpow version bits before making the sta=
ndard integer comparisons to deploy BIP66 using IsSuperMajority():
>>
>>     if ((block.nVersion & 0xff) >=3D 4 && CBlockIndex::IsSuperMajority(.=
..)) { //...}
>
> What if version number 257 is used in the future?  That would appear to b=
e a version 1 block and fail the test.

To clarify this is the code example for how the same problem occurs
with auxpow bits when running a an IsSuperMajority() softfork and how
it's solved in that instance.

In our case for Bitcoin Core, option 2 we use nVersion=3D8, apply a
bitmask of 0xdffffff8 thus:

    if ((block.nVersion & ~0x20000007) >=3D 4 &&
CBlockIndex::IsSuperMajority(...)) { //...}

With nVersion=3D8, but using comparison >=3D4 allows us to recover the
bit later, assuming we want it (otherwise we use version >=3D8).

This should, unless I am missing something, be forward compatible with
future softforks. My understanding was if "versionbits softfork" code
is not ready by the time we're ready for the deployment,
IsSuperMajority() would be acceptable; and this is how we could deploy
it in the wake of the XT developers' carelessness.