0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-09 15:37:00 -04:00
bitcoin-core/src/kernel
fanquake ac9fa6ec78
Merge bitcoin/bitcoin#28385: [refactor] rewrite DisconnectedBlockTransactions to not use boost
4313c77400 make DisconnectedBlockTransactions responsible for its own memory management (glozow)
cf5f1faa03 MOVEONLY: DisconnectedBlockTransactions to its own file (glozow)
2765d6f343 rewrite DisconnectedBlockTransactions as a list + map (glozow)
79ce9f0aa4 add std::list to memusage (glozow)
59a35a7398 [bench] DisconnectedBlockTransactions (glozow)
925bb723ca [refactor] batch-add transactions to DisconnectedBlockTransactions (glozow)

Pull request description:

  Motivation
  - I think it's preferable to use stdlib data structures instead of depending on boost if we can achieve the same thing.
  - Also see #28335 for further context/motivation. This PR simplifies that one.

  Things done in this PR:
  - Add a bench for `DisconnectedBlockTransactions` where we reorg and the new chain has {100%, 90%, 10%} of the same transactions. AFAIU in practice, it's usually close to 100%.
  - Rewrite `DisconnectedBlockTransactions` as a `std::list` + `unordered_map` instead of a boost multi index container.
    - On my machine, the bench suggests the performance is very similar.
  - Move `DisconnectedBlockTransactions` from txmempool.h to its own kernel/disconnected_transactions.h. This struct isn't used by txmempool and doesn't have much to do with txmempool. My guess is that it's been living there for convenience since the boost includes are there.

ACKs for top commit:
  ismaelsadeeq:
    Tested ACK 4313c77400
  stickies-v:
    ACK 4313c77400
  TheCharlatan:
    ACK 4313c77400

Tree-SHA512: 273c80866bf3acd39b2a039dc082b7719d2d82e0940e1eb6c402f1c0992e997256722b85c7e310c9811238a770cfbdeb122ea4babbc23835d17128f214a1ef9e
2023-09-23 18:42:36 +01:00
..
bitcoinkernel.cpp b-cs: Define G_TRANSLATION_FUN in bitcoinkernel.cpp 2022-04-26 16:30:53 -04:00
blockmanager_opts.h refactor: Move stopafterblockimport handling out of blockstorage 2023-07-11 12:00:57 +02:00
chain.cpp wallet: skip block scan if block was created before wallet birthday 2023-05-25 10:45:38 -03:00
chain.h interfaces, refactor: Add more block information to block connected notifications 2022-07-18 13:39:55 -05:00
chainparams.cpp Merge bitcoin/bitcoin#28379: Refactor: Remove m_is_test_chain 2023-09-21 16:31:05 +00:00
chainparams.h Merge bitcoin/bitcoin#28379: Refactor: Remove m_is_test_chain 2023-09-21 16:31:05 +00:00
chainstatemanager_opts.h kernel: Remove StartShutdown calls from validation code 2023-07-11 12:30:56 -04:00
checks.cpp refactor: Replace std::optional<bilingual_str> with util::Result 2023-05-24 08:55:47 -04:00
checks.h fix includes for touched header files (iwyu) 2023-05-29 13:26:31 +02:00
coinstats.cpp Avoid dereferencing interruption_point if it is nullptr 2023-05-02 20:19:28 +02:00
coinstats.h Use DataStream where possible 2023-01-26 10:44:05 +01:00
context.cpp util: Add SignalInterrupt class and use in shutdown.cpp 2023-06-28 09:49:28 +02:00
context.h util: Add SignalInterrupt class and use in shutdown.cpp 2023-06-28 09:49:28 +02:00
cs_main.cpp kernel: add missing include 2023-02-22 15:46:21 +00:00
cs_main.h refactor: add kernel/cs_main.* 2023-01-05 09:05:14 +00:00
disconnected_transactions.h make DisconnectedBlockTransactions responsible for its own memory management 2023-09-13 13:03:38 +01:00
mempool_entry.h mempool_entry: improve struct packing 2023-08-07 20:24:33 +10:00
mempool_limits.h refactor: mempool: add MemPoolLimits::NoLimits() 2022-10-05 13:07:11 +01:00
mempool_options.h config: default acceptnonstdtxn=0 on all chains 2023-08-28 22:09:39 +10:00
mempool_persist.cpp Remove unused GetType() from CBufferedFile and CAutoFile 2023-09-12 12:35:13 +02:00
mempool_persist.h Add importmempool RPC 2023-08-07 11:33:34 +02:00
mempool_removal_reason.cpp move-only: Create src/kernel/mempool_removal_reason.h 2023-08-17 16:26:20 +02:00
mempool_removal_reason.h move-only: Create src/kernel/mempool_removal_reason.h 2023-08-17 16:26:20 +02:00
messagestartchars.h kernel: Move MessageStartChars to its own file 2023-09-12 22:51:38 +02:00
notifications_interface.h kernel: Remove StartShutdown calls from validation code 2023-07-11 12:30:56 -04:00
validation_cache_sizes.h validationcaches: Use size_t for sizes 2022-08-03 12:03:28 -04:00