Return-Path: Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 91CA0258 for ; Wed, 28 Oct 2015 04:26:59 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from d.mail.sonic.net (d.mail.sonic.net [64.142.111.50]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 3E349AD for ; Wed, 28 Oct 2015 04:26:59 +0000 (UTC) Received: from [192.168.1.190] (63.135.62.197.nwinternet.com [63.135.62.197] (may be forged)) (authenticated bits=0) by d.mail.sonic.net (8.15.1/8.15.1) with ESMTPSA id t9S4QsWJ006241 (version=TLSv1 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Tue, 27 Oct 2015 21:26:57 -0700 From: Jonathan Toomim X-Pgp-Agent: GPGMail 2.5.2 Content-Type: multipart/signed; boundary="Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C"; protocol="application/pgp-signature"; micalg=pgp-sha512 Date: Tue, 27 Oct 2015 21:26:52 -0700 Message-Id: <291B85A6-D8D4-443B-B03B-C675CBEEC662@toom.im> To: Bitcoin Dev Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) X-Mailer: Apple Mail (2.1878.6) X-Sonic-CAuth: UmFuZG9tSVbUQA9Az301SwSVlg2FOQD8EPAjY4X4jkzqitScq8v9Ji4tjI5tTq4ROVWFGhlDu2hDn0bsF0oGX34TZrj8+31o X-Sonic-ID: C;QD6MHix95RG+SuK7sH9FTg== M;ED/JHyx95RG+SuK7sH9FTg== X-Sonic-Spam-Details: 0.0/5.0 by cerberusd X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,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 Subject: [bitcoin-dev] Composite priority: combining fees and bitcoin-days into one number 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, 28 Oct 2015 04:26:59 -0000 --Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Assigning 5% of block space based on bitcoin-days destroyed (BDD) and = the other 95% based on fees seems like a rather awkward approach to me. = For one thing, it means two code paths in pretty much every procedure = dealing with a constrained resource (e.g. mempool, CNB). This makes code = harder two write, harder to maintain, and slower to execute. As a = result, some people have proposed eliminating BDD priority altogether. I = have another idea. We can create and maintain a conversion rate between BDD and fees to = create a composite priority metric. Then we just do compPrio =3D BDD * = conversionRate + txFee. How do we calculate conversionRate? We want the following equation to be = true: sum(fees) =3D sum(BDD) * conversionRate * BDDweight So we sum up the mempool fees, and we sum up the mempool BDD. We get a = policy statement from the command line for a relative weight of BDD vs = fees (default 0.05), and then conversionRate =3D (summedFees / = summedBDD) * BDDWeight. As an optimization, rather than scanning over the whole mempool to = calculate this, we can just store the sum and add or subtract from it = each time a tx enters or leaves the mempool. In order to minimize drift = (the BDD for a transaction changes over time), we recalculate the whole = thing each time a new block is found. --Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJWME6NAAoJEIEuMk4MG0P148kIALz6R4nr1+bz6kL17ZO+7nB+ YYUe3AHs2yolOYrIbdtYDSrmWWJEEZywlk9YhLLyXLhS2DWXyL3RgJdozdd7s6wS zAx88INZkvP5jZH2yY9iA7lRfAmh1WEkY5gO+D0Uk63/v8wR3cqv2a/7UB6KJ/R5 YGa4Bf5v3+Ur4V9tjny3giSN82ylfUMRNfNW3BIJYWyQadZotquNbWq1ps+61MNS +71pBr1luM/+Rw/005+ml5h+Le+27/OR4TDiK4ZwiepnkwWHNNHoo3mdD+2vC9kZ dTfhzl3tRUTF2gMaqAPcvJEdU81XiCbs89tikmOwHJNr4G/teDMMBcfeeNpHQrM= =MUzu -----END PGP SIGNATURE----- --Apple-Mail=_5A83DE76-7C50-465D-8261-1EC99018955C--