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

BOLT7: channel_update after exchange funding_locked #657

Open
wants to merge 2 commits into
base: master
from

Conversation

@nayuta-ueno
Copy link
Contributor

commented Aug 9, 2019

If a node sends its own channel_update to a peer node before receiving a funding_lock, the peer node may discard because it has not short_channel_id yet.

ex: node-A and node-B check blockchain every 30 seconds.

  node-A                    node-B
    |                         |
  ~~~ funding_tx is in block ~~~
    |                         |
 [detect new block]           |
 [calc short_channel_id]      |
 [create channel_update]      |
    |                         |
    |---funding_locked------->|
    |---channel_update------->|
    |                         |cannot compare short_channel_id
    |                         |  ===> discard channel_update
    |                         |
    |                         |
    |                  [detect new block]
    |                  [calc short_channel_id]
    |                  [create channel_update]
    |                         |
    |<-------funding_locked---|
    |<-------channel_update---|
compare short_channel_id      |
  ===> accept channel_update  |
    |                         |
    |                         |
BOLT7: channel_update after exchange funding_locked
If a node sends its own `channel_update` to a peer node before receiving a `funding_lock`, the peer node may discard because it has not `short_channel_id` yet.
@t-bast

This comment has been minimized.

Copy link
Collaborator

commented Aug 19, 2019

The spec mentions the following:

The receiving node:

  • if the short_channel_id does NOT match a previous channel_announcement,
  • if the short_channel_id does NOT match a previous channel_announcement,
    OR if the channel has been closed in the meantime:
    OR if the channel has been closed in the meantime:
    - MUST ignore channel_updates that do NOT correspond to one of its own
    - MUST ignore channel_updates that do NOT correspond to one of its own
    channels.
    channels.

Don't you think this covers your point already?

@nayuta-ueno

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2019

Don't you think this covers your point already?

I think so.
But some node send channel_update before receiving funding_locked, and do not send channel_update after sending channel_announcement...

Should I treat this as a node bug?

@t-bast

This comment has been minimized.

Copy link
Collaborator

commented Aug 19, 2019

I think that if what you want is to prevent nodes from sending channel_update before receiving funding_locked, it would be better to add a new bullet point saying something like MUST NOT send a channel_update before funding_locked has been received instead of the currently proposed change. What do you think? We can discuss this point during tonight's meeting.

@nayuta-ueno nayuta-ueno force-pushed the nayuta-ueno:bolt7_channel_update branch from 460089c to d85e7b8 Aug 19, 2019

@nayuta-ueno

This comment has been minimized.

Copy link
Contributor Author

commented Aug 19, 2019

Thank you!
I'll change it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.