We added the maximumCount option to ensure that the response is not too large, because the HTTP library can only handle messages up to 16MB.
Problem 1
If we hit this limit, the bitcoind will return UTXOs oldest first. A miner's block commit needs to use the output of the previous block commit, so this will be a very recent UTXO, so it may be pruned from the results. This is a problem.
Problem 2
It seems that this option will not actually make it return maximumCount UTXOs. In a test in the nakamoto-3 network, if I call listunspent without this limit, it returns 2513 UTXOs, but then when I call it with the maximumCount set to 1024, it returns 365 UTXOs.
There are two problems with the miners calls to
listunspent
: https://github.com/stacks-network/stacks-core/blob/b5250c60877fa3380b450a7b7e7e9d3e87da6112/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs#L2619-L2630We added the
maximumCount
option to ensure that the response is not too large, because the HTTP library can only handle messages up to 16MB.Problem 1
If we hit this limit, the bitcoind will return UTXOs oldest first. A miner's block commit needs to use the output of the previous block commit, so this will be a very recent UTXO, so it may be pruned from the results. This is a problem.
Problem 2
It seems that this option will not actually make it return
maximumCount
UTXOs. In a test in the nakamoto-3 network, if I calllistunspent
without this limit, it returns 2513 UTXOs, but then when I call it with themaximumCount
set to 1024, it returns 365 UTXOs.