Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 58EB571 for ; Mon, 21 Mar 2016 02:51:35 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-ig0-f181.google.com (mail-ig0-f181.google.com [209.85.213.181]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 129FAE8 for ; Mon, 21 Mar 2016 02:51:35 +0000 (UTC) Received: by mail-ig0-f181.google.com with SMTP id nk17so61926252igb.1 for ; Sun, 20 Mar 2016 19:51:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=ChUr9+TTDSaDTXv+oVggWBAvh4pek39nKchxqESJqhA=; b=BswKWDHOVFSNf7YBWGtuL99VZp1m57BM/NyoZG2qa5BUEHb3r1A4jh9BqkJAPlBanq ZNDVDuLNbdQ5sbOc3mmzH6olT2ozvzBEeYB76VYw/FiVdGpZ1oLQGdUnUIvm9swpamCU IRzdccRDWhFR7qtIxiGXPFgjhLWq1ZSIfvC3b1kQirfQYQL0jf5w2B8mjH2zcnibZKRO 4A2l6zhHLpNYdwi+cFI8jC5FFXWu52JoC+ec47UJwXLxB6bTV5nCyoKhk5r8CXRO3b9B Xs548X6C8REmjMCNE2tEaHuaXFQT8ZuEdKu3PF2AC/6LD2K/WBeX/MsJc5Ci8gYPcfpm kb2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=ChUr9+TTDSaDTXv+oVggWBAvh4pek39nKchxqESJqhA=; b=KZT3rOfdaEC9c2IRd/uGjsDAMTS2s0aUEd5KG8ibrhUwU1CS5iRWECuo8/Qi/5GxyN t3zZDDTD6Tr8dMJA80lELIu6fAdI1xyihxBWhYOnEG2uPMuwINd8nGnI6aRQ/FnR7X/F gIklhAHt5H+A/hypFmf3eQf/wQvlXjENJ1SDr8zuekkwbRnXY2xv4y3jq9oNHk5ZgSnG /zI4I2g9mOQJ49rDO5qmLzV4yxRiC5mjtAwSCyKkkWwxgX8RlHXPgjtbz22eGgPWv1Fh qRkCvi0ysNveZ59Hra0g4ztwwst3uA+GXj+ygLrOXraS6KxsluJMVrzZ8oyy0Eyh/ojr Z4yQ== X-Gm-Message-State: AD7BkJKGngZzknqI783OyoFhQULg8Q6nsQxeaMTNOgbSjCUaQPLsIsb1EWSEfcKoKoM4Y0myMwN8Y7qbXeXVSw== X-Received: by 10.50.59.242 with SMTP id c18mr10410536igr.4.1458528694430; Sun, 20 Mar 2016 19:51:34 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.143.193 with HTTP; Sun, 20 Mar 2016 19:50:55 -0700 (PDT) From: Sergio Demian Lerner Date: Sun, 20 Mar 2016 23:50:55 -0300 Message-ID: To: bitcoin-dev Content-Type: multipart/alternative; boundary=047d7bea423eb9faac052e862c2a X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,LOTS_OF_MONEY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Mailman-Approved-At: Mon, 21 Mar 2016 16:16:29 +0000 Subject: [bitcoin-dev] BIP147 minor error 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: Mon, 21 Mar 2016 02:51:35 -0000 --047d7bea423eb9faac052e862c2a Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable The BIP147 reads: *Sigop cost* is defined. The cost of a sigop in traditional script is 4, while the cost of a sigop in witness program is 1. The new rule is total *sigop cost* =E2=89=A4 80,000. But the code implements: if (nSigOps + (nWitSigOps + 3) / 4 > MAX_BLOCK_SIGOPS) ... error.... Which is not the same. For example: nSigOps =3D 1 nWitSigOps =3D79999 Is not an error by BIP definition but it's an error by the implemented code= . Regards, Sergio. --047d7bea423eb9faac052e862c2a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
The BIP147 reads:

Sigop cost is def= ined. The cost of a sigop in traditional script is 4, while the cost of a s= igop in witness program is 1.

The new rule is total sigop cost =E2=89=A4 80,000.

But= the code implements:

if (nSigOps + (nWitSigOps + 3) / 4 > MAX_BL= OCK_SIGOPS)
=C2=A0... error....

Which is not the= same.

For example:
nSigOps =3D 1
nWitSigOps = =3D79999

Is not an error by BIP definition but it's an error by = the implemented code.

Regards, Sergio.
--047d7bea423eb9faac052e862c2a--