Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BOLT 2: differing channel-id fails channel #73

Closed
cjamthagen opened this issue Jan 3, 2017 · 4 comments · Fixed by #77
Closed

BOLT 2: differing channel-id fails channel #73

cjamthagen opened this issue Jan 3, 2017 · 4 comments · Fixed by #77

Comments

@cjamthagen
Copy link
Contributor

What if two peers who want to open a channel with each other sets minimum-depth to 1 and there are two blocks created simultaneously (same height) with the funding transaction in both of them, and each peer receives a different block. They will send the funding_locked message with (most likely) different channel-id, and they must now fail the channel according to the spec. Should the protocol not handle this case?

@pm47
Copy link
Collaborator

pm47 commented Jan 3, 2017

This is a duplicate of #6, but AFAICT the minconf=6 didn't actually make it to the spec. I'd be in favor of adding it to BOLT 2.

@rustyrussell
Copy link
Collaborator

rustyrussell commented Jan 5, 2017 via email

@cdecker
Copy link
Collaborator

cdecker commented Jan 5, 2017

I'm afraid that blockchain.info has a terrible track record of finding orphans, they are far more frequent. That being said the probability of a fork decreases exponentially with the length of the fork, and we should encourage 3-4 confirmations for the channel setup. So I'm happy with failing the channel as a occasional slap on the wrist for people who go against this and try to create a low-conf channel.

@rustyrussell
Copy link
Collaborator

Agreed their detection is not great, but it's probably a fair basis to estimate how often two random nodes will see different blocks.

I think low-conf channels are a usability win though, so I think weakening the spec a little to allow workarounds if people want that is a good thing. I'll turn it into a formal PR for discussion, though...

rustyrussell added a commit to rustyrussell/lightning-rfc that referenced this issue Jan 5, 2017
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>
rustyrussell added a commit to rustyrussell/lightning-rfc that referenced this issue Jan 5, 2017
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>
rustyrussell added a commit that referenced this issue Jan 13, 2017
…77)

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

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>
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 a pull request may close this issue.

4 participants