public inbox for bitcoindev@googlegroups.com
 help / color / mirror / Atom feed
From: Suhas Daftuar <sdaftuar@gmail•com>
To: DJ Bitcoin <bitcoin42@mail•com>
Subject: Re: [bitcoin-dev] TXMempool and dirty entries
Date: Mon, 8 May 2017 12:33:42 -0400	[thread overview]
Message-ID: <CAFp6fsEDWR2n3QL8jyCxvmjbYNuk311UNkA=K4=otC4PVmuPXw@mail.gmail.com> (raw)
In-Reply-To: <trinity-a411f282-fb6a-4a08-9f17-55abd7762499-1494236296205@3capp-mailcom-lxa09>

[-- Attachment #1: Type: text/plain, Size: 3109 bytes --]

Hi,

I've moved the bitcoin-dev list to bcc:, as this question is better suited
to forums dedicated to Bitcoin Core implementation specifics, rather than
the general bitcoin development list.

Please feel free in the future to ask questions like this on the
bitcoin-core-dev mailing list (https://lists.linuxfoundation
.org/mailman/listinfo/bitcoin-core-dev) or on the #bitcoin-core-dev
freenode IRC channel.

The work limit (that was put in place in https://github.com/bitcoin/
bitcoin/pull/6654, when the concept of "dirty" entries was introduced) was
removed in https://github.com/bitcoin/bitcoin/pull/7594, in preparation for
ancestor-feerate-mining.  So those comments should have been cleaned up to
match the new code.

Please feel free to file an issue or open a PR to update those comments at
https://github.com/bitcoin/bitcoin.

Thanks,
Suhas


On Mon, May 8, 2017 at 5:38 AM, DJ Bitcoin via bitcoin-dev <
bitcoin-dev@lists•linuxfoundation.org> wrote:

> Hi Guys,
>
> I have a question about the use of txmempool. find attached the code in
> txmempool.h
>
>
> ======================================================
> /* Adding transactions from a disconnected block can be very time
> consuming,
>  * because we don't have a way to limit the number of in-mempool
> descendants.
>  * To bound CPU processing, we limit the amount of work we're willing to do
>  * to properly update the descendant information for a tx being added from
>  * a disconnected block.  If we would exceed the limit, then we instead
> mark
>  * the entry as "dirty", and set the feerate for sorting purposes to be
> equal
>  * the feerate of the transaction without any descendants. */
>
> class CTxMemPoolEntry
> {
>    private:
>    // ...
>    // Information about descendants of this transaction that are in the
>    // mempool; if we remove this transaction we must remove all of these
>    // descendants as well. if nCountWithDescendants is 0, treat this entry
> as
>    // dirty, and nSizeWithDescendants and nModFeesWithDescendants will not
> be
>    // correct.
>
>    int64_t nCountWithDescendants; //!< number of descendant transactions
>    // ...
> ======================================================
>
>
> Now, the only place where nCountWithDescendants is modified is the
> following (txmempool.cpp):
>
>
> ======================================================
> void CTxMemPoolEntry::UpdateDescendantState(int64_t modifySize, CAmount
> modifyFee, int64_t modifyCount)
> {
>     nSizeWithDescendants += modifySize;
>     assert(int64_t(nSizeWithDescendants) > 0);
>     nModFeesWithDescendants += modifyFee;
>     nCountWithDescendants += modifyCount;
>     assert(int64_t(nCountWithDescendants) > 0);
> }
> ======================================================
>
>
> Therefore, nCountWithDescendants is never zero.
> Am i missing something? Where is this concept of "dirty" defined?
>
> Thanks a lot,
> DJ
>
>
>
>
>
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists•linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>
>

[-- Attachment #2: Type: text/html, Size: 4997 bytes --]

      reply	other threads:[~2017-05-08 16:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-08  9:38 DJ Bitcoin
2017-05-08 16:33 ` Suhas Daftuar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFp6fsEDWR2n3QL8jyCxvmjbYNuk311UNkA=K4=otC4PVmuPXw@mail.gmail.com' \
    --to=sdaftuar@gmail$(echo .)com \
    --cc=bitcoin42@mail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox