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

[feature]: Make DLP also possible if the peer changed his connectivity policy to not accept inbound connection #9554

Open
ziggie1984 opened this issue Feb 25, 2025 · 3 comments
Labels
channels enhancement Improvements to existing features / behaviour recovery Related to the backup/restoration of LND data (e.g. wallet seeds)
Milestone

Comments

@ziggie1984
Copy link
Collaborator

A node runner reported an issue not being able to recover his channel because the peer was not accepting inbound connections anymore. However the peer was connecting to its node (outbound) and we should in that case just keep the channel shell and let the channel close itself via the re-establishment msg.

@ziggie1984 ziggie1984 added channels enhancement Improvements to existing features / behaviour recovery Related to the backup/restoration of LND data (e.g. wallet seeds) labels Feb 25, 2025
@wildsats
Copy link

Thanks @ziggie1984 for opening this for me. Here is additional data that might help. Please let me know if there is anything else I can help with.

$ lncli pendingchannels
{
    "total_limbo_balance": "0",
    "pending_open_channels": [],
    "pending_closing_channels": [],
    "pending_force_closing_channels": [],
    "waiting_close_channels": [
        {
            "channel": {
                "remote_node_pub": "03XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
                "channel_point": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1",
                "capacity": "10000000",
                "local_balance": "0",
                "remote_balance": "0",
                "local_chan_reserve_sat": "0",
                "remote_chan_reserve_sat": "0",
                "initiator": "INITIATOR_LOCAL",
                "commitment_type": "STATIC_REMOTE_KEY",
                "num_forwarding_packages": "0",
                "chan_status_flags": "ChanStatusLocalDataLoss|ChanStatusRestored",
                "private": true,
                "memo": "",
                "custom_channel_data": ""
            },
            "limbo_balance": "0",
            "commitments": {
                "local_txid": "",
                "remote_txid": "",
                "remote_pending_txid": "",
                "local_commit_fee_sat": "0",
                "remote_commit_fee_sat": "0",
                "remote_pending_commit_fee_sat": "0"
            },
            "closing_txid": "",
            "closing_tx_hex": ""
        }
    ]
}

When running the node I see this happening:

lightning_lnd_1        | 2025-02-25 12:04:22.396 [INF] DISC: GossipSyncer(03XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX): applying gossipFilter(start=0001-01-01 00:00:00 +0000 UTC, end=0001-01-01 00:00:00 +0000 UTC)

When firing SCB, I see everything that contains the channelpoint or PK of the node:

lightning_lnd_1        | 2025-02-25 13:19:46.568 [INF] CHBU: Restoring ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1) to disk: 
lightning_lnd_1        | 2025-02-25 13:19:46.581 [INF] LTND: SCB Recovery: created channel shell for ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1), chan_type=2
lightning_lnd_1        | 2025-02-25 13:19:46.581 [INF] LTND: Inserting 1 SCB channel shells into DB

lightning_lnd_1        | 2025-02-25 13:44:23.568 [INF] CNCT: Close observer for ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1) active
lightning_lnd_1        | 2025-02-25 13:44:23.568 [INF] CNCT: ChannelArbitrator(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): starting state=StateDefault, trigger=chainTrigger, triggerHeight=XXXXX
lightning_lnd_1        | 2025-02-25 13:44:24.602 [WRN] CHBU: Replacing disk backup for ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1) w/ newer version
lightning_lnd_1        | 2025-02-25 13:44:39.853 [INF] PEER: Peer(03XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX): Loading ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1), isPending=false
lightning_lnd_1        | 2025-02-25 13:44:39.853 [WRN] PEER: Peer(03XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX): Unable to find our forwarding policy for channel XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1, using default values
lightning_lnd_1        | 2025-02-25 13:44:39.853 [INF] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): starting
lightning_lnd_1        | 2025-02-25 13:44:39.853 [INF] CNCT: Attempting to update ContractSignals for ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1)
lightning_lnd_1        | 2025-02-25 13:44:39.853 [WRN] LNWL: ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): Set available amount to 0 because we could not pay for the CommitmentFee of the new ChannelState: ourBalance is negative after applying the fee: ourBalance=0, current commitFee(w/o additional htlc)=0 mSAT, feeBuffer=0 mSAT (type=feebuffer) local_chan_initiator
lightning_lnd_1        | 2025-02-25 13:44:39.853 [INF] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): HTLC manager started, bandwidth=0 mSAT
lightning_lnd_1        | 2025-02-25 13:44:39.853 [INF] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): Attempting to re-synchronize channel: SCID=XXX000:XXXX:1, status=ChanStatusLocalDataLoss|ChanStatusRestored, initiator=true, pending=false, local commitment has height=0, local_htlc_index=0, local_log_index=0, remote_htlc_index=0, remote_log_index=0, remote commitment has height=0, local_htlc_index=0, local_log_index=0, remote_htlc_index=0, remote_log_index=0
lightning_lnd_1        | 2025-02-25 13:44:39.977 [INF] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): received re-establishment message from remote side
lightning_lnd_1        | 2025-02-25 13:44:39.978 [ERR] LNWL: ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): sync failed with local data loss: remote believes our tail height is XXX, while we have 0!
lightning_lnd_1        | 2025-02-25 13:44:39.978 [WRN] LNWL: ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): detected restored triggering DLP
lightning_lnd_1        | 2025-02-25 13:44:39.978 [WRN] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): error when syncing channel states: ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1) with CommitPoint(02XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) had possible local commitment state data loss
lightning_lnd_1        | 2025-02-25 13:44:39.980 [ERR] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): failing link: unable to synchronize channel states: ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1) with CommitPoint(02XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX) had possible local commitment state data loss with error: unable to resume channel, recovery required
lightning_lnd_1        | 2025-02-25 13:44:39.980 [INF] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): exited
lightning_lnd_1        | 2025-02-25 13:44:39.980 [INF] HSWC: ChannelLink(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1): stopping
lightning_lnd_1        | 2025-02-25 13:51:51.163 [INF] CHBU: Restoring ChannelPoint(XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:1) to disk:

Hope this helps. Please let me know if there is anything else I can provide.

@wildsats
Copy link

@ziggie1984 asked me to turn debug mode on. Here is the output (before SCB):

lightning_lnd_1        | 2025-02-25 14:45:39.674 [DBG] SRVR: Attempting persistent connection to channel peer <PEER_ID>@<IP>:<PORT>
lightning_lnd_1        | 2025-02-25 14:45:39.674 [DBG] CMGR: Attempting to connect to <PEER_ID>@<IP>:<PORT> (reqid 1)
lightning_lnd_1        | 2025-02-25 14:45:39.674 [DBG] CMGR: Failed to connect to <PEER_ID>@<IP>:<PORT> (reqid 1): dial proxy failed: dial tcp <IP>:<PORT>: connect: connection refused
lightning_lnd_1        | 2025-02-25 14:45:39.674 [DBG] CMGR: Retrying connection to <PEER_ID>@<IP>:<PORT> (reqid 1) in 5s
lightning_lnd_1        | 2025-02-25 14:45:44.675 [DBG] CMGR: Attempting to connect to <PEER_ID>@<IP>:<PORT> (reqid 1)
lightning_lnd_1        | 2025-02-25 14:45:44.675 [DBG] CMGR: Failed to connect to <PEER_ID>@<IP>:<PORT> (reqid 1): dial proxy failed: dial tcp <IP>:<PORT>: connect: connection refused
lightning_lnd_1        | 2025-02-25 14:45:44.675 [DBG] CMGR: Retrying connection to <PEER_ID>@<IP>:<PORT> (reqid 1) in 10s
lightning_lnd_1        | 2025-02-25 14:45:49.749 [DBG] PEER: Peer(<NODE_ID>): Received NodeAnnouncement(node=<PEER_ID>, update_time=2024-05-22 02:01:51 +0000 UTC) from <NODE_ID>@<ONION_ADDRESS>:9736
lightning_lnd_1        | 2025-02-25 14:45:49.749 [DBG] DISC: Processing NodeAnnouncement: peer=<NODE_ID>@<ONION_ADDRESS>:9736, timestamp=2024-05-22 02:01:51 +0000 UTC, node=<PEER_ID>
lightning_lnd_1        | 2025-02-25 14:45:49.749 [DBG] GRPH: Checking stale node <PEER_ID> got Ignoring outdated announcement for <PEER_ID>
lightning_lnd_1        | 2025-02-25 14:45:49.749 [DBG] DISC: Skipped processing stale node: <PEER_ID>
lightning_lnd_1        | 2025-02-25 14:45:54.676 [DBG] CMGR: Attempting to connect to <PEER_ID>@<IP>:<PORT> (reqid 1)
lightning_lnd_1        | 2025-02-25 14:45:54.677 [DBG] CMGR: Failed to connect to <PEER_ID>@<IP>:<PORT> (reqid 1): dial proxy failed: dial tcp <IP>:<PORT>: connect: connection refused
lightning_lnd_1        | 2025-02-25 14:45:54.677 [DBG] CMGR: Retrying connection to <PEER_ID>@<IP>:<PORT> (reqid 1) in 15s

lightning_lnd_1        | 2025-02-25 14:50:09.479 [DBG] SRVR: Sending 0 messages to peer <PEER_ID>
lightning_lnd_1        | 2025-02-25 14:50:11.386 [DBG] PEER: Peer(<PEER_ID>): Sending Ping(ping_bytes=<HEX_STRING>) to <PEER_ID>@<IP>:<PORT>
lightning_lnd_1        | 2025-02-25 14:50:11.861 [DBG] PEER: Peer(<PEER_ID>): Received Pong(len(pong_bytes)=261) from <PEER_ID>@<IP>:<PORT>

@saubyk saubyk added this to the v0.20.0 milestone Feb 25, 2025
@wildsats
Copy link

When starting SCB:

2025-02-25 16:29:21.388 [DBG] CNCT: ChannelArbitrator(<CHANNEL_ID>:1): attempting state step with trigger=chainTrigger from state=StateDefault
2025-02-25 16:29:21.388 [DBG] CNCT: ChannelArbitrator(<CHANNEL_ID>:1): new block (height=885277) examining active HTLC's
2025-02-25 16:29:21.388 [DBG] CNCT: ChannelArbitrator(<CHANNEL_ID>:1): checking commit chain actions at height=885277, in_htlc_count=0, out_htlc_count=0
2025-02-25 16:29:21.388 [DBG] CNCT: ChannelArbitrator(<CHANNEL_ID>:1): no actions for chain trigger, terminating
2025-02-25 16:29:21.388 [DBG] CNCT: ChannelArbitrator(<CHANNEL_ID>:1): terminating at state=StateDefault
2025-02-25 16:50:44.668 [INF] CHBU: Restoring ChannelPoint(<CHANNEL_ID>:1) to disk
2025-02-25 16:50:44.681 [DBG] LTND: Using new ECDH revocation producer format for channel point <CHANNEL_ID>:1
2025-02-25 16:50:44.681 [INF] LTND: SCB Recovery: created channel shell for ChannelPoint(<CHANNEL_ID>:1), chan_type=2

Please let me know if that helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channels enhancement Improvements to existing features / behaviour recovery Related to the backup/restoration of LND data (e.g. wallet seeds)
Projects
None yet
Development

No branches or pull requests

3 participants