Disconnect loop with lnd while a channel awaits confirmation takes every channel to that peer offline (0.3.0-rc3)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 22/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- networking
調査の方向性
The countdown starts in Channel::should_disconnect_peer_awaiting_response in channel.rs, and timer_tick_occurred in channelmanager.rs (near line 9168) then disconnects the whole peer. Read the is_peer_disconnected() state handling and the #963 lnd workaround to see what counts as progress. Done means an unconfirmed channel no longer triggers a peer-wide disconnect while a sibling channel stays usable, shown by a functional test where the peer withholds channel_reestablish. Maintainers have not yet decided whether the fix belongs in LDK, so confirm that before writing code.
索引モデルが issue の本文から書いたものです。
説明
Summary
When an lnd peer reconnects while one of our channels with it is still waiting for confirmations, lnd does not send channel_reestablish for that channel (lightningnetwork/lnd#4006: lnd skips pending channels when it sends reestablish). On our side the channel stays is_peer_disconnected(), should_disconnect_peer_awaiting_response starts counting, and after DISCONNECT_PEER_AWAITING_RESPONSE_TICKS the ChannelManager disconnects the peer with "Disconnecting peer due to not making any progress". lnd redials and the cycle repeats for as long as the channel stays pending.
The disconnect is per peer, so every other channel with that lnd node goes down with it, including channels that are confirmed and usable.
Environment
- LDK side: ldk-server
d36ad214→ ldk-node 0.8.0+git (179b4b26) → lightning 0.3.0-rc3 (d7a98064).- Built from source with
cargo build --release --locked, Rust 1.97.1,x86_64-unknown-linux-gnu. - ldk-node defaults: no custom handshake or channel config.
- Electrum chain source; P2P listener on 127.0.0.1.
- The code involved is unchanged on the
0.3branch head (a425826f).
- Built from source with
- lnd side: lnd v0.21.5-beta,
nolisten=true(so lnd always dials us),bitcoin.node=bitcoindwithbitcoind.rpcpolling=true. The LDK node was added withlncli connect --perm. - Chain: signet. Both nodes use the same local node, rbitcoin (an independent Rust implementation, development build), which serves Electrum to LDK and bitcoind RPC to lnd. Neither side's decision depends on the chain backend: lnd's comes from its own
IsPending()state, LDK's from the timer tick. - Channels: both anchor channels (
ANCHORSin lnd), unannounced, over loopback. - Host: Debian 13, Linux 6.12 x86_64, both nodes on one machine under systemd.
Reproduction
- Channel B: LDK opens 40,000 sat to lnd. It confirms and is usable.
- Channel A: lnd opens 80,000 sat to LDK. LDK requires 6 confirmations.
- Restart the LDK node while A is unconfirmed. Any reconnect does the same.
LDK log, debug level, A = d6c73c…, B = 9a201f…, lnd = 02a492…:
DEBUG lightning::ln::channelmanager:16219] Generated channel_reestablish event for channel 9a201f… (ch:9a201f p:02a492)
DEBUG lightning::ln::channelmanager:16219] Generated channel_reestablish event for channel d6c73c… (ch:d6c73c p:02a492)
DEBUG lightning::ln::channelmanager:9170] Disconnecting peer due to not making any progress (ch:d6c73c p:02a492)
lnd log, per cycle:
[INF] SRVR: Established outbound connection to: <ldk>@127.0.0.1:9737
[INF] PEER: Peer(<ldk>): Loading ChannelPoint(<B>:1), isPending=false
[INF] PEER: Peer(<ldk>): Loading ChannelPoint(<A>:1), isPending=true
[INF] PEER: Peer(<ldk>): disconnecting <ldk>@127.0.0.1:9737, reason: read handler closed (80-100 s later)
How often we've seen it. Every reconnect during a pending window looped:
- With B pending (LDK as funder), after one restart.
- With A pending (lnd as funder), after two restarts. Since 03:30Z (debug on), LDK logged 6 "not making any progress" disconnects. lnd logged 13 drops of this peer since 03:18Z, 3 of them our own restarts.
- The same loop with ldk-node 0.7.0 / LDK 0.2.x as fundee on 2026-11-06, reported on lnd#4006.
At the time of writing A has 2 of 6 confirmations and the loop is still running. We'll add a comment once it confirms, saying whether the loop stops then.
Measured impact
With A pending, we sent a 100 sat payment from LDK to lnd over B every 10 s for 6 minutes. 6 succeeded and 30 failed with RouteNotFound because the peer was disconnected.
lnd's reconnect backoff grows with each cycle. The gaps between disconnect and redial were 4 s, then 41 s, then 6 min 19 s, so B's outages get longer. Our lnd does not listen, so LDK cannot redial it. A listening lnd would shorten the gaps, but the loop would continue.
For a routing node this means: open a new channel to an lnd peer you already have channels with, then restart or lose the connection before it confirms, and every existing channel to that peer flaps until it does.
Where it comes from (v0.3-rc3)
Channel::should_disconnect_peer_awaiting_response (channel.rs) starts the countdown when channel_state.is_peer_disconnected() ("Cleared upon receiving channel_reestablish"), and timer_tick_occurred (channelmanager.rs, near line 9168) then disconnects the whole peer. The #963 workaround handles lnd sending channel_ready before channel_reestablish. Here lnd sends nothing for the channel until it stops being pending.
Related: #2293 (added the timer disconnect, motivated by lnd#7682), #1849 (the lnd workaround only works after a reconnect), and #3695 (the same loop shape from a stalled async signer).
A possible narrow change, and a question
Don't start the awaiting-response countdown from is_peer_disconnected() for a channel that has not reached channel_ready on either side and is not zero-conf. Nothing can happen on such a channel until it confirms. lnd sends channel_ready/channel_reestablish once the channel stops being pending, and the existing workaround handles that. Channels that are already open keep today's behaviour.
Would you want a PR for this? If so, we'd add a functional test: a peer that withholds channel_reestablish for an unconfirmed channel, asserting no disconnect and that a sibling channel stays usable. We'd also re-run this lab against the branch. We understand from #1849 that lnd workarounds aren't something you want to grow, so we'll take your lead on whether this belongs in LDK or only in lnd.
- 主要言語
- Rust
- スター
- 1.4k
- フォーク
- 482
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
lightningdevkit/rust-lightning のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
lightningdevkit/rust-lightning#4767 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
lightningdevkit/rust-lightning#1849 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 22/100
lightningdevkit/rust-lightning#4757 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 28/100
lightningdevkit/rust-lightning#4739 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
lightningdevkit/rust-lightning#4738 · コメント 3 件 ·
lightningdevkit/rust-lightning の issue をすべて見る
似ている issue
-
bug help wanted ui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
userFRM/egui-charts#4292 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
Tripstack-Corp/spyc#1352 ·
メンテナーはふだん 1 日以内に返信
-
marketing
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
area:tui enhancement P2
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
agent-of-empires/agent-of-empires#6077 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信