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

Mining: emit a warning when there are multiple UTXOs available, and exit #2645

Closed
jcnelson opened this issue May 3, 2021 · 2 comments · Fixed by #2661
Closed

Mining: emit a warning when there are multiple UTXOs available, and exit #2645

jcnelson opened this issue May 3, 2021 · 2 comments · Fixed by #2661
Assignees
Labels
bug Unwanted or unintended property causing functional harm mining

Comments

@jcnelson
Copy link
Member

jcnelson commented May 3, 2021

It has come to my attention that the Stacks miner will flip-flop between consuming different UTXOs when creating block-commit transactions, if there are multiple UTXOs available. This can happen if there are, for example, two similarly-valuable UTXOs, such that spending one of them will cause the other one to be preferred on the next block-commit transaction. This is very problematic, because it causes the min(mean,median) sampling algorithm to penalize miners that have been continuously online -- the sortition algorithm additionally requires that all block-commit transactions are UTXO-chained.

To remedy this, the miner should check on boot-up whether or not there are multiple UTXOs, and if so, crash with a warning to the user to re-consolidate their UTXOs and try again.

@jcnelson jcnelson added bug Unwanted or unintended property causing functional harm mining labels May 3, 2021
@jcnelson jcnelson self-assigned this May 3, 2021
@project-bot project-bot bot added this to New Issues in Stacks Blockchain Board May 3, 2021
@gzelda
Copy link

gzelda commented May 4, 2021

I think we should think about how to improve the sampling algorithm in the sortition procedure. To make it can track different UTXOs output.

@jcnelson jcnelson moved this from New Issues to Backlog in Stacks Blockchain Board May 10, 2021
jcnelson added a commit that referenced this issue May 18, 2021
…, as opposed to the highest-value. This addresses #2645 without requiring a UTXO consolidation on the miner's part.
jcnelson added a commit that referenced this issue May 18, 2021
@jcnelson jcnelson mentioned this issue May 18, 2021
@jcnelson
Copy link
Member Author

Should be fixed in #2661.

Stacks Blockchain Board automation moved this from Backlog to Done May 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unwanted or unintended property causing functional harm mining
Projects
Development

Successfully merging a pull request may close this issue.

2 participants