Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Transaction Pool Layer #13804

Open
wants to merge 7 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@MarcoFalke
Copy link
Member

commented Jul 30, 2018

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)

@DrahtBot

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2018

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15632 ([WIP] Remove ResendWalletTransactions from the Validation Interface by jnewbery)
  • #15606 ([experimental] UTXO snapshots by jamesob)
  • #15267 (doc: explain AcceptToMemoryPoolWorker's coins_to_uncache by jamesob)
  • #15192 (Add missing cs_main locks in ThreadImport(...)/Shutdown(...)/gettxoutsetinfo(...)/InitScriptExecutionCache(). Add missing locking annotations. by practicalswift)
  • #15141 (Rewrite DoS interface between validation and net_processing by sdaftuar)
  • #13949 (Introduce MempoolObserver interface to break "policy/fees -> txmempool -> policy/fees" circular dependency by Empact)
  • #13189 (Remove 2nd mapTx lookup in CTxMemPool::removeForBlock by promag)
  • #10973 (Refactor: separate wallet from node by ryanofsky)
  • #10823 (Allow all mempool txs to be replaced after a configurable timeout (default 6h) by greenaddress)
  • #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.

@promag
Copy link
Member

left a comment

Last commit is overwhelming. Could prefix with wip: until dependencies are merged?

Show resolved Hide resolved src/policy/rbf.h Outdated
Show resolved Hide resolved src/txmempool.cpp

@MarcoFalke MarcoFalke changed the title Stacked Transaction Pool Layer Transaction Pool Layer Aug 4, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch 9 times, most recently Aug 4, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch 2 times, most recently Aug 29, 2018

@DrahtBot DrahtBot removed the Needs rebase label Aug 29, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch 4 times, most recently Aug 29, 2018

Show resolved Hide resolved src/txmempool.cpp Outdated
Show resolved Hide resolved src/txmempool.cpp Outdated

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch Sep 26, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch Oct 27, 2018

@MarcoFalke MarcoFalke changed the title Transaction Pool Layer WIP: Transaction Pool Layer Oct 28, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch Oct 28, 2018

@AM5800 AM5800 referenced this pull request Oct 29, 2018

Closed

Dandelion (BIP 156) #100

if (it_add != m_map_next_tx_added.end()) return it_add->second;
if (m_map_next_tx_removed.find(prevout) != m_map_next_tx_removed.end()) return nullptr;

return m_tx_pool.GetConflictTx(prevout);

This comment has been minimized.

Copy link
@practicalswift

practicalswift Dec 8, 2018

Member

Calling GetConflictTx requires holding the mutex m_tx_pool.cs

}

// Nothing found in the cache, fall back to the inner layer:
const auto it_inner = m_tx_pool.GetIter(txid);

This comment has been minimized.

Copy link
@practicalswift

practicalswift Dec 8, 2018

Member

m_tx_pool.cs must be held when calling GetIter

if (it != m_cache_map_links.end()) return it->second.parents;

CTxMemPool::Layer::setEntries ret;
for (const auto& parent : m_tx_pool.GetMemPoolParents(boost::get<CTxMemPool::txiter>(entry))) {

This comment has been minimized.

Copy link
@practicalswift

practicalswift Dec 8, 2018

Member

m_tx_pool.cs must be held here

@practicalswift

This comment has been minimized.

Copy link
Member

commented Dec 8, 2018

This PR doesn't compile due to missing locks

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch 2 times, most recently to 8a288dc Dec 22, 2018

@DrahtBot DrahtBot removed the Needs rebase label Dec 24, 2018

MarcoFalke added some commits Dec 22, 2018

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch from 8a288dc to 6a7feb6 Mar 7, 2019

@DrahtBot DrahtBot removed the Needs rebase label Mar 7, 2019

@MarcoFalke MarcoFalke force-pushed the MarcoFalke:Mf1807-txpoolStacked branch from 6a7feb6 to 33a025b Mar 8, 2019

@DrahtBot

This comment has been minimized.

Copy link
Contributor

commented Mar 21, 2019

Needs rebase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.