sparrowwallet / sparrow

Desktop Bitcoin Wallet focused on security and privacy. Free and open source.
https://sparrowwallet.com/
Apache License 2.0
1.33k stars 188 forks source link

Some UTXOs will not attempt Whirlpool remixing #708

Closed louieo closed 2 years ago

louieo commented 2 years ago

"Mix now" context menu pops up with error: "cannot add to mix queue: no pool set for POSTMIX / SEGWIT_NATIVE: ...... state={poolId=null, status=READY, mixableStatus=NO_POOL}....."

I have connected to another user's Fulcrum server to test and have also tried against my own Electrs instance. Samourai have unbanned all UTXOs and yet after > 24 hours the same error pops up. All these UTXOs are sitting on 1 yet I have 2 UTXOs that have mixed 10+

craigraw commented 2 years ago

This is an unusual problem that will require some debugging to understand what is going on. Try the following:

  1. Disconnect and reconnect Sparrow with the wallet open using the toggle in the lower right. Wait for the wallet to reload.
  2. Use the key combination Ctrl+Shift+Alt+W to ask Sparrow to print debugging information to the log
  3. Examine the log file at the end (can use Help menu to open).

You are looking in particular to find the POSTMIX UTXOS section. Here are a couple of healthy lines as an example:

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ POSTMIX UTXOS (26) (0.02888078btc at 2022-10-17 08:50:23):
|    BALANCE | CONFIRM |                                                                 UTXO |                                       ADDRESS |          TYPE |                        PATH |         STATUS |  MIXABLE |     POOL | MIXS |            ACTIVITY |               ERROR |
|      0.001 |   28715 |   9bfb...                                                            |    tb1qvlg...                                 | SEGWIT_NATIVE |  m/84'/0'/2147483646'/0/593 |    MIX_STARTED |  MIXABLE | 0.001btc |   10 | 2022-10-17 08:50:23  |                     |
|      0.001 |   28702 |   e6fc8....                                                          |    tb1qwg....                                 | SEGWIT_NATIVE |  m/84'/0'/2147483646'/0/601 |      MIX_QUEUE |  MIXABLE | 0.001btc |    8 |                     |                     |

The information is privacy sensitive, so I have redacted the txids and addresses. It would be useful to see what is going on with the UTXOs on your wallet in a similar way.

louieo commented 2 years ago

Thanks Craig. Here is my (redacted) logging output....

now = 2022-10-19 08:36:33
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿ RECEIVE ADDRESS
 • Address: bc1q......................................
 • Path: m/84'/0'/0'/0/2
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿ WALLET BALANCE:
 • DEPOSIT: 0 utxos
___DEPOSIT/LEGACY: 0 utxos, pub=xpu...AZ3
______.index[RECEIVE] = 2
______.index[CHANGE] = 0
___DEPOSIT/SEGWIT_COMPAT: 0 utxos, pub=ypu...fDA
______.index[RECEIVE] = 2
______.index[CHANGE] = 0
___DEPOSIT/SEGWIT_NATIVE: 0 utxos, pub=zpu...n2D
______.index[RECEIVE] = 2
______.index[CHANGE] = 0
 • PREMIX: 0 utxos
___PREMIX/SEGWIT_NATIVE: 0 utxos, pub=zpu...wdu
______.index[RECEIVE] = 15
______.index[CHANGE] = 0
 • POSTMIX: 11 utxos
___POSTMIX/SEGWIT_NATIVE: 11 utxos, pub=zpu...HLP
______.index[RECEIVE] = 79
______.index[CHANGE] = 10
 • BADBANK: 2 utxos
___BADBANK/SEGWIT_NATIVE: 2 utxos, pub=zpu...3zA
______.index[RECEIVE] = 0
______.index[CHANGE] = 6
 • TOTAL = 0.xxxxxxx BTC
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿ LATEST BLOCK:
 • Height: 759275
 • Hash: 0000000000000000000000000000000000000000000000000000000000000000
 • Time: 2022-10-19 08:15:57
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿ MINER FEE:
fee[BLOCKS_2] = 12
fee[BLOCKS_4] = 11
fee[BLOCKS_6] = 11
fee[BLOCKS_12] = 10
fee[BLOCKS_24] = 10

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ DEPOSIT UTXOS (0) (0.xxxxxxxbtc at 2022-10-19 08:36:10):
|    BALANCE | CONFIRM |                                                                 UTXO |                                       ADDRESS |          TYPE |                        PATH |         STATUS |  MIXABLE |     POOL | MIXS |            ACTIVITY |               ERROR |

|      (btc) |         |                                                                      |                                               |               |                             |                |          |          |      |                     |                     |

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ PREMIX UTXOS (0) (0.xxxxxxxbtc at 2022-10-19 08:36:10):
|    BALANCE | CONFIRM |                                                                 UTXO |                                       ADDRESS |          TYPE |                        PATH |         STATUS |  MIXABLE |     POOL | MIXS |            ACTIVITY |               ERROR |

|      (btc) |         |                                                                      |                                               |               |                             |                |          |          |      |                     |                     |

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ POSTMIX UTXOS (11) (0.xxxxxxxbtc at 2022-10-19 08:36:10):
|    BALANCE | CONFIRM |                                                                 UTXO |                                       ADDRESS |          TYPE |                        PATH |         STATUS |  MIXABLE |     POOL | MIXS |            ACTIVITY |               ERROR |

|      (btc) |         |                                                                      |                                               |               |                             |                |          |          |      |                     |                     |

| xxxxxxxxxx |    9764 |   610.............................................................:1 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/0 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    9662 |   b8b.............................................................:0 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/2 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    9662 |   b8b.............................................................:1 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/1 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    9660 |   96e.............................................................:0 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/5 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    9660 |   96e.............................................................:1 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/6 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    9660 |   96e.............................................................:3 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/4 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    7126 |   18d.............................................................:0 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/8 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    7126 |   18d.............................................................:1 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/7 |          READY |  NO_POOL |        - |    1 |                     |                     |
| xxxxxxxxxx |    7126 |   18d.............................................................:3 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483646'/1/9 |          READY |  NO_POOL |        - |    1 |                     |                     |
|       0.01 |     750 |   86f.............................................................:4 |    bc1q...................................... | SEGWIT_NATIVE |   m/84'/0'/2147483646'/0/72 |    MIX_STARTED |  MIXABLE |  0.01btc |   12 | 2022-10-19 08:35:21  |                     |
|      0.001 |     475 |   822.............................................................:4 |    bc1q...................................... | SEGWIT_NATIVE |   m/84'/0'/2147483646'/0/78 |    MIX_STARTED |  MIXABLE | 0.001btc |   23 | 2022-10-19 08:35:21  |

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ BADBANK UTXOS (2) (0.xxxxxxxbtc at 2022-10-19 08:36:10):
|    BALANCE | CONFIRM |                                                                 UTXO |                                       ADDRESS |          TYPE |                        PATH |         STATUS |  MIXABLE |     POOL | MIXS |            ACTIVITY |               ERROR |

|      (btc) |         |                                                                      |                                               |               |                             |                |          |          |      |                     |                     |

|   xxxxxxxx |    9781 |   000.............................................................:2 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483644'/1/3 |          READY |  NO_POOL |        - |    0 |                     |                     |
|   xxxxxxxx |    1330 |   9be.............................................................:2 |    bc1q...................................... | SEGWIT_NATIVE |    m/84'/0'/2147483644'/1/5 |          READY |  NO_POOL |        - |    0 |                     |                     |

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿ MIXING THREADS:
|                    STATUS |    SINCE |    ACCOUNT |    BALANCE | CONFIRMS |                                                                 UTXO |           PATH |     POOL |   MIXS |            ACTIVITY |               ERROR |

|     30%: REGISTERED_INPUT |      72s |    POSTMIX |       0.01 |      750 |   86f.............................................................:4 |         M/0/72 |  0.01btc |     12 | 2022-10-19 08:35:21  |                     |

|     30%: REGISTERED_INPUT |      72s |    POSTMIX |      0.001 |      475 |   822.............................................................:4 |         M/0/78 | 0.001btc |     23 | 2022-10-19 08:35:21  |                     |

Mixing: 2 (0+2)
Queued: 0 (0+0)

⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿
⣿ SYSTEM THREADS:
#0 Thread[InvokeLaterDispatcher,5,main]:WAITING
#1 Thread[JavaFX Application Thread,5,main]:RUNNABLE
#2 Thread[JavaFX-Launcher,5,main]:WAITING
#3 Thread[main,5,main]:WAITING
#4 Thread[QuantumRenderer-0,5,main]:WAITING
#5 Thread[RxCachedWorkerPoolEvictor-1,5,main]:TIMED_WAITING
#6 Thread[RxComputationThreadPool-1,5,main]:TIMED_WAITING
#7 Thread[RxComputationThreadPool-2,5,main]:TIMED_WAITING
#8 Thread[RxComputationThreadPool-3,5,main]:TIMED_WAITING
#9 Thread[RxComputationThreadPool-4,5,main]:TIMED_WAITING
#10 Thread[RxSchedulerPurge-1,5,main]:TIMED_WAITING
#11 Thread[ScheduledService Delay Timer,5,main]:TIMED_WAITING
#12 Thread[Thread-1,5,main]:RUNNABLE
#13 Thread[Thread-2,5,main]:RUNNABLE
⣿ MEM USE: 95M/248M
craigraw commented 2 years ago

Thanks. Is there a reason you redacted most of the amounts in the POSTMIX UTXOs section (but not the last two)? This is the most critical information I was looking for, as poolId is determined from UTXO amounts.

louieo commented 2 years ago

Ah yes I thought that might be the case! here's the amounts.....

| 0.00199712 |    9764 |   610.............................................................:1 |
|  9.3081E-4 |    9662 |   b8b.............................................................:0 |
|  0.0010675 |    9662 |   b8b.............................................................:1 |
| 0.00893114 |    9660 |   96e.............................................................:0 |
| 0.04893114 |    9660 |   96e.............................................................:1 |
|  0.0010675 |    9660 |   96e.............................................................:3 |
| 0.04903274 |    7126 |   18d.............................................................:0 |
|  0.0108957 |    7126 |   18d.............................................................:1 |
|  1.0193E-4 |    7126 |   18d.............................................................:3 |
|       0.01 |     750 |   86f.............................................................:4 |
|      0.001 |     475 |   822.............................................................:4 |
craigraw commented 2 years ago

Ah - the reason there is no pool for most of these UTXOs is their amounts/values do not match any pool size. Only the last two have values that correlate to an available pool.

This is normal once you spend postmix UTXOs. You can of course send these back into the Deposit account for remixing, but it may not be necessary - it depends on their origin, and future spending destination.

louieo commented 2 years ago

Ok thanks Craig, that makes sense.