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

Decide whether to use the same commitment number for both parties #43

Closed
contrun opened this issue Jun 7, 2024 · 2 comments
Closed

Comments

@contrun
Copy link
Collaborator

contrun commented Jun 7, 2024

Currently, we follow bolts to use different commitment number. bolts/00-introduction.md at master · lightning/bolts

A 48-bit incrementing counter for each commitment transaction; counters are independent for each peer in the channel and start at 0.

The current implementation store both local and remote commitment number in channel state.

ckb-pcn-node/src/ckb/channel.rs at accd10155064b624efa7afd4aafb0ab3021c5d0e · contrun/ckb-pcn-node

It seems using the same commitment number will simplify a few things (in the cost of requiring both nodes to synchronize before updating commitment number). For example, we can use the same number to store the TLC info.

Should we use the same commitment number for both parties? If so, what are the things we need to be careful from both the perspective of protocol and the perspective of implementation.

@contrun
Copy link
Collaborator Author

contrun commented Jun 15, 2024

Using the same transaction ID may result in dead lock when both parties try to send a CommitmentSigned to another. Since both parties have sent out their partial signature, they must get the RevokeAndAck message from another for the channel to make progress. But if both parties are unknowingly sending simultaneous CommitmentSIgnedmessage, then this will create a deadlock, as both of they are waiting for the RevokeAndAck message.

@contrun
Copy link
Collaborator Author

contrun commented Sep 25, 2024

As commented above #43 (comment) , there are some difficulties in using the same commitment number.

@contrun contrun closed this as completed Sep 25, 2024
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

No branches or pull requests

1 participant