Skip to content

lightningd: keep peer connected when rejecting a dead channel's reestablish - #9518

Open
daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:fix-eager-recover-dcs
Open

daywalker90 wants to merge 1 commit into
ElementsProject:masterfrom
daywalker90:fix-eager-recover-dcs

Conversation

@daywalker90

Copy link
Copy Markdown
Collaborator

handle_peer_spoke() sent an error for a closed or unknown channel and then unconditionally disconnected the peer. A node recovering from a static channel backup reestablishes every channel it recovered, including ones which have closed since the backup was taken. We correctly reject the dead one, but hanging up there discards the reestablishes for its still-live siblings, so we never reply to them and they stay enabled forever.

Only disconnect if the peer has no other channel which still wants peer comms.

This is what made "Update examples in doc schemas" intermittently time out: l3 reestablished its already-closed 120x1x0 before its live 132x1x0, so l3 hung up on l4 and never processed 132x1x0:

tests/autogenerate-rpc-examples.py:1618: in generate_list_examples
wait_for(lambda: [c['active'] for c in l3.rpc.listchannels(c34_2)['channels'] if c['source'] == l3.info['id']] == [False])
ValueError: Timeout while waiting for

Changelog-Fixed: lightningd: a node recovering from a static channel backup no longer hangs up on the peer when one of the recovered channels has already closed, so the peer can still close the channels which are still open.

…ablish

handle_peer_spoke() sent an error for a closed or unknown channel and
then unconditionally disconnected the peer.  A node recovering from a
static channel backup reestablishes every channel it recovered,
including ones which have closed since the backup was taken.  We
correctly reject the dead one, but hanging up there discards the
reestablishes for its still-live siblings, so we never reply to them
and they stay enabled forever.

Only disconnect if the peer has no other channel which still wants peer
comms.

This is what made "Update examples in doc schemas" intermittently time
out: l3 reestablished its already-closed 120x1x0 before its live
132x1x0, so l3 hung up on l4 and never processed 132x1x0:

  tests/autogenerate-rpc-examples.py:1618: in generate_list_examples
    wait_for(lambda: [c['active'] for c in l3.rpc.listchannels(c34_2)['channels'] if c['source'] == l3.info['id']] == [False])
    ValueError: Timeout while waiting for <lambda>

Changelog-Fixed: lightningd: a node recovering from a static channel backup no longer hangs up on the peer when one of the recovered channels has already closed, so the peer can still close the channels which are still open.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant