Skip to content

BOLT 2: allow more leniancy with forks during channel establishment.#77

Merged
rustyrussell merged 2 commits into
lightning:masterfrom
rustyrussell:reorg-handling-in-channel-open
Jan 13, 2017
Merged

BOLT 2: allow more leniancy with forks during channel establishment.#77
rustyrussell merged 2 commits into
lightning:masterfrom
rustyrussell:reorg-handling-in-channel-open

Conversation

@rustyrussell
Copy link
Copy Markdown
Collaborator

Christoper points out that two nodes with aggressive minimum-depth settings
may see different blocks and the protocol requires they close the channel
since their funding_locked messages will disagree.

This can also happen when only one side has an aggressive minimum-depth
setting: if it sends funding_locked referring to a block which is orphaned,
it can't update it.

There are three changes here, two optional.

  • Allow sending of an updated funding_locked. This fixes this case where
    one side is on an orphan and uses a v. low minimum-depth.
  • Require accepting of an updated funding_locked.
  • Allow waiting instead of immediate failure if funding_lock disagrees.
    eg. you might wait another block or two to see if one side reorgs.

Reported-by: Christopher Jämthagen
Closes: #73
Signed-off-by: Rusty Russell rusty@rustcorp.com.au

Christoper points out that two nodes with aggressive minimum-depth settings
may see different blocks and the protocol requires they close the channel
since their funding_locked messages will disagree.

This can also happen when only one side has an aggressive minimum-depth
setting: if it sends funding_locked referring to a block which is orphaned,
it can't update it.

There are three changes here, two optional.
- Allow sending of an updated funding_locked.  This fixes this case where
  one side is on an orphan and uses a v. low minimum-depth.
- Require accepting of an updated funding_locked.
- Allow waiting instead of immediate failure if funding_lock disagrees.
  eg. you might wait another block or two to see if one side reorgs.

Reported-by: Christopher Jämthagen
Closes: lightning#73
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Comment thread 02-peer-protocol.md Outdated
received. The sender MUST set `next-per-commitment-point` to the
it MAY fail the channel if its own `channel-id` does not match the
received: otherwise it MUST ignore the `funding_locked` message.
The sender MAY re-transmit `funding_locked` if the `channel-id` changes.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we also need to specify that a node MUST retransmit the funding_locked message if the channel-id changes, otherwise we may never make progress. If both nodes silently drop the funding_locked message, but never issue send the changed channel-id then we just sit there and wait forever. This may also include sending a funding_locked at a bigger depth than what we were waiting for.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can fix this by tying the two together: If either node chooses to ignore, it must re-transmit when it changes. Because if either node is doing the naive "fail on disagree" it will have failed.

Otherwise we'd deadlock until one side timed out.

Reported-by: Christian Decker <decker.christian@gmail.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
@cdecker
Copy link
Copy Markdown
Collaborator

cdecker commented Jan 11, 2017

ACK 83e04bf

@rustyrussell rustyrussell merged commit 62b5eed into lightning:master Jan 13, 2017
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.

BOLT 2: differing channel-id fails channel

2 participants