xpay treats a local "Too many HTLCs" failure as a 1 msat capacity shortfall and floods the route with dust parts.
维护者通常 1 天内回复
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- c
- 领域
- backend, networking, payments
调研方向
Start by tracing the local failure path in plugins/xpay/xpay.c at the handling and askrene-inform-channel calls, then compare it with channeld/channeld.c and channeld/full_channel.c. Check how plugins/askrene/askrene.c records constrained amounts. Done means a local "Too many HTLCs" failure no longer causes repeated amount-minus-1-msat retries and dust-part creation; verify the behavior with the relevant existing test or reproduction.
由索引模型根据 Issue 内容生成。
描述
When our own outgoing channel has no free HTLC slots, channeld fails the HTLC with temporary_channel_failure ("Too many HTLCs"). xpay handles that like a liquidity failure and tells askrene the channel is constrained to the attempted amount. askrene stores that as "amount minus 1 msat". The same channel stays the cheapest route, so the next getroutes sends the big part over it again, 1 msat smaller, and routes the 1 msat leftover elsewhere. Each retry fails again on the full slots, so xpay produces one new 1–17 msat part per failure. A slot shortage doesn't depend on the amount, so this loop can never succeed.
Observed (mainnet, v26.06.8)
Payment of 298,495 sat, retry_for 60 s:
- From the first "Too many HTLCs" on our own channel (
erring_index0), xpay ran this cycle 98 times in 14
s, about once every 60 ms. - The dust parts summed to 237 msat. They went over other channels, reached the destination, and were held
there for about 2 minutes untilmpp_timeout. - The main part (~295.5k sat) never left our node, so the payment failed.
xpay log (ids shortened):
260: routes for 295521663msat = [1msat via 4 hops, 295521662msat via 2 hops]
260: ...: We got failed: WIRE_TEMPORARY_CHANNEL_FAILURE (WIRE_TEMPORARY_CHANNEL_FAILURE: Too many HTLCs)
for <local scidd>, assuming it can't carry 295521662msat
260: routes for 295521662msat = [1msat via 4 hops, 295521661msat via 2 hops]
260: ...: We got failed: WIRE_TEMPORARY_CHANNEL_FAILURE (... Too many HTLCs) for <local scidd>, assuming
it can't carry 295521661msat
... (98 iterations)
260: getroutes_done: need more (was_routing 295521655msat, needs_routing 295521656msat)
According to my LLM:
Where it happens
channeldreports a full slot count as a generictemporary_channel_failure:
channeld/channeld.c#L6602-L6605. The count check, including our own limit applied to
locally added HTLCs: channeld/full_channel.c#L728-L740- For a local failure (
index == 0), xpay has the precise reason ("Too many HTLCs") in the error message:
plugins/xpay/xpay.c#L1008-L1013 - It still maps every
temporary_channel_failureto "can't carry this amount":
plugins/xpay/xpay.c#L1125-L1131
and sendsaskrene-inform-channelwithinform: constrainedand the attempted amount:
plugins/xpay/xpay.c#L1181-L1193 - askrene turns that into a maximum of amount − 1 msat ("we were one msat short"):
plugins/askrene/askrene.c#L1199-L1211
- 主要语言
- C
- 星标
- 3.1k
- 派生
- 1k
- 平均合并
- 3 天 17 小时
- 30 天内合并 PR
- 27
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ElementsProject/lightning 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 66/100
ElementsProject/lightning#9634 ·
维护者通常 1 天内回复
-
plugins/recover: missing comma in nodes_for_gossip concatenates two bootstrap addresses into invalid address可能已有人在做 @bhuvan-somisetty 于 12 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
ElementsProject/lightning#9630 ·
维护者通常 1 天内回复
-
common/json_parse: json_to_bitcoin_amount fails to detect overflow and accepts negative/empty inputs可能已有人在做 @bhuvan-somisetty 于 16 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 62/100
ElementsProject/lightning#9617 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 66/100
ElementsProject/lightning#9616 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 90/100
ElementsProject/lightning#9593 ·
维护者通常 1 天内回复
查看 ElementsProject/lightning 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 61/100
HexaCluster/credcheck#94 ·
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
JS_SetPropertyInternal2 loses the value when a lazy property on the prototype runs out of memory未关闭
难度 2/5 1-3 小时 新手友好度 78/100
quickjs-ng/quickjs#1852 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 4 天内回复