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

unable to abandon pending open that did not broadcast #6812

Closed
thejerrod opened this issue Aug 9, 2022 · 9 comments
Closed

unable to abandon pending open that did not broadcast #6812

thejerrod opened this issue Aug 9, 2022 · 9 comments

Comments

@thejerrod
Copy link

thejerrod commented Aug 9, 2022

Background

I opened a channel from my node sendnodes.space about 3 weeks ago and the tx does not seem to have been broadcasted to the mempool. The opening is pending.

for readers: abandonchannel is a dangerous command and can lead to loss of funds if used incorrectly - ask in the LND slack channel if unsure

I tried to abandon channel after rescanning my wallet (which returned funds) however abandonchannel exits with the following RPC message:

₿ lncli abandonchannel --funding_txid 75f8e4b5c8e80ac7759150b65ce61836f6520c09aeb592656a8d96cca211b6d --i_know_what_i_am_doing
[lncli] rpc error: code = Unknown desc = unable to find closed channel summary

₿ lncli pendingchannels
{
    "total_limbo_balance": "0",
    "pending_open_channels": [
        {
            "channel": {
                "remote_node_pub": "02687b2bfef5ab119857369ef4cba172e8658158c126f11a483a1faee2e5da1dc5",
                "channel_point": "775f8e4b5c8e80ac7759150b65ce61836f6520c09aeb592656a8d96cca211b6d:1",
                "capacity": "2000000",
                "local_balance": "1990594",
                "remote_balance": "0",
                "local_chan_reserve_sat": "20000",
                "remote_chan_reserve_sat": "20000",
                "initiator": "INITIATOR_LOCAL",
                "commitment_type": "ANCHORS",
                "num_forwarding_packages": "0",
                "chan_status_flags": "",
                "private": false
            },
            "commit_fee": "8746",
            "commit_weight": "772",
            "fee_per_kw": "7782"
        }
    ],
    "pending_closing_channels": [
    ],
    "pending_force_closing_channels": [
    ],
    "waiting_close_channels": [
    ]
}

 ₿ lncli listchannels | grep -i 02687b2bfef5ab119857369ef4cba172e8658158c126f11a483a1faee2e5da1dc5
(empty return)

I took too long to troubleshoot and my logs have been rotated out unfortunately.

Your environment

  • lnd version 0.15.0-beta commit=v0.15.0-beta
  • Linux sendNodes 5.10.0-15-amd64 Fix name typo in README #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64 GNU/Linux
  • Bitcoin Core version v23.0
  • logs rotated out unfortunately

Steps to reproduce

I have not attempted to reproduce, I have been wary about trying to open another channel while in this state. others have opened to me without issue

Expected behaviour

lncli abandonchannel should allow to abandon a channel without a finding a closed channel summary

Actual behaviour

lncli abandonchannel may need a closed channel summary which is unavailable on a pending open

@walmer-bolfet
Copy link

I have a channel in a similar situation. I attempted to open it with specifying 1.0 sat/vB fee during a busy mempoot time. The transaction was never acceptedly the mempool, there is no limbo balance, but the pending_open_channel status has remained for over 80 days. After waiting a day for the channel to open, I initiated another channel opening with the same peer, this time specifying a higher sat/vB fee. The opening was successful.

@bitromortac
Copy link
Collaborator

bitromortac commented Aug 9, 2022

Related #5569, also #5986. Please make sure you understand the consequences of using abondonchannel before you do. I'm unsure about the best practices right now, but will let you know.

@walmer-bolfet
Copy link

From where or whom does one learn the consequences of using the lncli abondonchannel command to remedy this particular issue?

@dstadulis
Copy link
Collaborator

Here's some context

$ lncli abandonchannel -h

NAME:
   lncli abandonchannel - Abandons an existing channel.

USAGE:
   lncli abandonchannel [command options] funding_txid [output_index]

CATEGORY:
   Channels

DESCRIPTION:
   
  Removes all channel state from the database except for a close
  summary. This method can be used to get rid of permanently unusable
  channels due to bugs fixed in newer versions of lnd.

  Only available when lnd is built in debug mode. The flag
  --i_know_what_im_doing can be set to override the debug/dev mode
  requirement.

  To view which funding_txids/output_indexes can be used for this command,
  see the channel_point values within the listchannels command output.
  The format for a channel_point is 'funding_txid:output_index'.

OPTIONS:
   --funding_txid value      the txid of the channel's funding transaction
   --output_index value      the output index for the funding output of the funding transaction (default: 0)
   --i_know_what_i_am_doing  override the requirement for lnd needing to be in dev/debug mode to use this command; when setting this the user attests that they know the danger of using this command on channels and that doing so can lead to loss of funds if the channel funding TX ever confirms (or was confirmed)

when setting this the user attests that they know the danger of using this command on channels and that doing so can lead to loss of funds if the channel funding TX ever confirms

@Roasbeef
Copy link
Member

Roasbeef commented Aug 9, 2022

@thejerrod you're not specifying the output_index value. See lncli abandonchannel -h.

@walmer-bolfet the consequences are that if you do it on a channel that is actually open, you've likely lost funds.

@walmer-bolfet
Copy link

Am I right to understand the misuse of this command will result in all or some of my channel balances to be lost forever, not even to be returned through a forced closed process?
The context that might be most help for us in this situation would be a example of the command formatted to address abandonment of a pending opened as described in this issue.

@thejerrod
Copy link
Author

@thejerrod you're not specifying the output_index value. See lncli abandonchannel -h.

Welp thats embarrassing, that fixed my issue. Thank you so much

@bitromortac
Copy link
Collaborator

I think it would be great to have a checklist of what one can do in such a scenario (I currently have such a channel as well).

  1. Try to find out when the channel opening was started, by looking at logs (grep for channel point).
  2. Check mempool/block explorers whether a funding tx was broadcast (txid is first part of channel point):
    The longer ago the process, the less likely it is that a funding transaction was/will be broadcast.
  3. Configure debuglevel=info,FNDG=trace. Restart lnd, if the funding transaction is available and the initiator was local, lnd will re-broadcast the transaction, look for Rebroadcasting funding tx.
  4. If the funding transaction was not rebroadcast (cross check with mempool/block explorers), one can try to abandon the channel.

There is the risk that the peer still has the funding transaction and could broadcast it, so making sure that we have spent the funds is the safest way to protect funds. There is a 14 days period after which usually the peer forgets about the channel (maxWaitNumBlocksFundingConf=2016, per spec.). It would be nice to log the UTXOs that were used to fund the channel, to make sure one can check if they were spent (couldn't find any command/log line to extract that info).

@walmer-bolfet
Copy link

'Oh, I see,' said the blind carpenter, as he picked up his hammer and saw.

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

No branches or pull requests

5 participants