mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-06-12 15:49:31 +02:00
Merge bitcoin/bitcoin#34615: mempool: expose optimality of mempool to log / rpc
a9e59f7d95rpc: add optimal result to getmempoolinfo (Greg Sanders)a3fb3dd55cmempool: log if we detect a non-optimal mempool (Greg Sanders) Pull request description: Post-SFL #34023 I don't think we expect the mempool to be unordered for long periods of time. If we consider it likely to be a serious regression in production, it would be useful to expose the fact that the mempool is not known to be optimal. 1. do a MEMPOOL log after any `DoWork()` returns false, meaning non-optimal 2. expose it via getmempoolinfo, by calling `DoWork(0)`, which does nothing but return known-optimality I'm not wedded to either approach, I just think something is better than nothing for the next release. ACKs for top commit: ajtowns: ACKa9e59f7d95ismaelsadeeq: reACKa9e59f7d95[c89b93b95..a9e59f7d95](c89b93b958..a9e59f7d95) fixed typo, added more logging for block/reorg additions to mempool, and fixed brittle test case. sedited: ACKa9e59f7d95sipa: ACKa9e59f7d95Tree-SHA512: 1560ad21cc1606df7279c102f35f61d4555c0ac920f02208b2a6eb89b14d7e22befb6d7f510a00a9074c2f9931f32e9af86bcea3a8dd9a1d947b0398c84666dd
This commit is contained in:
@@ -306,6 +306,9 @@ class MempoolClusterTest(BitcoinTestFramework):
|
||||
|
||||
assert_equal(node.getrawmempool(), [])
|
||||
|
||||
# Key should exist and be trivially optimal
|
||||
assert node.getmempoolinfo()["optimal"]
|
||||
|
||||
# Not in-mempool
|
||||
not_mempool_tx = self.wallet.create_self_transfer()
|
||||
assert_raises_rpc_error(-5, "Transaction not in mempool", node.getmempoolcluster, not_mempool_tx["txid"])
|
||||
@@ -367,6 +370,9 @@ class MempoolClusterTest(BitcoinTestFramework):
|
||||
chunkfee = first_chunk_tx["fee"] + second_chunk_tx["fee"] + third_chunk_tx["fee"]
|
||||
assert_equal(first_chunk_info, {'clusterweight': first_chunkweight + second_chunkweight + third_chunkweight, 'txcount': 3, 'chunks': [{'chunkfee': first_chunk_tx["fee"], 'chunkweight': first_chunkweight, 'txs': [first_chunk_tx["txid"]]}, {'chunkfee': second_chunk_tx["fee"], 'chunkweight': second_chunkweight, 'txs': [second_chunk_tx["txid"]]}, {'chunkfee': third_chunk_tx["fee"], 'chunkweight': third_chunkweight, 'txs': [third_chunk_tx["txid"]]}]})
|
||||
|
||||
# We expect known optimality directly after txn submission
|
||||
assert node.getmempoolinfo()["optimal"]
|
||||
|
||||
# If we prioritise the last transaction it can join the second transaction's chunk.
|
||||
node.prioritisetransaction(third_chunk_tx["txid"], 0, int(third_chunk_tx["fee"]*COIN) + 1)
|
||||
first_chunk_info = node.getmempoolcluster(first_chunk_tx["txid"])
|
||||
|
||||
Reference in New Issue
Block a user