lightninglabs / lightninglabs/pool

New pool account where the funding amount + tx fee leaves less balance than open channels' anchor reserves causes pool to error on startup

Open
#514 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
259
Forks
51
PR merge metrics
No merged PRs in 30d

Description

If a user opens a new pool account, where the account funding amount + the onchain transaction fee leaves less balance than the current open channels anchor reserves, `pool` will accept the creation of the account but instantly error, as such a transaction is not allowed to be created by `lnd`.

Furthermore, when restarting `pool`, the startup process will error with:
`unable to start account manager: unable to resume account [string]: rpc error: code = Unknown desc = the outputs to be sent would leave insufficient reserves for anchor channels in the wallet`

This error will be repeated on every restart, until the user has deposited enough new onchain balance to exceed the total value of:
* The account funding amount
* The onchain transaction fee
* The total channel anchor reserves of all open channels

This was reported by a user through:
https://github.com/lightninglabs/lightning-terminal/issues/1193

-----

To resolve the issue for future users, we've discussed offline that we could potentially add the following functionality:

* We shouldn't make `pool` error on startup if this occurs, but rather log it as a warning.
* We could potentially add a 100k sats buffer, and not allow users to fund their pool accounts with the entire on-chain balance and require that the amount at least leaves out the 100k sats buffer.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the pool account-creation and account-manager startup paths, then trace how lnd reports insufficient anchor-channel reserves. Reproduce the failure with funding below the required account, fee, and reserve total; done should cover the agreed startup-warning and minimum-funding behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.