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

[Issue] Anchor output reserve - can't open channels #5866

Closed
Darth-Coin opened this issue Oct 16, 2021 · 16 comments
Closed

[Issue] Anchor output reserve - can't open channels #5866

Darth-Coin opened this issue Oct 16, 2021 · 16 comments

Comments

@Darth-Coin
Copy link

Darth-Coin commented Oct 16, 2021

Background

Tried to open a channel, peer is online, I have enough funds in onchain, like 2.7M sats in 1 UTXO.
I always get an error that doesn't say too much:
reserved wallet balance invalidated

Your environment

  • LND v.13.3
  • Debian 10
  • Umbrel node v 0.4.4 (latest)
  • 35 other channels open, working fine, routing etc, with total liquidity of almost 30M sats

Steps to reproduce

I used RTL, Thunderhub, Umbrel dashboard, lncli, Zap mobile/desktop, Zeus to try to open a channel of 2 or 2.5M sats
Error in RTL: reserved wallet balance invalidated
Error in Thunderhub: failed to open channel
Umbrel: reserved wallet balance invalidated
Zap, Zeus: reserved wallet balance invalidated
lncli: rpc error: code = Unknown desc = reserved wallet balance invalidated
Whatever amount I put, is the same message, that doesn't say too much, what should I do or how to fix it.
I looked for more documentation and I found that is due to new feature release of anchor output reserve, but there is no place to explain how to deal with this "reserve", there's no specific amount that user can know to keep or use in "reserve", nothing.

I tried also disabling this feature editing the lnd.conf file with
[protocol]
protocol.no-anchors=true
restart lnd, tried again, same error

Expected behaviour

  • To have a damn explanatory message saying what to do or calculate or send to specific documentation.
  • Leave only the commit fees to calculate this reserve and deduct from the amount the necessary fee/reserve
  • make a way that user will see and label that specific reserve in a UTXO and be clear that is not to be touched/moved from that wallet. Also to not be reflected into "available balance".

Actual behaviour

Can't open channels and also I don't know or calculate how much I should have in "reserve".
Right now is just confusing, how much is in "reserve" and how much is available to spend. nobody knows that, none of wallet apps is showing that.
This will just create more issues and chaos with so many noobs running nodes.

Please advise how to deal with this. Make a specific documentation for users, it is very confusing.

Additional references

https://bitcoinops.org/en/topics/anchor-outputs/
#5599
#5648

I also posted some requests / fixes to these apps, to see if more people come up with a nice solution:
Ride-The-Lightning/RTL#833
apotdevin/thunderhub#352
getumbrel/umbrel-lightning#29

EDIT
additional test:
I sent 100k sats to a new UTXO to the node wallet.
Still doesn't let me to open a channel with the 2.7M sats, whatever amount I try to use.
This is getting ridiculous.

Another question: when I open a channel how do I know that is not taking from this "reserve" UTXO, how do I make coin control when I open a channel in TH, RTL, Zeus, Zap etc...

@JaviLib
Copy link

JaviLib commented Oct 16, 2021

Yep, the wallet should not indicate that those coins are available, when in reality they are reserved. There should be a clear distinction between available and reserved coins. This also do break many scripts, wallets and interfaces, so I don’t think it is an issue, but a clear bug.

@Roasbeef
Copy link
Member

This should be fixed by: #5665

The fix is in master, and will be a part of the 0.14 release. The reserve check wasn't taking into account change outputs. So if you have a single UTXO, then it would prevent you from opening a channel.

A short term work around is to ensure you have multiple UTXOs before opening a channel.

@Darth-Coin
Copy link
Author

Ok, as I mentioned in edit part, I sent to another UTXO 100k (that is supposedly the higher limit to have as reserve).
Is still not letting me to open any channel of any amount.
How can I disable this anchor?
As I mention I added to lnd.conf file that option mentioned in the documentation
[protocol]
protocol.no-anchors=true
But seems that is ignoring it.
What other option I can put to skip the anchor output?

You said to have multiple UTXOs. But how will be decided, next time when I will open another channel? What is are used all of them?
Not having the option for coin control for LND is ridiculous to say that I need just a bunch of UTXO to be able to use my LND node.

@Roasbeef
Copy link
Member

You said to have multiple UTXOs. But how will be decided, next time when I will open another channel? What is are used all of them?

After the transaction has been crafted, so if it ends up combining that UTXO, then it'll run into the same condition on anything before master or 0.14.

Not having the option for coin control for LND is ridiculous to say that I need just a bunch of UTXO to be able to use my LND node.

Read my message again, it's a bug that's been fixed. You do in fact have coin selection if you use PSBT to fund the transaction or any one of the manual means.

What other option I can put to skip the anchor output?

That's the correct option, but once you've opened a single anchor channel, then system will ensure you have UTXO reserved since if you empty the wallet, fee bumping would require manual intervention.

Closing the issue as it's been resolved.

@Darth-Coin
Copy link
Author

A short term work around is to ensure you have multiple UTXOs before opening a channel.

OK now I have 5 UTXOs with many different amounts. As you said, but didn't specified how many exactly are needed.
So in your opinion, I should be able to open a channel. But I still can't. Whatever amount I put. Not talking that I would like to use that entire UTXO of 2.4M sats in a new channel (and is not possible).
image

So right now I can't use anymore my LND node.
How would the fix will deal with this?
I will be able to select an entire UTXO to open a channel?
I will be able to keep only one UTXO as anchor reserve and be marked as "reserve" in total balance?
I will be able to use all these UTXOs (except one for anchor) to open a new channel?
Or I should just shut down this LND node and start a C-Lightning one?

@Darth-Coin
Copy link
Author

Darth-Coin commented Oct 22, 2021

Now I have many examples of nodes that are fucked up because of this anchor bug.
This one had a closed channel, with 1.6M sats local and 400k sats remote.
As you can see the closing is with 1.6M sats local and remote 0.
Local wallet received the 1.6M but remote get 0.
So where are those 400k sats?

image

image

More cases here
https://community.getumbrel.com/t/bitcoin-wallet-withdrawal/3171
https://community.getumbrel.com/t/reserved-wallet-balance-invalidated/4431

@NicolasDorier
Copy link
Contributor

The fix of this issue deserve a new version. Lot's of our users have issues caused because of this.

@Roasbeef
Copy link
Member

@Darth-Coin are you able to repro w/ lnd 0.14?

@Darth-Coin
Copy link
Author

@Darth-Coin are you able to repro w/ lnd 0.14?

Thanks for asking. Not yet. I am waiting for Umbrel devs to update the backend to v0.14.
I will come back to you after that.

What should be the behavior now?
Right now I have in onchain balance 3 UTXOs: 1x100k, 1x200k, 1x36k change.
In lnd.conf file I have protocol.no-anchors=true

Questions:

  • would be able to open a channel with all those UTXOs leaving empty the onchain?
  • would be able to deposit to a new UTXO 1M sats and open only with that UTXO 1 channel?
  • would be those 3 UTXO linked to all open channels? Can be that traceable?
  • would be possible to have some kind of coin control for all these anchor UTXOs? Like not showing "available" in total balance? Or at least a mention/sign "these funds are reserved", so all noob user will understand why is not possible to use them.

@difigue
Copy link

difigue commented Nov 30, 2021

Hello, I'm getting Unable to open channel, reserved wallet balance invalidated: transaction would leave insufficient funds for fee bumping anchor channel closings (see debug log for details) when I try to open a new channel. Currently on 0.14.1-beta (latest). As @Darth-Coin mentioned, it would be very helpful to have some explanation or documentation regarding this message. Where can I disable anchor channels? What's the minimum UTXO balance that I need to have?

@difigue
Copy link

difigue commented Nov 30, 2021

Where can I disable anchor channels?

Adding protocol.no-anchors=true in lnd.conf solved it for me. New channel is now opening.

@Roasbeef
Copy link
Member

Hello, I'm getting Unable to open channel, reserved wallet balance invalidated: transaction would leave insufficient funds for fee bumping anchor channel closings (see debug log for details) when I try to open a new channel

Anchor channels allow your node to increase the fee of a published commitment transaction. In order to do that, your node needs to maintain a certain amount of funds on-chain. If you ensure you have at least a single 100k satoshi output on-chain, then you'll be able to use everything as normal.

Adding protocol.no-anchors=true in lnd.conf solved it for me. New channel is now opening.

Adding that doesn't disable this check. The check is still executed as long as any anchor channels are open. Creating new channels will increase the amount of reserved funds up to 100k sats total. Note that anchor channels are safer than non-anchor, as they actually allow the commitment fee to be increased in a high fee rate environment. Otherwise, it's possible that you aren't able to publish your commitment transaction (to enter the mempool), meaning it can't be mined.

@difigue
Copy link

difigue commented Nov 30, 2021

Thank you for your explanation. I understand it now.

@Darth-Coin
Copy link
Author

@Darth-Coin are you able to repro w/ lnd 0.14?

Yes, today I could test it.
Umbrel with LND v0.14.1

Had 5 UTXOs with various amounts and 1 UTXO with 100k sats. Total was like 665000 sats
I tried first with all balance to open the channel, It came the message that I need more sats for anchor reserve
So I open a channel of 565000 sats.
I was expecting to get an error for insufficient funds, because of taking the fee from that 100k UTXO, but it didn't.
Channel is open and a small fee was taken from that last 100k UTXO.

@xjmzx
Copy link

xjmzx commented Dec 12, 2021

Just wanted to add as Darth said above that I had exactly the same experience on v0.14.1, today.
using bos to batch open 3 channels, utilizing pretty much all of my utxos (pretty careless really)
Anyway, Just ran the same open with one channel at a significantly smaller size to cover the necessary buffer,
all channels opened fine.

Would be good to have a small addition to the error to know that you can rerun the open at a reduced size,
or some note explaining funds are probably not lost.

@CommanderPoe
Copy link

@Darth-Coin are you able to repro w/ lnd 0.14?

Thanks for asking. Not yet. I am waiting for Umbrel devs to update the backend to v0.14. I will come back to you after that.

What should be the behavior now? Right now I have in onchain balance 3 UTXOs: 1x100k, 1x200k, 1x36k change. In lnd.conf file I have protocol.no-anchors=true

Questions:

  • would be able to open a channel with all those UTXOs leaving empty the onchain?
  • would be able to deposit to a new UTXO 1M sats and open only with that UTXO 1 channel?
  • would be those 3 UTXO linked to all open channels? Can be that traceable?
  • would be possible to have some kind of coin control for all these anchor UTXOs? Like not showing "available" in total balance? Or at least a mention/sign "these funds are reserved", so all noob user will understand why is not possible to use them.

I wonder if all these genuine questions are solved with the latest version... Im experiencing the same when trying to open a channel with a single utxo in my wallet atm...

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

No branches or pull requests

7 participants