-
Notifications
You must be signed in to change notification settings - Fork 380
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
"Unable to blind the transaction properly." RPC Error sending a transaction consuming many Unpsent Items #1089
Comments
I also have the same problem in the latest version (23.2.1).
|
I'm sorry to hear that we've finally hit this in production and we still haven't done the Bulletproofs hardfork to fix it. This RPC error is also really unhelpful -- though it's better than the old "assertion failure, node shuts down" behavior that we had when we discovered this. Basically yeah, for now the wallet needs to work around this by first consolidating UTXOs, in batches of < 256, until coin selection works. |
I hit this issue last week in production on a custom Elements chain and was pleased to find this thread explaining the problem. Indeed the the error message isn't explicit so it took quite a bit of searching to find this thread. How are plans for the bulletproof work currently? |
Hi @apoelstra, would you elaborate on what you meant by "until coin selection works."? I haven't yet studied why my wallet ended up with >256 utxos, I assumed it was a quirk of the way I was issuing roc commands to it, but is there something innate to the wallet that would trend to large utxo sets anyway? |
It's pretty common and sensible to have large UTXO sets. This isn't the wallet's fault. This would happen no matter what the wallet did if, for example, hundreds of people sent you coins separately and before your wallet had a chance to consolidate. It's also not always sensible to consolidate even if your wallet is online. It's bad for privacy and may be expensive depending on fee market dynamics. What I meant by "until coin selection works" is "until we update to BPs and the 256 limit doesn't apply, or until somebody writes wallet logic in Elements that understands the 256 limit and uses multiple transactions to effect one spend". The timeline on the former is "after Simplicity and once we have pressure to upgrade" -- we expected pressure to come from feerates on Liquid but actually this bug might be a more urgent reason -- and the timeline on the latter (rearchitecting the wallet to do some multi-tx thing) is "likely never". I'm not on the Liquid team and can't really say anything more specific. |
Regarding improved error messaging for this specific case, I need to finish up #1288 |
A "JSON RPC Exception occured: -6: Unable to blind the transaction properly. This should not happen." error is hit where the actions described below are taken (RPC via a Python Script - I'll attach/provide that plus the script I'm using to start the setup).
The error hits where a "large" send is performed with multiple small unsent items available. See also comments further below
Expected behavior
"Large" sendtoaddress RPC Call Succeeds.
Actual behavior
"Large" sendtoaddress RPC Call Fails with "A JSON RPC Exception occured: -6: Unable to blind the transaction properly. This should not happen."
To reproduce
: Loop around transferring a reducing balance of coin, starting at 600 (reduction factor per iteration = 0.999), new address on each transfer.
: Every 20 iterations generate blocks (rpcuser.generatetoaddress(101,rpcuser.getnewaddress()))
: With the command line I've run with, 660 iterations execute successfully and the script exits.
: Mempool is clear
: State is: 696 Unspent Items (max: 310.00791458, min 0.0004928), Wallet Bitcoin Balance showing as 610.
Script used to start the environment (basically ripped from the Blockstream tutorial) and hacky RPC python below.
reset_start_610Free_OneElementsInstance.txt
SplitBitcoinSingleUser.py.txt
Python Execution Command Lines:
Execute the loop:
python SplitBitcoinSingleUser.py 1000 100 600 0.999 310
Re-execute the same command line on completion - The first iteration should trigger the error
python SplitBitcoinSingleUser.py 1000 100 600 0.999 310
Error is observed on the first send.
See also "Any extra information" below
System information
Bitcoin (22.0.0) - From bitcoin Core
Elements (0.21.0.1)
Single Node regtest Setup (as per tutorial mentioned above
Ubuntu 20.04
16 logical CPUs (11th Gen Intel(R) Core(TM) i7-11800H - Single socket, 8 Cores, hyper-threading). Tiger Lake
1 TB SSD
32GB RAM
Extra information
After experimenting with a few Test setups, it seems possible that a significant factor here could be the amount of unspent items built up in the test. After looking at a few configurations and test executions, it seems that the problem hits if the attempted error triggering sendtoaddress is for a value that exceeds the cumulative value of ~240 - 250 of the highest value unspent items, summed.
This might be incorrect - will leave it to the Devs to investigate further/determine, but looks like it to me.
Elements Debug Log Output across a triggering transaction.
The text was updated successfully, but these errors were encountered: