connectd: swallow channel-scoped error instead of queuing it - #9436
Open
vincenzopalazzo wants to merge 2 commits into
Open
connectd: swallow channel-scoped error instead of queuing it#9436vincenzopalazzo wants to merge 2 commits into
vincenzopalazzo wants to merge 2 commits into
Conversation
BOLT ElementsProject#1 says upon receiving a channel-scoped error the node MUST fail that channel. connectd only told lightningd about WIRE_ERROR when find_subd failed; if a dying channeld still existed the error was queued and never read, so the channel stayed CHANNELD_NORMAL. The test rolls l2's db back after a payment, freezes l1's channeld after reestablish, then lets l2 send "Awaiting unilateral close". It fails until the next commit. Reproduces: ElementsProject#9424 Reported-by: Leo Nash (@tankyleo) Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
force-pushed
the
connectd-forward-channel-error
branch
from
August 18, 2026 11:14
5e70d0d to
cf9378e
Compare
channeld abort()s on WIRE_ERROR ("swallowed by connectd"), but we
only told lightningd when find_subd failed. If a subd existed we
enqueued the error; a dying channeld never read it, and a live
one would abort, so the channel stayed up.
Always tell lightningd via CONNECTD_PEER_SPOKE and do not enqueue.
handle_peer_spoke already permanently fails the channel.
Fixes: ElementsProject#9424
Changelog-Fixed: Protocol: fail the channel on a peer error even if channeld is exiting.
Reported-by: Leo Nash (@tankyleo)
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
vincenzopalazzo
force-pushed
the
connectd-forward-channel-error
branch
from
August 18, 2026 11:38
cf9378e to
996dc6e
Compare
vincenzopalazzo
requested review from
Andezion and
nGoline
and removed request for
Andezion
August 18, 2026 11:58
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BOLT #1 says upon receiving a channel-scoped
errorthe node MUST fail that channel. connectd only told lightningd aboutWIRE_ERRORwhenfind_subdfailed; if a subd existed the error was queued to it.channeldabort()s if it ever seesWIRE_ERROR("swallowed by connectd"), and a dyingchanneldnever reads the queue, so the channel stayedCHANNELD_NORMAL.Always swallow a channel-scoped
WIRE_ERRORin connectd: tell lightningd viaCONNECTD_PEER_SPOKEand do not enqueue, whether or not a subd exists.handle_peer_spokealready permanently fails the channel. Do not create a dummy subd just to carry the error.Two commits, failing test then fix:
tests: reproduce lost channel error while channeld is exiting(@pytest.mark.xfail(strict=True))connectd: swallow channel-scoped error instead of queuing it(removes the xfail)Local
test_channel_error_not_lost_while_channeld_exits:Timeout while waiting for AWAITING_UNILATERAL)Thanks to Leo Nash (@tankyleo) for the report.
Fixes: #9424
Reported-by: Leo Nash (@tankyleo)
Changelog-Fixed: Protocol: fail the channel on a peer error even if channeld is exiting.