Merge bitcoin/bitcoin#33591: Cluster mempool followups
b8d279a81cdoc: add comment to explain correctness of GatherClusters() (Suhas Daftuar)aba7500a30Fix parameter name in getmempoolcluster rpc (Suhas Daftuar)6c1325a091Rename weight -> clusterweight in RPC output, and add doc explaining mempool terminology (Suhas Daftuar)bc2eb931daRequire mempool lock to be held when invoking TRUC checks (Suhas Daftuar)957ae23241Improve comments for getTransactionAncestry to reference cluster counts instead of descendants (Suhas Daftuar)d97d6199ceFix comment to reference cluster limits, not chain limits (Suhas Daftuar)a1b341ef98Sanity check feerate diagram in CTxMemPool::check() (Suhas Daftuar)23d6f457c4rpc: improve getmempoolcluster output (Suhas Daftuar)d2dcd37aacAvoid using mapTx.modify() to update modified fees (Suhas Daftuar)d84ffc24d2doc: add release notes snippet for cluster mempool (Suhas Daftuar)b0417ba944doc: Add design notes for cluster mempool and explain new mempool limits (Suhas Daftuar)2d88966e43miner: replace "package" with "chunk" (Suhas Daftuar)6f3e8eb300Add a GetFeePerVSize() accessor to CFeeRate, and use it in the BlockAssembler (Suhas Daftuar)b5f245f6f2Remove unused DEFAULT_ANCESTOR_SIZE_LIMIT_KVB and DEFAULT_DESCENDANT_SIZE_LIMIT_KVB (Suhas Daftuar)1dac54d506Use cluster size limit instead of ancestor size limit in txpackage unit test (Suhas Daftuar)04f65488caUse cluster size limit instead of ancestor/descendant size limits when sanity checking TRUC policy limits (Suhas Daftuar)634291a7dcUse cluster limits instead of ancestor/descendant limits when sanity checking package policy limits (Suhas Daftuar)fc18ef1f3fRemove ancestor and descendant vsize limits from MemPoolLimits (Suhas Daftuar)ed8e819121Warn user if using -limitancestorsize/-limitdescendantsize that the options have no effect (Suhas Daftuar)80d8df2d47Invoke removeUnchecked() directly in removeForBlock() (Suhas Daftuar)9292570f4cRewrite GetChildren without sets (Suhas Daftuar)3e39ea8c30Rewrite removeForReorg to avoid using sets (Suhas Daftuar)a3c31dfd71scripted-diff: rename AddToMempool -> TryAddToMempool (Suhas Daftuar)a5a7905d83Simplify removeRecursive (Suhas Daftuar)01d8520038Remove unused argument to RemoveStaged (Suhas Daftuar)bc64013e6fRemove unused variable (cacheMap) in mempool (Suhas Daftuar) Pull request description: As suggested in the main cluster mempool PR (https://github.com/bitcoin/bitcoin/pull/28676#pullrequestreview-3177119367), I've pulled out some of the non-essential optimizations and cleanups into this separate PR. Will continue to add more commits here to address non-blocking suggestions/improvements as they come up. ACKs for top commit: instagibbs: ACK https://github.com/bitcoin/bitcoin/pull/33591/commits/b8d279a81c16fe9f5b6d422e518c77344e217d4f sipa: ACKb8d279a81cTree-SHA512: 1a05e99eaf8db2e274a1801307fed5d82f8f917e75ccb9ab0e1b0eb2f9672b13c79d691d78ea7cd96900d0e7d5031a3dd582ebcccc9b1d66eb7455b1d3642235
This commit is contained in:
41 files changed
+587
-334
No files matched your search
@@ -164,7 +164,7 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-26, "non-final", self.nodes[0].sendrawtransaction, timelock_tx)
|
||||
|
||||
self.log.info("Broadcast and mine spend_2 and spend_3")
|
||||
wallet.sendrawtransaction(from_node=self.nodes[0], tx_hex=spend_2['hex'])
|
||||
spend_2_id = wallet.sendrawtransaction(from_node=self.nodes[0], tx_hex=spend_2['hex'])
|
||||
wallet.sendrawtransaction(from_node=self.nodes[0], tx_hex=spend_3['hex'])
|
||||
self.log.info("Generate a block")
|
||||
self.generate(self.nodes[0], 1)
|
||||
@@ -172,7 +172,7 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
|
||||
assert_raises_rpc_error(-26, 'non-final', self.nodes[0].sendrawtransaction, timelock_tx)
|
||||
|
||||
self.log.info("Create spend_2_1 and spend_3_1")
|
||||
spend_2_1 = wallet.create_self_transfer(utxo_to_spend=spend_2["new_utxo"])
|
||||
spend_2_1 = wallet.create_self_transfer(utxo_to_spend=spend_2["new_utxo"], version=1)
|
||||
spend_3_1 = wallet.create_self_transfer(utxo_to_spend=spend_3["new_utxo"])
|
||||
|
||||
self.log.info("Broadcast and mine spend_3_1")
|
||||
@@ -211,6 +211,24 @@ class MempoolCoinbaseTest(BitcoinTestFramework):
|
||||
self.log.info("spend_3_1 has been re-orged out of the chain and is back in the mempool")
|
||||
assert_equal(set(self.nodes[0].getrawmempool()), {spend_1_id, spend_2_1_id, spend_3_1_id})
|
||||
|
||||
self.log.info("Reorg out enough blocks to get spend_2 back in the mempool, along with its child")
|
||||
|
||||
while (spend_2_id not in self.nodes[0].getrawmempool()):
|
||||
b = self.nodes[0].getbestblockhash()
|
||||
for node in self.nodes:
|
||||
node.invalidateblock(b)
|
||||
|
||||
assert(spend_2_id in self.nodes[0].getrawmempool())
|
||||
assert(spend_2_1_id in self.nodes[0].getrawmempool())
|
||||
|
||||
# Chain 10 more transactions off of spend_2_1
|
||||
self.log.info("Give spend_2 some more descendants by creating a chain of 10 transactions spending from it")
|
||||
parent_utxo = spend_2_1["new_utxo"]
|
||||
for i in range(10):
|
||||
tx = wallet.create_self_transfer(utxo_to_spend=parent_utxo, version=1)
|
||||
self.nodes[0].sendrawtransaction(tx['hex'])
|
||||
parent_utxo = tx["new_utxo"]
|
||||
|
||||
self.log.info("Use invalidateblock to re-org back and make all those coinbase spends immature/invalid")
|
||||
b = self.nodes[0].getblockhash(first_block + 100)
|
||||
|
||||
|
||||
Reference in new issue
Block a user