MarcoFalke
commented at 2:48 PM on July 30, 2018:
member
This implements a layer around an immutable tx pool. The layer can be seen as a temporary throw-away shell that provides the same interface as CTxMemPool. Its primary purpose right now is to be passed into ATMP while testing acceptance of several (potentially depending) transaction and then to be discarded.
One use case could be to determine if smart contracts that are set up with multiple txs would be accepted by current consensus and policy rules.
In the future it could be extended to support recursive wrapping of layers or a way to commit changes that happened in the layer to the underlying pool or layer. Furthermore, it could be extended to be revivable after changes to the underlying layer happened. (As opposed to be single-use)
MarcoFalke added the label Validation on Jul 30, 2018
DrahtBot
commented at 5:42 PM on July 30, 2018:
contributor
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
#15681 ([mempool] Allow one extra single-ancestor transaction per package by TheBlueMatt)
#15192 (Add missing cs_main locks in ThreadImport(...)/Shutdown(...)/gettxoutsetinfo(...)/InitScriptExecutionCache(). Add missing locking annotations. by practicalswift)
#15169 (Parallelize CheckInputs() in AcceptToMemoryPool() by sdaftuar)
#10443 (Add fee_est tool for debugging fee estimation code by ryanofsky)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
practicalswift
commented at 10:06 AM on September 17, 2018:
contributor
This PR fails to compile with thread safety analysis enabled when rebased on master.
MarcoFalke
commented at 11:01 PM on September 17, 2018:
member
@practicalswift I think clang doesn't understand "recursive" annotations. I am happy to be proven wrong, but I think this just doesn't compile with annotations for now.
practicalswift
commented at 8:12 AM on September 23, 2018:
2018-09-22 21:49:48 cpplint(pr=13804): src/txmempool.h:730: You don't need a ; after a } [readability/braces] [4]
in
src/txmempool.h:759
in
554c3b8592outdated
754 | + using txlinksMap = std::map<CTxMemPool::Layer::txiter, CTxMemPool::Layer::TxLinks, CompareIteratorByHash>; 755 | + /** 756 | + * Construct a Layer based on an existing tx pool. 757 | + * The caller must acquire the lock for the whole life-time of this layer. 758 | + */ 759 | + Layer(const CTxMemPool& p) EXCLUSIVE_LOCKS_REQUIRED(m_tx_pool.cs)
practicalswift
commented at 8:12 AM on September 23, 2018:
2018-09-22 21:49:48 cpplint(pr=13804): src/txmempool.h:759: Single-parameter constructors should be marked explicit. [runtime/explicit] [5]
practicalswift
commented at 12:25 PM on December 8, 2018:
Calling GetConflictTx requires holding the mutex m_tx_pool.cs
in
src/txmempool.cpp:1021
in
f1d3f1b93aoutdated
1017 | + if (m_cache_removed.find(txid) != m_cache_removed.end()) {1018 | + return boost::optional<CTxMemPool::Layer::txiter>{};1019 | + }1020 | +1021 | + // Nothing found in the cache, fall back to the inner layer:1022 | + const auto it_inner = m_tx_pool.GetIter(txid);
practicalswift
commented at 12:26 PM on December 8, 2018:
m_tx_pool.cs must be held when calling GetIter
in
src/txmempool.cpp:1222
in
f1d3f1b93aoutdated
1210 | +{1211 | + const auto it = m_cache_map_links.find(entry);1212 | + if (it != m_cache_map_links.end()) return it->second.parents;1213 | +1214 | + CTxMemPool::Layer::setEntries ret;1215 | + for (const auto& parent : m_tx_pool.GetMemPoolParents(boost::get<CTxMemPool::txiter>(entry))) {
practicalswift
commented at 12:26 PM on December 8, 2018:
m_tx_pool.cs must be held here
practicalswift
commented at 12:28 PM on December 8, 2018:
contributor
This PR doesn't compile due to missing locks
DrahtBot added the label Needs rebase on Dec 13, 2018
MarcoFalke force-pushed on Dec 22, 2018
MarcoFalke force-pushed on Dec 22, 2018
DrahtBot removed the label Needs rebase on Dec 24, 2018
DrahtBot added the label Needs rebase on Jan 15, 2019
MarcoFalke force-pushed on Mar 7, 2019
DrahtBot removed the label Needs rebase on Mar 7, 2019
MarcoFalke force-pushed on Mar 8, 2019
DrahtBot added the label Needs rebase on Mar 21, 2019
MarcoFalke force-pushed on Jul 10, 2019
DrahtBot removed the label Needs rebase on Jul 10, 2019
MarcoFalke force-pushed on Jul 11, 2019
MarcoFalke force-pushed on Jul 11, 2019
MarcoFalke force-pushed on Jul 11, 2019
MarcoFalke force-pushed on Jul 11, 2019
MarcoFalke force-pushed on Jul 11, 2019
MarcoFalke force-pushed on Jul 11, 2019
txpool: Avoid mapTx.iterator_to lookup in CalculateMemPoolAncestorsb33a0fb7f9
tx pool: Make pool a template parameter of CoinsViewMemPoola6bf4f0588
tx pool: Move ATMP internal logic into static functions for template-reusability980353a186
txmempool: Use auto and GetEntry to hide txiter type19c277055c
MarcoFalke force-pushed on Jul 13, 2019
Transaction Pool Layerf57817fca0
rpc: Use TxPoolLayer in testmempoolaccept421de16e9c
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-05-19 06:54 UTC