Skip to content

Conversation

@random-zebra
Copy link

@random-zebra random-zebra commented May 25, 2020

Based on top of:

This continues the work of #1531 adding memory accounting for the mempool.
Backports bitcoin#6410.

Original description:

This implements accurate memory usage accounting for the mempool. It is only exposed through getmempoolinfo for now, but could be used for limiting the resource requirements too (bitcoin#6281).

@random-zebra random-zebra added RPC Upstream Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes Resource usage labels May 25, 2020
@random-zebra random-zebra added this to the 5.0.0 milestone May 25, 2020
@random-zebra random-zebra self-assigned this May 25, 2020
@furszy
Copy link

furszy commented Jun 2, 2020

#1641 merged, needs rebase.

@random-zebra random-zebra force-pushed the 202005_mempool-usage branch from 419a6ab to 368665e Compare June 2, 2020 21:36
@random-zebra
Copy link
Author

Rebased

Copy link

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pretty nice, tested ACK 368665e

Copy link
Collaborator

@Fuzzbawls Fuzzbawls left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 368665e

@random-zebra random-zebra merged commit 4986708 into PIVX-Project:master Jun 3, 2020
furszy added a commit that referenced this pull request Jun 14, 2020
2105947 Implement helper class for CTxMemPoolEntry constructor (Alex Morcos)
1cef905 Make -checkmempool=1 not fail through int32 overflow (Pieter Wuille)
0f72ff2 Support -checkmempool=N, which runs checks on average once every N transactions (Pieter Wuille)
89483d0 [Bug] Make operator() a const function in CompareTxMemPoolEntryByX (random-zebra)
a50ad77 Lower default policy limits (random-zebra)
03f7152 fix locking issue with new mempool limiting (random-zebra)
1598961 Fix stale comment in CTxMemPool::TrimToSize. (random-zebra)
98d0d68 Undo GetMinFee-requires-extra-call-to-hit-0 (random-zebra)
6ad6ee6 Add reasonable test case for mempool trimming (random-zebra)
8dcbb7e Only call TrimToSize once per reorg/blocks disconnect (random-zebra)
c20cd38 Implement on-the-fly mempool size limitation. (random-zebra)
aee2e17 Print mempool size in KB when adding txn (random-zebra)
f7c85fd Add CFeeRate += operator (random-zebra)
5bd2a00 Track (and define) ::minRelayTxFee in CTxMemPool (random-zebra)
0b50f6c Add Mempool Expire function to remove old transactions (random-zebra)
d26f5e0 Fix calling mempool directly, instead of pool, in ATMP (random-zebra)
fc5eddb Reverse the sort on the mempool's feerate index (random-zebra)
0ce1df0 [BUG] Fix CTxMemPool::check excluding zerocoins from children checks (random-zebra)
1f7bd52 Track transaction packages in CTxMemPoolEntry (random-zebra)
1fd406b TxMemPool: Change mapTx to a boost::multi_index_container (random-zebra)

Pull request description:

  built on top of
  - [x] #1645

  This PR pulls some updates from upstream in the mempool area, adding the required adjustments for legacy zerocoin txes and updating the functional test suite.

  Specifically, here we:
  - track mempool descendants (in-mempool transactions that depend on other mempool transactions)
  - turn `mapTx` into a `boost::multi_index_container` that sorts the mempool on 3 criteria:
    - transaction hash
    - fee rate
    - time in the mempool
  - Add a max size for the mempool (throwing away the cheapest txs and bumping the min relay fee, when full)
  - Implement on-the-fly mempool size limit with the flag `-maxmempool`
  - Implement `-checkmempool=N` to customize the frequency of the mempool check
  - Implement helper for `CTxMemPoolEntry` for the unit tests.

  Backports:

  - bitcoin#6654
  - bitcoin#6722 [`*`]
  - bitcoin#6889
  - bitcoin#6771
  - bitcoin#6776
  - bitcoin#6896
  - bitcoin#7020

  [`*`] excluding bitcoin@9e93640 as our default minimum tx fee rate of 10k satoshis is only 0,00003 USD at the time of writing.

ACKs for top commit:
  Fuzzbawls:
    utACK 2105947
  furszy:
    Re utACK 2105947 and merging this nice upgrade :) .

Tree-SHA512: 51a7d75bd52f7646d461252c78f0dd9d7e8b5c1c66c22944120bfe293b28f5d48135de339ebf3d8a5b4c61ca5452383ed1b10c417be06dc4a335ac645842ea14
random-zebra added a commit to random-zebra/PIVX that referenced this pull request Jun 24, 2020
Document the changes introduced in:

- PIVX-Project#1549: Nuke zPIV from the GUI
- PIVX-Project#1586: Minimum value for stake split threshold
- PIVX-Project#1633: Bitcoin 0.12-0.14 serialization improvements
- PIVX-Project#1645: Implement accurate memory accounting for mempool
- PIVX-Project#1647: MemPool package tracking and limits
- PIVX-Project#1650: Benchmarking Framework
- PIVX-Project#1688: TopBar navigation (sync/peers)
random-zebra added a commit that referenced this pull request Jun 29, 2020
4819ee7 [Doc] Add/Update some release notes for 4.2 (random-zebra)

Pull request description:

  Document the changes introduced in:

  - #1549: Nuke zPIV from the GUI
  - #1586: Minimum value for stake split threshold
  - #1633: Bitcoin 0.12-0.14 serialization improvements
  - #1645: Implement accurate memory accounting for mempool
  - #1647: MemPool package tracking and limits
  - #1650: Benchmarking Framework
  - #1688: TopBar navigation (sync/peers)

ACKs for top commit:
  furszy:
    utACK 4819ee7
  Fuzzbawls:
    ACK 4819ee7

Tree-SHA512: 62ad949ea26a2f877ef0b40ec86616cc8105f81e1fcd380c8162cd93af04a46f1093f878c0668408654f198a0059b240798b83af3bf1d5e6c1c1d8611276a325
@random-zebra random-zebra removed the Needs Release Notes Placeholder tag for anything needing mention in the "Notable Changes" section of release notes label Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants