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

listunspent issues #5224

Open
obycode opened this issue Sep 23, 2024 · 1 comment
Open

listunspent issues #5224

obycode opened this issue Sep 23, 2024 · 1 comment

Comments

@obycode
Copy link
Contributor

obycode commented Sep 23, 2024

There are two problems with the miners calls to listunspent:

let payload = BitcoinRPCRequest {
method: "listunspent".to_string(),
params: vec![
min_conf.into(),
max_conf.into(),
addresses.into(),
include_unsafe.into(),
json!({ "minimumAmount": minimum_amount, "maximumCount": config.burnchain.max_unspent_utxos }),
],
id: "stacks".to_string(),
jsonrpc: "2.0".to_string(),
};

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.

obycode added a commit to hirosystems/stacks-regtest-env that referenced this issue Sep 23, 2024
obycode added a commit to hirosystems/stacks-regtest-env that referenced this issue Sep 23, 2024
obycode added a commit to hirosystems/stacks-regtest-env that referenced this issue Sep 23, 2024
@obycode
Copy link
Contributor Author

obycode commented Sep 23, 2024

To avoid problem 1, @kantai's suggestion:

Yeah, realistically, the miner should always spend its last commit’s UTXO
And add another input if necessary

We can make this change with low priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Status: 🆕 New
Development

No branches or pull requests

1 participant