aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.h
AgeCommit message (Collapse)Author
2021-09-20Merge bitcoin/bitcoin#12677: RPC: Add ancestor{count,size,fees} to ↵W. J. van der Laan
listunspent output 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 doc/release-notes: Add new listunspent fields (Luke Dashjr) 0be2f17ef5649c2d77efbbbdd9222332b2ebf0d2 QA: Add tests for listunspent ancestor{count,size,fees} to mempool_packages (Luke Dashjr) 6966e80f453c46d5d0a923118205f19ac2f4e336 RPC: Add ancestor{count,size,fees} to listunspent output (Luke Dashjr) 3f77dfdaf0f0bfe0c4662a616d6943f31bdd5bf4 Expose ancestorsize and ancestorfees via getTransactionAncestry (Luke Dashjr) Pull request description: Requested by a user ACKs for top commit: prayank23: reACK https://github.com/bitcoin/bitcoin/commit/6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 fjahr: Code review re-ACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 kiminuo: ACK [6cb60f3](https://github.com/bitcoin/bitcoin/commit/6cb60f3e6d652ffa4cf570426a7cf1f690d15c45) achow101: Code Review ACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 naumenkogs: ACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 darosior: utACK 6cb60f3e6d652ffa4cf570426a7cf1f690d15c45 Tree-SHA512: 5d16e5799558691e5853ab7ea2cc85514cb45da3ce69134d855c71845beef32ec6af5ab28d4462683e9800c8ea126f162773a9d3d5660edac08fd8edbfeda173
2021-08-05[mempool] check ancestor/descendant limits for packagesglozow
When calculating ancestor/descendant counts for transactions in the package, as a heuristic, count every transaction in the package as an ancestor and descendant of every other transaction in the package. This may overestimate, but will not underestimate, the ancestor/descendant counts. This shortcut still produces an accurate count for packages of 1 parent + 1 child.
2021-08-05[refactor] pass size/count instead of entry to CalculateAncestorsAndCheckLimitsglozow
This does not change existing behavior. The ancestor/descendant limits are inclusive of the entries themselves, but CalculateAncestorsAndCheckLimits() does not need access to them.
2021-08-05MOVEONLY: add helper function for calculating ancestors and checking limitsglozow
2021-08-01Expose ancestorsize and ancestorfees via getTransactionAncestryLuke Dashjr
2021-06-02[refactor] comment/naming improvementsglozow
2021-05-27Merge bitcoin/bitcoin#20833: rpc/validation: enable packages through ↵W. J. van der Laan
testmempoolaccept 13650fe2e527bf0cf5d977bf5f3f1563b853ecdc [policy] detect unsorted packages (glozow) 9ef643e21b44f99f4bce54077788d0ad4d81f7cd [doc] add release note for package testmempoolaccept (glozow) c4259f4b7ee23ef6e0ec82c5d5b9dfa9cadd5bed [test] functional test for packages in RPCs (glozow) 9ede34a6f20378e86c5289ebd20dd394a5915123 [rpc] allow multiple txns in testmempoolaccept (glozow) ae8e6df709ff3d52b8e9918e09cacb64f83ae379 [policy] limit package sizes (glozow) c9e1a26d1f17c8b98632b7796ffa8f8788b5a83c [fuzz] add ProcessNewPackage call in tx_pool fuzzer (glozow) 363e3d916cc036488783bb4bdcfdd3665aecf711 [test] unit tests for ProcessNewPackage (glozow) cd9a11ac96c01e200d0086b2f011f4a614f5a705 [test] make submit optional in CreateValidMempoolTransaction (glozow) 2ef187941db439c5b3e529f08b6ab153ff061fc5 [validation] package validation for test accepts (glozow) 578148ded62828a9820398165c41670f4dbb523d [validation] explicit Success/Failure ctors for MempoolAcceptResult (glozow) b88d77aec5e7bef5305a668d15031351c0548b4d [policy] Define packages (glozow) 249f43f3cc52b0ffdf2c47aad95ba9d195f6a45e [refactor] add option to disable RBF (glozow) 897e348f5987eadd8559981a973c045c471b3ad8 [coins/mempool] extend CCoinsViewMemPool to track temporary coins (glozow) 42cf8b25df07c45562b7210e0e15c3fd5edb2c11 [validation] make CheckSequenceLocks context-free (glozow) Pull request description: This PR enables validation dry-runs of packages through the `testmempoolaccept` RPC. The expectation is that the results returned from `testmempoolaccept` are what you'd get from test-then-submitting each transaction individually, in that order (this means the package is expected to be sorted in topological order, for now at least). The validation is also atomic: in the case of failure, it immediately halts and may return "unfinished" `MempoolAcceptResult`s for transactions that weren't fully validated. The API for 1 transaction stays the same. **Motivation:** - This allows you to test validity for transaction chains (e.g. with multiple spending paths and where you don't want to broadcast yet); closes #18480. - It's also a first step towards package validation in a minimally invasive way. - The RPC commit happens to close #21074 by clarifying the "allowed" key. There are a few added restrictions on the packages, mostly to simplify the logic for areas that aren't critical to main package use cases: - No package can have conflicts, i.e. none of them can spend the same inputs, even if it would be a valid BIP125 replacement. - The package cannot conflict with the mempool, i.e. RBF is disabled. - The total count of the package cannot exceed 25 (the default descendant count limit), and total size cannot exceed 101KvB (the default descendant size limit). If you're looking for review comments and github isn't loading them, I have a gist compiling some topics of discussion [here](https://gist.github.com/glozow/c3acaf161c95bba491fce31585b2aaf7) ACKs for top commit: laanwj: Code review re-ACK 13650fe2e527bf0cf5d977bf5f3f1563b853ecdc jnewbery: Code review ACK 13650fe2e527bf0cf5d977bf5f3f1563b853ecdc ariard: ACK 13650fe Tree-SHA512: 8c5cbfa91a6c714e1c8710bb281d5ff1c5af36741872a7c5df6b24874d6272b4a09f816cb8a4c7de33ef8e1c2a2c252c0df5105b7802f70bc6ff821ed7cc1a2f
2021-05-21txmempool: add thread safety annotationsAnthony Towns
2021-05-20[coins/mempool] extend CCoinsViewMemPool to track temporary coinsglozow
2021-03-18fuzz: Add tx_pool fuzz targetsMarcoFalke
2021-03-17refactor: post Optional<> removal cleanupsfanquake
2021-03-15scripted-diff: remove Optional & nulloptfanquake
-BEGIN VERIFY SCRIPT- git rm src/optional.h sed -i -e 's/Optional</std::optional</g' $(git grep -l 'Optional<' src) sed -i -e 's/{nullopt}/{std::nullopt}/g' $(git grep -l 'nullopt' src) sed -i -e 's/ nullopt;/ std::nullopt;/g' $(git grep -l 'nullopt' src) sed -i -e 's/ nullopt)/ std::nullopt)/g' $(git grep -l 'nullopt' src) sed -i -e 's/(nullopt)/(std::nullopt)/g' $(git grep -l 'nullopt' src) sed -i -e 's/ nullopt,/ std::nullopt,/g' $(git grep -l 'nullopt' src) sed -i -e 's/? nullopt :/? std::nullopt :/g' $(git grep -l 'nullopt' src) sed -i -e 's/: nullopt}/: std::nullopt}/g' $(git grep -l 'nullopt' src) sed -i -e '/optional.h \\/d' src/Makefile.am sed -i -e '/#include <optional.h>/d' src/test/fuzz/autofile.cpp src/test/fuzz/buffered_file.cpp src/test/fuzz/node_eviction.cpp sed -i -e 's/#include <optional.h>/#include <optional>/g' $(git grep -l '#include <optional.h>' src) -END VERIFY SCRIPT-
2021-03-04Merge #21055: [Bundle 3/n] Prune remaining g_chainman usage in validation ↵Wladimir J. van der Laan
functions e11b6496506246882df450586acf735dabedf731 validation: CVerifyDB::VerifyDB: Use locking annotation (Carl Dong) 03f75c42e12a272057adccb6f0077e71f971eeef validation: Use existing chain member in CChainState::LoadGenesisBlock (Carl Dong) 5e4af773809415b71a10e3120cc44854d61c4c19 validation: Use existing chain member in CChainState::AcceptBlock (Carl Dong) fee73347c0015e4c24595c9708831d76cd6eec8c validation: Pass in chain to FindBlockPos+SaveBlockToDisk (Carl Dong) a9d28bcd8d8f71d089322b1d631390352e31ee2b validation: Use *this in CChainState::ActivateBestChainStep (Carl Dong) 4744efc9bae8b22efb76152a3c045d054c880399 validation: Pass in chainstate to CTxMemPool::check (Carl Dong) 1fb7b2c59505a6b9768789f6caad215a0a22ef16 validation: Use *this in CChainState::InvalidateBlock (Carl Dong) 8cdb2f7e58dfd9a631a8cbb8f0ee7e8c0c304eb4 validation: Move LoadBlockIndexDB to CChainState (Carl Dong) 8b99efbcc08ab41caf657c6d730a27e6a91bc356 validation: Move invalid block handling to CChainState (Carl Dong) 2bdf37fe187ba6f090a0f5299b74d5d82cde4697 validation: Pass in chainstate to CVerifyDB::VerifyDB (Carl Dong) 31eac50c721dd3b0bd2347e76196bf16913e9be9 validation: Remove global ::VersionBitsTip{State,SinceHeight,Statistics} (Carl Dong) 63e4c7316a537900f525e221d8042587b443cc3d validation: Pass in chainstate to ::PruneBlockFilesManual (Carl Dong) 4bada76237d734c1de38d3bd58689caeefd5e8cb validation: Pass in chainstate to UpdateTip (Carl Dong) a3ba08ba7dec0b016e42233cd4a061ba1a0e86c1 validation: Remove global ::{{Precious,Invalidate}Block,ResetBlockFailureFlags} (Carl Dong) 4927c9e6991b09a36a41aab93a0e05332d899611 validation: Remove global ::LoadGenesisBlock (Carl Dong) 9da106be4db692fa5db7b4de79f9cf7bfef37075 validation: Check chain tip is non-null in CheckFinalTx (Carl Dong) Pull request description: Overall PR: #20158 (tree-wide: De-globalize ChainstateManager) Based on: - [x] #20750 | [Bundle 2/n] Prune g_chainman usage in mempool-related validation functions Note to reviewers: 1. This bundle may _apparently_ introduce usage of `g_chainman` or `::Chain(state|)Active()` globals, but these are resolved later on in the overall PR. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits) 2. There may be seemingly obvious local references to `ChainstateManager` or other validation objects which are not being used in callers of the current function in question, this is done intentionally to **_keep each commit centered around one function/method_** to ease review and to make the overall change systematic. We don't assume anything about our callers. Rest assured that once we are considering that particular caller in later commits, we will use the obvious local references. [Commits of overall PR](https://github.com/bitcoin/bitcoin/pull/20158/commits) 3. When changing a function/method that has many callers (e.g. `LookupBlockIndex` with 55 callers), it is sometimes easier (and less error-prone) to use a scripted-diff. When doing so, there will be 3 commits in sequence so that every commit compiles like so: 1. Add `new_function`, make `old_function` a wrapper of `new_function`, divert all calls to `old_function` to `new_function` **in the local module only** 2. Scripted-diff to divert all calls to `old_function` to `new_function` **in the rest of the codebase** 3. Remove `old_function` Note to self: - [x] Address: https://github.com/bitcoin/bitcoin/pull/20750#discussion_r579400663 ACKs for top commit: laanwj: Code review ACK e11b6496506246882df450586acf735dabedf731 Tree-SHA512: 205a451a741e32f17d5966de289f2f5a3f0817738c0087b70ff4755ddd217b53d01050ed396669bda2b1d216a88d927b9778777f9ff95ab1fe20e59c5f341776
2021-03-03validation: Pass in chainstate to CTxMemPool::checkCarl Dong
This is the only instance where validation reaches for something outside of it.
2021-02-24Merge #18017: txmempool: split epoch logic into classWladimir J. van der Laan
fd6580e405699ccb051fd2a34525e48d3253673d [refactor] txmempool: split epoch logic into class (Anthony Towns) Pull request description: Splits the epoch logic introduced in #17925 into a separate class. Uses clang's thread safety annotations and encapsulates the data more strongly to reduce chances of bugs from API misuse. ACKs for top commit: jonatack: ACK fd6580e405699ccb051fd2a34525e48d3253673d using clang thread safety annotations looks like a very good idea, and the encapsulation this change adds should improve robustness (and possible unit test-ability) of the code. Verified that changing some of the locking duly provoked build-time warnings with Clang 9 on Debian and that small changes in the new `Epoch` class were covered by failing functional test assertions in `mempool_updatefromblock.py`, `mempool_resurrect.py`, and `mempool_reorg.py` hebasto: re-ACK fd6580e405699ccb051fd2a34525e48d3253673d, since my [previous](https://github.com/bitcoin/bitcoin/pull/18017#pullrequestreview-569619362) review: Tree-SHA512: 7004623faa02b56639aa05ab7a078320a6d8d54ec62d8022876221e33f350f47df51ddff056c0de5be798f8eb39b5c03c2d3f035698555d70abc218e950f2f8c
2021-02-18validation: Pass in chainstate to CTxMemPool::removeForReorgCarl Dong
Several other parameters are now redundant since they can be safely obtained from the chainstate given that ::cs_main is locked. These are now removed.
2021-02-09[refactor] txmempool: split epoch logic into classAnthony Towns
2021-01-28rpc: Return total fee in mempoolMarcoFalke
Also, add missing lock annotations
2021-01-20locks: Annotate CTxMemPool::check to require cs_mainCarl Dong
Currently, CTxMemPool::check locks CTxMemPool's own cs member, then calls GetSpendHeight which locks cs_main. This can potentially cause an undesirable lock invesion since CTxMemPool's cs is supposed to be locked after cs_main. This does not cause us any problems right now because all callers of CTxMemPool already lock cs_main before calling CTxMemPool::check, which means that the LOCK(cs_main) in GetSpendHeight becomes benign. However, it is currently possible for new code to be added which calls CTxMemPool::check without locking cs_main (which would be dangerous). Therefore we should make it explicit that cs_main needs to be held before calling CTxMemPool::check. NOTE: After all review-only assertions are removed in "#20158 | tree-wide: De-globalize ChainstateManager", and assuming that we keep the changes in "validation: Pass in spendheight to CTxMemPool::check", we can re-evaluate to see if this annotation is still necessary.
2021-01-13Merge #19935: Move SaltedHashers to separate file and add some new onesWladimir J. van der Laan
281fd1a4a032cded7f9ea9857e3e99fc793c714b Replace KeyIDHasher with SaltedSipHasher (Andrew Chow) 210b693db66e7c5b618014b5a287aee15af00045 Add generic SaltedSipHasher (Andrew Chow) 95e61c1cf2a91d041c8025306ba36f0ea2806894 Move Hashers to util/hasher.{cpp/h} (Andrew Chow) Pull request description: There are existing `SaltedOutPointHasher` and `SaltedTxidHasher` classes used for `std::unordered_map` and `std::unordered_set` that could be useful in other places in the codebase. So we these to their own `saltedhash.{cpp/h}` file. An existing `KeyIDHasher` is moved there too. Additionally, `ScriptIDHasher`, `SaltedPubkeyHasher`, and `SaltedScriptHasher` are added so that they can be used in future work. `KeyIDHasher` and `ScriptIDHasher` are not salted so that equality comparisons of maps and sets keyed by `CKeyID` and `CScriptID` will actually work. Split from #19602 (and a few other PRs/branches I have). ACKs for top commit: laanwj: Code review ACK 281fd1a4a032cded7f9ea9857e3e99fc793c714b jonatack: ACK 281fd1a4a032cded7f9ea9857e3e99fc793c714b, code review, debug build and ran bitcoind after rebasing to master @ dff0f6f753ea fjahr: utACK 281fd1a4a032cded7f9ea9857e3e99fc793c714b Tree-SHA512: bb03b231ccf3c9ecefc997b8da9c3770af4819f9be5b0a72997a103864e84046a2ac39b8eadf0dc9247bdccd53f86f433642e3a098882e6748341a9e7736271b
2020-12-01refactor: Improve use of explicit keywordFabian Jahr
2020-11-10Move Hashers to util/hasher.{cpp/h}Andrew Chow
Move the hashers that we use for hash tables to a common place. Moved hashers: - SaltedTxidHasher - SaltedOutpointHasher - FilterHeaderHasher - SignatureCacheHasher - BlockHasher
2020-10-23refactor: Clean up CTxMemPool initializer listElle Mouton
Shorten the CTxMemPool initializer list using default initialization for members that dont depend on the constuctor parameters.
2020-10-23refactor: Make CTxMemPool::m_check_ratio a const and a constructor argumentElle Mouton
Since m_check_ratio is only set once and since the CTxMemPool object is no longer a global variable, m_check_ratio can be passed into the constructor of CTxMemPool. Since it is only read from after initialization, m_check_ratio can also be made a const and hence no longer needs to be guarded by the cs mutex.
2020-10-23refactor: Avoid double to int cast for nCheckFrequencyElle Mouton
Use a ratio instead of a frequency that requires a double to int cast for determining how often a mempool sanity check should run.
2020-09-22Add 'sequence' zmq publisher to track all block (dis)connects, mempool deltasGregory Sanders
Using the zmq notifications to avoid excessive mempool polling can be difficult given the current notifications available. It announces all transactions being added to mempool or included in blocks, but announces no evictions and gives no indication if the transaction is in the mempool or a block. Block notifications for zmq are also substandard, in that it only announces block tips, while all block transactions are still announced. This commit adds a unified stream which can be used to closely track mempool: 1) getrawmempool to fill out mempool knowledge 2) if txhash is announced, add or remove from set based on add/remove flag 3) if blockhash is announced, get block txn list, remove from those transactions local view of mempool 4) if we drop a sequence number, go to (1) The mempool sequence number starts at the value 1, and increments each time a transaction enters the mempool, or is evicted from the mempool for any reason, including block inclusion. The mempool sequence number is published via ZMQ for any transaction-related notification. These features allow for ZMQ/RPC consumer to track mempool state in a more exacting way, without unnecesarily polling getrawmempool. See interface_zmq.py::test_mempool_sync for example usage.
2020-09-16Merge #19879: [p2p] miscellaneous wtxid followupsfanquake
a8a64acaf32ac21feeb885671772282b531ef9a2 [BroadcastTransaction] Remove unsafe move operator (Amiti Uttarwar) 125c0381266e0e05a408f8e1818501ab73d29110 [p2p] Remove dead code (Amiti Uttarwar) fc66d0a65cdc52a3b259effe0c29b5eafb1b5ff5 [p2p] Check for nullptr before dereferencing pointer (Adam Jonas) cb79b9dbf4cd06e17c8c65b36bf15c3ea2641de4 [mempool] Revert unbroadcast set to tracking just txid (Amiti Uttarwar) Pull request description: Addresses some outstanding review comments from #18044 - reverts unbroadcast txids to a set instead of a map (simpler, communicates intent better, takes less space, no efficiency advantages of map) - adds safety around two touchpoints (check for nullptr before dereferencing pointer, remove an inaccurate std::move operator) - removes some dead code Links to comments on wtxid PR: [1](https://github.com/bitcoin/bitcoin/pull/18044#discussion_r460495254) [2](https://github.com/bitcoin/bitcoin/pull/18044#discussion_r460496023) [3](https://github.com/bitcoin/bitcoin/pull/18044#discussion_r463532611) thanks to jnewbery & adamjonas for flagging these ! ! ACKs for top commit: sdaftuar: utACK a8a64acaf32ac21feeb885671772282b531ef9a2 naumenkogs: utACK a8a64acaf32ac21feeb885671772282b531ef9a2 jnewbery: utACK a8a64acaf32ac21feeb885671772282b531ef9a2 Tree-SHA512: 7be669cb30cc17fb9e06b50e636ef7887c6a27354697987e4e4d38dba4b8f50e175647587430cd9bc3295bec01ce8b1e6639a50a4249d8fff9b1ca1b9ead3277
2020-09-04[mempool] Revert unbroadcast set to tracking just txidAmiti Uttarwar
When I originally implemented the unbroadcast set in 18038, it just tracked txids. After 18038 was merged, I offered a patch to 18044 to make the unbroadcast changes compatible with wtxid relay. In this patch, I updated `unbroadcast_txids` to a map of txid -> wtxid. Post merge review comments shed light on the fact that this update was unnecessary, and distracting. So, this commit updates the unbroadcast ids back to a set.
2020-09-04Get rid of unused functions CTxMemPool::GetMemPoolChildren, ↵Jeremy Rubin
CTxMemPool::GetMemPoolParents
2020-09-04Remove mapLinks in favor of entry inlined structs with iterator type erasureJeremy Rubin
2020-09-01refactor: CTxMemPool::IsUnbroadcastTx() requires CTxMemPool::cs lockHennadii Stepanov
No change in behavior, the lock is already held at call sites.
2020-09-01refactor: CTxMemPool::GetTotalTxSize() requires CTxMemPool::cs lockHennadii Stepanov
No change in behavior, the lock is already held at call sites.
2020-09-01refactor: CTxMemPool::ClearPrioritisation() requires CTxMemPool::cs lockHennadii Stepanov
No change in behavior, the lock is already held at call sites. Also `const uint256` refactored to `const uint256&`.
2020-09-01refactor: CTxMemPool::ApplyDelta() requires CTxMemPool::cs lockHennadii Stepanov
No change in behavior, the lock is already held at call sites. Also `const uint256` refactored to `const uint256&`.
2020-09-01refactor: CTxMemPool::UpdateChild() requires CTxMemPool::cs lockHennadii Stepanov
No change in behavior, the lock is already held at call sites.
2020-09-01refactor: CTxMemPool::UpdateParent() requires CTxMemPool::cs lockHennadii Stepanov
No change in behavior, the lock is already held at call sites.
2020-07-30refactor: make txmempool interface use GenTxidPieter Wuille
2020-07-18Add wtxid to mempool unbroadcast trackingAmiti Uttarwar
2020-07-18Add a wtxid-index to the mempoolSuhas Daftuar
2020-05-25[trivial/doc] Fix comment typeAmiti Uttarwar
2020-05-25[trivial] Remove misleading 'const'Amiti Uttarwar
Returning by const value is only meaningful in a specific circumstance around user defined types. In this case, the const is not enforcing any restrictions on the call site, so is misleading.
2020-05-19[mempool] sanity check that all unbroadcast txns are in mempoolgzhao408
- before reattempting broadcast for unbroadcast txns, check they are in mempool and remove if not - this protects from memory leaks and network spam just in case unbroadcast set (incorrectly) has extra txns - check that tx is in mempool before adding to unbroadcast set to try to prevent this from happening
2020-05-19[rpc] add unbroadcast info to mempool entries and getmempoolinfogzhao408
- expose info about number of txns in unbroadcast set and whether a mempool entry's tx has passed initial broadcast - makes rpcs more informative and allows for more explicit testing, eg tracking if tx is in unbroadcast set before and after originating node connects to peers (adds this in mempool_unbroadcast.py) - adds mempool method IsUnbroadcastTx to query for tx inclusion in mempool's unbroadcast set
2020-04-23[mempool] Track "unbroadcast" transactionsAmiti Uttarwar
- Mempool tracks locally submitted transactions (wallet or rpc) - Transactions are removed from set when the node receives a GETDATA request from a peer, or if the transaction is removed from the mempool.
2020-03-19Merge #17477: Remove the mempool's NotifyEntryAdded and NotifyEntryRemoved ↵Wladimir J. van der Laan
signals e57980b4738c10344baf136de3e050a3cb958ca5 [mempool] Remove NotifyEntryAdded and NotifyEntryRemoved callbacks (John Newbery) 2dd561f36124972d2364f941de9c3417c65f05b6 [validation] Remove pool member from ConnectTrace (John Newbery) 969b65f3f527631ede1a31c7855151e5c5d91f8f [validation] Remove NotifyEntryRemoved callback from ConnectTrace (John Newbery) 5613f9842b4000fed088b8cf7b99674c328d15e1 [validation] Remove conflictedTxs from PerBlockConnectTrace (John Newbery) cdb893443cc16edf974f099b8485e04b3db1b1d7 [validation interface] Remove vtxConflicted from BlockConnected (John Newbery) 1168394d759b13af68acec6d5bfa04aaa24561f8 [wallet] Notify conflicted transactions in TransactionRemovedFromMempool (John Newbery) Pull request description: These boost signals were added in #9371, before we had a `TransactionRemovedFromMempool` method in the validation interface. The `NotifyEntryAdded` callback was used by validation to build a vector of conflicted transactions when connecting a block, which the wallet was notified of in the `BlockConnected` CValidationInterface callback. Now that we have a `TransactionRemovedFromMempool` callback, we can fire that signal directly from the mempool for conflicted transactions. Note that #9371 was implemented to ensure `-walletnotify` events were fired for these conflicted transaction. We inadvertently stopped sending these notifications in #16624 (Sep 2019 commit 7e89994). We should probably fix that, but in a different PR. ACKs for top commit: jonatack: Re-ACK e57980b ryanofsky: Code review ACK e57980b4738c10344baf136de3e050a3cb958ca5, no code changes since previous review, but helpful new code comments have been added and the PR description is now more clear about where the old code came from Tree-SHA512: 3bdbaf1ef2731e788462d4756e69c42a1efdcf168691ce1bbfdaa4b7b55ac3c5b1fd4ab7b90bcdec653703600501b4224d252cfc086aef28f9ce0da3b0563a69
2020-03-11[mempool] Remove NotifyEntryAdded and NotifyEntryRemoved callbacksJohn Newbery
NotifyEntryAdded never had any subscribers so can be removed. Since ConnectTrace no longer subscribes to NotifyEntryRemoved, there are now no subscribers. The CValidationInterface TransactionAddedToMempool and TransactionRemovedFromMempool methods can now provide this functionality. There's no need for a special notifications framework for the mempool.
2020-03-02doc: Correct spelling errors in commentsBen Woosley
And ci script output. Identified via test/lint/lint-spelling
2020-02-03Merge #17925: Improve UpdateTransactionsFromBlock with EpochsWladimir J. van der Laan
bd5a02692853f7240a4fdc593d7d0123d7916e45 Make UpdateTransactionsFromBlock use Epochs (Jeremy Rubin) 2ccb7cca4ac67198ac89bd58f5b4ae41a5163ceb Add Epoch Guards to CTXMemPoolEntry and CTxMemPool (Jeremy Rubin) Pull request description: UpdateTransactionsFromBlock is called during a re-org. When a re-org occurs, all of the transactions in the mempool may be descendants from a transaction which is in the pre-reorg block. This can cause us to propagate updates, worst case, to every transaction in the mempool. Because we construct a `setEntries setChildren`, which is backed by a `std::set`, it is possible that this algorithm is `O(N log N)`. By using an Epoch visitor pattern, we can limit this to `O(N)` worst case behavior. Epochs are also less resource intensive than almost any set option (e.g., hash set) because they are allocation free. This PR is related to https://github.com/bitcoin/bitcoin/pull/17268, it is a small subset of the changes which have been refactored slightly to ease review. If this PR gets review & merge, I will follow up with more PRs (similar to #17268) to improve the mempool ACKs for top commit: sdaftuar: ACK bd5a02692853f7240a4fdc593d7d0123d7916e45 adamjonas: Just to summarize for those looking to review - as of bd5a026 there are 3 ACKs (@sdaftuar, @ariard, and @hebasto) and one "looks good" from @ajtowns with no NACKs or any show-stopping concerns raised. ajtowns: ACK bd5a02692853f7240a4fdc593d7d0123d7916e45 (code review) ariard: Code review ACK bd5a026 hebasto: ACK bd5a02692853f7240a4fdc593d7d0123d7916e45, modulo some nits and a typo. Tree-SHA512: f0d2291085019ffb4e1119edeb9f4a89c1a572d1cb5b4bdf5743dd0152e721e1935f5155dcae84e1e5bda5ffdf6224c488c1e200bd33bedca9f5ca22d5f5139f
2020-01-14Add Epoch Guards to CTXMemPoolEntry and CTxMemPoolJeremy Rubin
2020-01-15scripted-diff: Bump copyright of files changed in 2020MarcoFalke
-BEGIN VERIFY SCRIPT- ./contrib/devtools/copyright_header.py update ./ -END VERIFY SCRIPT-