-
Notifications
You must be signed in to change notification settings - Fork 697
fix: get uxtos stall #6242
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
base: develop
Are you sure you want to change the base?
fix: get uxtos stall #6242
Conversation
Bad timing between the Stacks node's processing and the Bitcoin network including a block commit can cause a miner to submit a block commit which breaks the UTXO chain, severly hurting its chances of winning blocks. It is better to just miss this commit than to break the UTXO chain.
ed5dbb7
to
39c6f92
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #6242 +/- ##
===========================================
+ Coverage 77.99% 82.16% +4.17%
===========================================
Files 541 541
Lines 344244 344838 +594
Branches 323 323
===========================================
+ Hits 268496 283340 +14844
+ Misses 75740 61490 -14250
Partials 8 8
... and 207 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Description
This draft PR demonstrates a potential issue where the BitcoinRegtestController::get_utxos(..) method can stall under specific conditions.
The test
test_get_utxos_none_due_to_filter_block_height()
illustrates how the method may hang when called with a block height that has not yet been reached by the Bitcoin chain, producing this error log:The root cause is that get_utxos enters an infinite retry loop in case of errors, with a hardcoded 5-second sleep between attempts. As a result, it can stall indefinitely if the error condition persists.
Relevant code snippet:
stacks-core/testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs
Lines 765 to 786 in 7d8b675
More generally, this issue can occur with any persistent error returned by the
BitcoinRPCRequest::list_unspent
call.Applicable issues
BitcoinRegtestController::get_utxos(..)
stalls when providing burn height greater than tip #6225Additional info (benefits, drawbacks, caveats)
Checklist
docs/rpc/openapi.yaml
andrpc-endpoints.md
for v2 endpoints,event-dispatcher.md
for new events)clarity-benchmarking
repobitcoin-tests.yml