From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8D5C0A18 for ; 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 ; Wed, 19 Aug 2015 17:25:40 +0000 (UTC) Received: by iods203 with SMTP id s203so17166162iod.0 for ; 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: References: <20150819055036.GA19595@muck> From: Btc Drak Date: Wed, 19 Aug 2015 18:25:20 +0100 Message-ID: To: Tier Nolan 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 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-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 wrote: > On Wed, Aug 19, 2015 at 2:15 PM, Btc Drak via bitcoin-dev 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.