0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-24 12:41:41 -05:00
bitcoin-bitcoin-core/src/test/util
Suhas Daftuar 7fb62f7db6 Apply mempool changeset transactions directly into the mempool
Rather than individually calling addUnchecked for each transaction added in a
changeset (after removing all the to-be-removed transactions), instead we can
take advantage of boost::multi_index's splicing features to extract and insert
entries directly from the staging multi_index into mapTx.

This has the immediate advantage of saving allocation overhead for mempool
entries which have already been allocated once. This also means that the memory
locations of mempool entries will not change when transactions go from staging
to the main mempool.

Additionally, eliminate addUnchecked and require all new transactions to enter
the mempool via a CTxMemPoolChangeSet.
2024-11-13 13:26:56 -05:00
..
blockfilter.cpp Remove unused includes from blockfilter.h 2023-08-17 18:28:15 +02:00
blockfilter.h refactor: Move functions to BlockManager methods 2023-05-10 19:06:53 +02:00
chainstate.h scripted-diff: Modernize naming of nChainTx and nTxCount 2024-08-04 14:24:43 +02:00
cluster_linearize.h clusterlin: remove Cluster type 2024-10-07 13:49:36 -04:00
CMakeLists.txt cmake: Add wallet functionality 2024-08-16 19:27:40 +01:00
coins.cpp test: refactor: Accept any RandomNumberGenerator in RandMoney 2024-08-26 11:19:43 +02:00
coins.h test: refactor: Pass rng parameters to test functions 2024-08-26 11:19:16 +02:00
index.cpp refactor: Remove call to ShutdownRequested from IndexWaitSynced 2023-12-04 15:39:15 -04:00
index.h refactor: Remove call to ShutdownRequested from IndexWaitSynced 2023-12-04 15:39:15 -04:00
json.cpp test: Use string_view for json_tests 2024-09-03 16:06:20 +02:00
json.h test: Use string_view for json_tests 2024-09-03 16:06:20 +02:00
logging.cpp scripted-diff: Bump copyright headers 2021-12-30 19:36:57 +02:00
logging.h scripted-diff: Bump copyright headers 2022-12-24 23:49:50 +00:00
mining.cpp refactor: De-globalize g_signals 2024-02-15 14:37:01 +01:00
mining.h test: Add util to mine invalid blocks 2023-05-02 17:17:06 +02:00
net.cpp Merge bitcoin/bitcoin#30394: net: fix race condition in self-connect detection 2024-07-16 09:40:53 +01:00
net.h [fuzz] Harness for version handshake 2024-07-31 13:25:52 +01:00
poolresourcetester.h Add pool based memory resource & allocator 2023-03-23 19:38:38 +01:00
random.cpp test: Rename SeedRand::SEED to FIXED_SEED for clarity 2024-08-29 09:38:05 +02:00
random.h test: Rename SeedRand::SEED to FIXED_SEED for clarity 2024-08-29 09:38:05 +02:00
README.md
script.cpp fuzz: [refactor] Use IsValidFlagCombination in signature_checker fuzz target 2021-03-30 10:42:45 +02:00
script.h fuzz: allow reaching MempoolAcceptResult::ResultType::DIFFERENT_WITNESS in tx_package_eval target 2023-11-09 09:07:03 -05:00
setup_common.cpp Apply mempool changeset transactions directly into the mempool 2024-11-13 13:26:56 -05:00
setup_common.h doc: doxygen comment for m_args usage in tests 2024-10-13 09:05:21 +01:00
str.cpp
str.h
transaction_utils.cpp refactor: move SignSignature helpers to test utils 2024-09-04 21:06:09 +02:00
transaction_utils.h refactor: move SignSignature helpers to test utils 2024-09-04 21:06:09 +02:00
txmempool.cpp Apply mempool changeset transactions directly into the mempool 2024-11-13 13:26:56 -05:00
txmempool.h Apply mempool changeset transactions directly into the mempool 2024-11-13 13:26:56 -05:00
validation.cpp validation: pass ChainstateRole for validationinterface calls 2023-09-30 06:38:47 -04:00
validation.h validation: pass ChainstateRole for validationinterface calls 2023-09-30 06:38:47 -04:00

Test library

This contains files for the test library, which is used by the test binaries (unit tests, benchmarks, fuzzers, gui tests).

Generally, the files in this folder should be well-separated modules. New code should be added to existing modules or (when in doubt) a new module should be created.

The utilities in here are compiled into a library, which does not hold any state. However, the main file setup_common defines the common test setup for all test binaries. The test binaries will handle the global state when they instantiate the BasicTestingSetup (or one of its derived classes).